<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-9963485</atom:id><lastBuildDate>Tue, 28 May 2013 08:26:18 +0000</lastBuildDate><title>milek's blog</title><description></description><link>http://milek.blogspot.com/</link><managingEditor>noreply@blogger.com (milek)</managingEditor><generator>Blogger</generator><openSearch:totalResults>640</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-198265743666446779</guid><pubDate>Tue, 28 May 2013 08:26:00 +0000</pubDate><atom:updated>2013-05-28T10:26:18.557+02:00</atom:updated><title>NSS_OPTIONS</title><description>Sometimes developers put undocumented options in their code to help with debugging issues. This morning I came across one of such options which prints extra debug information when executing NSS queries.&lt;br /&gt;&lt;br /&gt;First you need to disable nscd:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# svcadm disable -t name-service/cache&lt;br /&gt;&lt;/pre&gt;Then you need to set env variable debug_eng_loop to &gt;0, for example: &lt;pre&gt;&lt;br /&gt;# NSS_OPTIONS="debug_eng_loop=2" ping -I 1 wp.pl&lt;br /&gt;NSS_retry(0): 'ipnodes': trying 'files' ... result=NOTFOUND, action=CONTINUE&lt;br /&gt;NSS: 'ipnodes': continue ...&lt;br /&gt;NSS_retry(0): 'ipnodes': trying 'dns' ... result=SUCCESS, action=RETURN&lt;br /&gt;NSS: 'ipnodes': return.&lt;br /&gt;PING wp.pl: 56 data bytes&lt;br /&gt;&lt;/pre&gt; What's good about it is that it tells you which database configured in NSS returned the result. </description><link>http://milek.blogspot.com/2013/05/nssoptions.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-380482016845985323</guid><pubDate>Tue, 21 May 2013 14:09:00 +0000</pubDate><atom:updated>2013-05-21T16:11:12.879+02:00</atom:updated><title>Setting RPATH</title><description>Today I was made aware that elfedit tool in Solaris 11 allows for setting RPATH (among other things). The only caveat is that a binary had to be linked on Solaris 11. It is very easy to use:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt; # elfedit -e 'dyn:runpath $ORIGIN/../lib' /opt/bin/myprog&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;There is a nice &lt;a href="https://blogs.oracle.com/ali/entry/introducing_elfedit_a_tool_for"&gt;blog entry about it&lt;/a&gt; from Ali Bahrami. </description><link>http://milek.blogspot.com/2013/05/setting-rpath.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-2902136420187273515</guid><pubDate>Sat, 18 May 2013 18:19:00 +0000</pubDate><atom:updated>2013-05-18T20:19:09.744+02:00</atom:updated><title>Btrfs: "are we there yet?"</title><description>&lt;a href="https://lwn.net/Articles/548937/"&gt;Not in the foreseeable future...&lt;/a&gt;</description><link>http://milek.blogspot.com/2013/05/btrfs-are-we-there-yet.html</link><author>noreply@blogger.com (milek)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-1563095799191929326</guid><pubDate>Fri, 22 Mar 2013 12:47:00 +0000</pubDate><atom:updated>2013-03-22T13:47:59.142+01:00</atom:updated><title>OpenAFS on Solaris 11 x86</title><description>Two days ago I presented at the UK Solaris SIG meeting on running &lt;a href="http://www.ukoug.org/what-we-offer/library/openafs-on-solaris-11-x86-robert-milkowski/"&gt;OpenAFS on Solaris 11 x86&lt;/a&gt;. This is essentially &lt;a href="http://milek.blogspot.co.uk/2012/10/running-openafs-on-solaris-11-x86-zfs.html"&gt;the same talk&lt;/a&gt; I gave last year in Edinburgh, I just added few slides explaining what OpenAFS is.</description><link>http://milek.blogspot.com/2013/03/openafs-on-solaris-11-x86.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-1705728152811056309</guid><pubDate>Mon, 18 Mar 2013 23:28:00 +0000</pubDate><atom:updated>2013-03-19T00:28:38.045+01:00</atom:updated><title>-ck hacking: Other schedulers? Illumos?</title><description>&lt;a href="http://ck-hack.blogspot.be/2010/10/other-schedulers-illumos.html?m=1"&gt;-ck hacking: Other schedulers? Illumos?&lt;/a&gt;</description><link>http://milek.blogspot.com/2013/03/ck-hacking-other-schedulers-illumos.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-282355032704402006</guid><pubDate>Fri, 08 Mar 2013 12:13:00 +0000</pubDate><atom:updated>2013-03-08T13:13:47.231+01:00</atom:updated><title>ZFS Write Performance</title><description>Interesting blog entry from guys at Delphix on &lt;a href="http://blog.delphix.com/uday/2013/02/19/78/"&gt;ZFS write performance - impact of fragmentation&lt;/a&gt;.</description><link>http://milek.blogspot.com/2013/03/zfs-write-performance.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-3709565780516961430</guid><pubDate>Tue, 05 Mar 2013 09:28:00 +0000</pubDate><atom:updated>2013-03-05T10:28:09.810+01:00</atom:updated><title>ZFS: no-op overwrites</title><description>There is an interesting new feature in ZFS in Illumos.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://www.illumos.org/issues/3236"&gt;https://www.illumos.org/issues/3236&lt;/a&gt;&lt;br /&gt;&lt;div class="wiki"&gt; &lt;blockquote class="tr_bq"&gt;When overwriting a block which is check summed with a  cryptographically secure hash function we can compare the old and new  checksums for the block to determine if they differ (at almost no cost  since we were going to do the checksums anyway). If they do not differ  we don't actually need to do the write. This:&lt;br /&gt;1) Reduces I/O&lt;br /&gt;2)  Reduces space usage, because if the old block is referenced by a  snapshot we will need to keep both copies of the block around even  though they contain the same data.&lt;br /&gt;    This functionality is only enabled if:&lt;br /&gt;1) The old and new blocks are checksummed using the same algorithm.&lt;br /&gt;2) That algorithm is cryptographically secure (e.g. sha256)&lt;br /&gt;3) Compression is enabled on that block.&lt;/blockquote&gt;&amp;nbsp;Philosophical question - should we just trust sha256?&lt;/div&gt;&lt;div class="wiki"&gt;(it seems this can't be disabled nor there is an option similar to verify=on in dedup).&lt;/div&gt;&lt;div class="wiki"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="wiki"&gt;There are more interesting new zfs features in Illumos (for example &lt;a href="https://www.illumos.org/issues/3145"&gt;this one&lt;/a&gt; which does a similar thing to what Solaris 11 does). The only regret is that unless one wants to play with one of the appliances based on Illumos the only way to use these features is to use FreeBSD or Linux, which is rather ironic. But on the other hand - why not? At least at home.&lt;/div&gt;&lt;div class="wiki"&gt;&amp;nbsp;&lt;/div&gt;</description><link>http://milek.blogspot.com/2013/03/zfs-no-op-overwrites.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-8702459145880387216</guid><pubDate>Fri, 04 Jan 2013 19:27:00 +0000</pubDate><atom:updated>2013-01-04T20:27:49.080+01:00</atom:updated><title>Whose bug is this anyway?!?</title><description>&lt;a href="http://www.codeofhonor.com/blog/whose-bug-is-this-anyway"&gt;Interesting post&lt;/a&gt; on bug fixing.</description><link>http://milek.blogspot.com/2013/01/whose-bug-is-this-anyway.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-2596752665245844428</guid><pubDate>Tue, 20 Nov 2012 12:44:00 +0000</pubDate><atom:updated>2012-11-20T13:44:06.938+01:00</atom:updated><title>SPARC at 25: Past, Present and Future</title><description>&lt;iframe allowfullscreen="" frameborder="0" height="270" src="http://www.youtube.com/embed/w3ukXhEaYGI?fs=1" width="480"&gt;&lt;/iframe&gt;</description><link>http://milek.blogspot.com/2012/11/sparc-at-25-past-present-and-future.html</link><author>noreply@blogger.com (milek)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/w3ukXhEaYGI/default.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-4501773214073460574</guid><pubDate>Fri, 09 Nov 2012 12:23:00 +0000</pubDate><atom:updated>2012-11-09T13:23:05.793+01:00</atom:updated><title>vmtasks explained</title><description>&lt;a href="https://blogs.oracle.com/sistare/entry/faster_memory_allocation_using_vmtasks"&gt;&lt;/a&gt;Solaris 11 introduced a new kernel process called "vmtasks" which accelerates some operations when working with shared memory. For more details &lt;a href="https://blogs.oracle.com/sistare/entry/faster_memory_allocation_using_vmtasks" target="_blank"&gt;see here&lt;/a&gt;.</description><link>http://milek.blogspot.com/2012/11/vmtasks-explained.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-5035654037087216200</guid><pubDate>Fri, 09 Nov 2012 11:55:00 +0000</pubDate><atom:updated>2012-11-09T12:57:01.400+01:00</atom:updated><title>20 Years of Solaris</title><description>Nice video from Oracle celebrating 20 years of Solaris.  &lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="315" src="http://www.youtube.com/embed/IpYkPI2REWo" width="560"&gt;&lt;/iframe&gt;</description><link>http://milek.blogspot.com/2012/11/20-years-of-solaris.html</link><author>noreply@blogger.com (milek)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/IpYkPI2REWo/default.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-4975423587496421254</guid><pubDate>Mon, 22 Oct 2012 23:55:00 +0000</pubDate><atom:updated>2012-10-25T22:48:31.114+02:00</atom:updated><title>Running OpenAFS on Solaris 11 x86 / ZFS</title><description>&lt;div style="text-align: justify;"&gt;Recently I gave a talk on running &lt;a href="http://www.openafs.org/" target="_blank"&gt;OpenAFS &lt;/a&gt;services on top of Solaris 11 x86 / ZFS. The talk was split in two parts - first part about $$ benefits of transparent ZFS compression, when running on 3rd party x86 hardware (but it also makes sense when running on Sun/Oracle kit - in some cases even more so). This part also discusses some ideas about running AFS on internal disks instead of directly attached disk arrays, which again, thanks to ZFS built-in compression makes it worthwhile and&amp;nbsp; delivers even more $$ savings.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The main message of this part is, that if your data compresses well (above 2x), running OpenAFS on ZFS can deliver similar or even better performance but most importantly it can save you lots of $$, both in acquisition costs, and in cost of running AFS plant. In most cases you should even be able to re-use the current x86 hardware you have. The beauty of AFS is, that we were able to migrate data from Linux to Solaris/ZFS, in-place, by re-using the same x86 HW, and all of this was completely transparent to all clients (keep in mind we are talking about PBs of data) - this is truly the cloud file system. I think OpenAFS is one of the under-appreciated technologies in the market.&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The second part is about using DTrace, both in dev and in production systems, to find scalability and performance bottlenecks, and other bugs as well. Two easy and real-life examples are discussed, which resulted in considerable improvement in scalability and performance of some operations in OpenAFS, along with some other examples of D scripts which provide top-like output with some statistics (slide #32 is an example from a Solaris NFS server, serving VMWare clients and displaying different stats per VM from a single file system...). DTrace has proven to be a very powerful and helpful tool for us, although it is hard to put a specific $ value it brings.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The slides should be available &lt;a href="http://conferences.inf.ed.ac.uk/eakc2012/slides/AFS_on_Solaris_ZFS.pdf" target="_blank"&gt;here&lt;/a&gt;.&lt;/div&gt;</description><link>http://milek.blogspot.com/2012/10/running-openafs-on-solaris-11-x86-zfs.html</link><author>noreply@blogger.com (milek)</author><thr:total>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-6985084612389140231</guid><pubDate>Wed, 29 Aug 2012 18:54:00 +0000</pubDate><atom:updated>2012-08-29T20:55:49.385+02:00</atom:updated><title>Open Indiana is dead</title><description>With the main guy behind the project &lt;a href="http://www.yaesu.co.uk/product_info.php?cPath=179_224&amp;amp;products_id=1235"&gt;resigning&lt;/a&gt;, OI is essentially dead. It's been dead for some time though and with no commercial backing it never really had much chance. This is sad news indeed (although I haven't really used OI). It marks the end of Open Solaris era.&lt;br /&gt;&lt;br /&gt;Can Illumos survive in the long term? Can it become relevant outside of couple of niche use cases?&lt;br /&gt;&lt;br /&gt;Ironically, it is Oracle's Solaris which will probably outlive all of them.</description><link>http://milek.blogspot.com/2012/08/open-indiana-is-dead.html</link><author>noreply@blogger.com (milek)</author><thr:total>4</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-3048853624988359099</guid><pubDate>Fri, 24 Aug 2012 18:26:00 +0000</pubDate><atom:updated>2012-08-24T20:26:47.393+02:00</atom:updated><title>1,000,000,000,000 Frames/Second Photography - Ramesh Raskar</title><description>&lt;iframe allowfullscreen="" frameborder="0" height="270" src="http://www.youtube.com/embed/SoHeWgLvlXI?fs=1" width="480"&gt;&lt;/iframe&gt;</description><link>http://milek.blogspot.com/2012/08/1000000000000-framessecond-photography.html</link><author>noreply@blogger.com (milek)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/SoHeWgLvlXI/default.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-1333015087793441940</guid><pubDate>Fri, 24 Aug 2012 16:07:00 +0000</pubDate><atom:updated>2012-08-24T18:11:09.926+02:00</atom:updated><title>SmartOS: An SA Primer</title><description>&lt;a href="http://www.cuddletech.com/"&gt;Ben Rockwood&lt;/a&gt; on SmartOS and Illumos.  &lt;iframe width="560" height="315" src="http://www.youtube.com/embed/dxZExLeJz2I" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; Ben - IPS is actually cool! :P</description><link>http://milek.blogspot.com/2012/08/smartos-sa-primer.html</link><author>noreply@blogger.com (milek)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/dxZExLeJz2I/default.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-2576415054784412637</guid><pubDate>Fri, 27 Jul 2012 12:04:00 +0000</pubDate><atom:updated>2012-07-27T14:04:11.148+02:00</atom:updated><title>Locking a running process in RAM</title><description>&lt;div style="text-align: justify;"&gt;Recently I was looking at a possibility of locking some or all memory mappings, for an already running process, in RAM. Why would you want to do it? There might be many reasons. One of them is to prevent a critical process to be swapped out.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Now, how can we do it without restarting a process or changing its code? There is memcntl() and similar calls like plock(), mlock(), etc. - but they only work for a process which is calling them. However libproc on Solaris allows you to run memcntl() in a context of other process, among many other cool things. By the way - libproc is used by tools like truss, ppgsz, etc.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;First, lets see that it actually works. Here is a bash process running as a non-root user, see that no mappings are locked in RAM. &lt;/div&gt;&lt;pre&gt;cwafseng3 $ pmap -ax $$&lt;br /&gt;27709:  bash&lt;br /&gt; Address  Kbytes     RSS    Anon  &lt;b&gt;Locked &lt;/b&gt;Mode   Mapped File&lt;br /&gt;08050000     968     968       -       - r-x--  bash&lt;br /&gt;08151000      76      76       8       - rwx--  bash&lt;br /&gt;08164000     140     140      56       - rwx--    [ heap ]&lt;br /&gt;F05D0000     440     440       -       - r-x--  libnsl.so.1&lt;br /&gt;F064E000       8       8       4       - rw---  libnsl.so.1&lt;br /&gt;F0650000      20      12       -       - rw---  libnsl.so.1&lt;br /&gt;F0660000      56      56       -       - r-x--  libsocket.so.1&lt;br /&gt;F067E000       4       4       -       - rw---  libsocket.so.1&lt;br /&gt;FE560000      64      16       -       - rwx--    [ anon ]&lt;br /&gt;FE577000       4       4       4       - rwxs-    [ anon ]&lt;br /&gt;FE580000      24      12       4       - rwx--    [ anon ]&lt;br /&gt;FE590000       4       4       4       - rw---    [ anon ]&lt;br /&gt;FE5A0000    1352    1352       -       - r-x--  libc_hwcap1.so.1&lt;br /&gt;FE702000      44      44      16       - rwx--  libc_hwcap1.so.1&lt;br /&gt;FE70D000       4       4       -       - rwx--  libc_hwcap1.so.1&lt;br /&gt;FE710000       4       4       -       - r-x--  libdl.so.1&lt;br /&gt;FE720000       4       4       4       - rw---    [ anon ]&lt;br /&gt;FE730000     184     184       -       - r-x--  libcurses.so.1&lt;br /&gt;FE76E000      16      16       -       - rw---  libcurses.so.1&lt;br /&gt;FE772000       8       8       -       - rw---  libcurses.so.1&lt;br /&gt;FE780000       4       4       4       - rw---    [ anon ]&lt;br /&gt;FE790000       4       4       4       - rw---    [ anon ]&lt;br /&gt;FE7A0000       4       4       -       - rw---    [ anon ]&lt;br /&gt;FE7AD000       4       4       -       - r--s-    [ anon ]&lt;br /&gt;FE7B4000     220     220       -       - r-x--  ld.so.1&lt;br /&gt;FE7FB000       8       8       4       - rwx--  ld.so.1&lt;br /&gt;FE7FD000       4       4       -       - rwx--  ld.so.1&lt;br /&gt;FEFFB000      16      16       4       - rw---    [ stack ]&lt;br /&gt;-------- ------- ------- ------- -------&lt;br /&gt;total Kb    3688    3620     116       -&lt;br /&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;Now, I will use the small tool I wrote, to lock all mappings with RX or RWX protections on them. The tool requires for a PID to be specified.  &lt;/div&gt;&lt;pre&gt;$ ./pr_memcntl 27709&lt;br /&gt;pr_memcntl() failed: Not owner&lt;br /&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;Although I run it as root, it failed. Remember when I wrote a moment ago, that libproc would call memcntl() from a contetx of the target process? The target process here is bash with pid 27709 and it is running as a standard user, and by default a standard user cannot lock pages in memory. We can add the required privileges for locking pages in RAM. Lets see what's missing.  I enabled privilege debugging for the bash process and run the pr_memcntl tool again  &lt;/div&gt;&lt;pre&gt;$ ppriv -D 27709&lt;br /&gt;bash[27709]: missing privilege "&lt;b&gt;proc_lock_memory&lt;/b&gt;"&lt;br /&gt;            (euid = 145104, syscall = 131) needed at memcntl+0x140&lt;br /&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;Now, lets add the missing privilege to the bash process and then try again locking the mappings:  &lt;/div&gt;&lt;pre&gt;$ ppriv -s EP+&lt;b&gt;proc_lock_memory&lt;/b&gt; 27709&lt;br /&gt;$ ./pr_memcntl 27709&lt;br /&gt;$&lt;br /&gt;&lt;/pre&gt;This time no error, lets see the pmap output again:  &lt;br /&gt;&lt;pre&gt;$ pmap -ax $$&lt;br /&gt;27709:  bash&lt;br /&gt; Address  Kbytes     RSS    Anon  &lt;b&gt;Locked &lt;/b&gt;Mode   Mapped File&lt;br /&gt;08050000     968     968       -     968 r-x--  bash&lt;br /&gt;08151000      76      76       8      76 rwx--  bash&lt;br /&gt;08164000     140     140      48     140 rwx--    [ heap ]&lt;br /&gt;F05D0000     440     440       -     440 r-x--  libnsl.so.1&lt;br /&gt;F064E000       8       8       4       - rw---  libnsl.so.1&lt;br /&gt;F0650000      20      12       -       - rw---  libnsl.so.1&lt;br /&gt;F0660000      56      56       -      56 r-x--  libsocket.so.1&lt;br /&gt;F067E000       4       4       -       - rw---  libsocket.so.1&lt;br /&gt;FE560000      64      64       -      64 rwx--    [ anon ]&lt;br /&gt;FE577000       4       4       4       - rwxs-    [ anon ]&lt;br /&gt;FE580000      24      24       4      24 rwx--    [ anon ]&lt;br /&gt;FE590000       4       4       4       - rw---    [ anon ]&lt;br /&gt;FE5A0000    1352    1352       -    1352 r-x--  libc_hwcap1.so.1&lt;br /&gt;FE702000      44      44      16      44 rwx--  libc_hwcap1.so.1&lt;br /&gt;FE70D000       4       4       -       4 rwx--  libc_hwcap1.so.1&lt;br /&gt;FE710000       4       4       -       4 r-x--  libdl.so.1&lt;br /&gt;FE720000       4       4       4       - rw---    [ anon ]&lt;br /&gt;FE730000     184     184       -     184 r-x--  libcurses.so.1&lt;br /&gt;FE76E000      16      16       -       - rw---  libcurses.so.1&lt;br /&gt;FE772000       8       8       -       - rw---  libcurses.so.1&lt;br /&gt;FE780000       4       4       4       - rw---    [ anon ]&lt;br /&gt;FE790000       4       4       4       - rw---    [ anon ]&lt;br /&gt;FE7A0000       4       4       -       - rw---    [ anon ]&lt;br /&gt;FE7AD000       4       4       -       - r--s-    [ anon ]&lt;br /&gt;FE7B4000     220     220       -     220 r-x--  ld.so.1&lt;br /&gt;FE7FB000       8       8       4       8 rwx--  ld.so.1&lt;br /&gt;FE7FD000       4       4       -       4 rwx--  ld.so.1&lt;br /&gt;FEFFB000      16      16       4       - rw---    [ stack ]&lt;br /&gt;-------- ------- ------- ------- -------&lt;br /&gt;total Kb    3688    3680     108    3588&lt;br /&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;It works! :)&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Notice that only mappings with RX or RWX protections are locked (as hard-coded in the tool, but any mappings or entire process can be locked if desired).  The tool can obviously easily be expanded so it automatically adds the privilege if needed.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The C code below is a prototype - it is not idiot proof nor does it handle all errors, and it could be more user friendly - but it works and it is trivial to extend it. It should work on Solaris 10 and Solaris 11 and also on all Illumos based distributions.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Notice, that it sets MCL_CURRENT|MCL_FUTURE flags, meaning that not only current rx|rwx mappings are locked but also all future mappings, with the rx|rwx protections set, will be locked as well. In order to compile the program you need libproc.h which is currently not distributed with Solaris (hopefully it will change soon). You can get a copy from &lt;a href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libproc/common/libproc.h"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Some ideas on how the tool could be easily extended:&lt;/div&gt;&lt;ul&gt;&lt;li style="text-align: justify;"&gt;add an option to add the proc_lock_memory automatically (and perhaps update resource limit as well)&lt;/li&gt;&lt;li style="text-align: justify;"&gt;add an option to remove a lock on specific mapping or from all mappings&lt;/li&gt;&lt;li style="text-align: justify;"&gt;add an option to specify what should be lock&lt;/li&gt;&lt;li style="text-align: justify;"&gt;add options to specify if only current mappings and/or future mappings should be locked as well&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;ps. putting a process in RT class would achieve a similar result, although it wouldn't give a control over which mappings should be locked, and running in RT might not be desirable for other reasons as well&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;// gcc -m64 -lproc -I. -o pr_memcntl pr_memcntl.c&lt;br /&gt; &lt;br /&gt;#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/mman.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt; &lt;br /&gt;#include &amp;lt;libproc.h&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv) {&lt;br /&gt;  pid_t pid;&lt;br /&gt;  int perr;&lt;br /&gt;  static struct ps_prochandle *Pr;&lt;br /&gt; &lt;br /&gt;  pid = atoi(argv[1]);&lt;br /&gt; &lt;br /&gt;  if((Pr = Pgrab(pid, PGRAB_NOSTOP, &amp;amp;perr)) == NULL) {&lt;br /&gt;    printf("Pgrab() failed: %s\n", Pgrab_error(perr));&lt;br /&gt;    exit(1);&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  if(pr_memcntl(Pr, 0, 0, MC_LOCKAS, (caddr_t)(MCL_CURRENT|MCL_FUTURE), PROC_TEXT, (int)0)) {&lt;br /&gt;    perror("pr_memcntl() failed");&lt;br /&gt;    Prelease(Pr, 0);&lt;br /&gt;    exit(1);&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  if(pr_memcntl(Pr, 0, 0, MC_LOCKAS, (caddr_t)(MCL_CURRENT|MCL_FUTURE), PROC_TEXT|PROT_WRITE, (int)0)) {&lt;br /&gt;    perror("pr_memcntl() failed");&lt;br /&gt;    Prelease(Pr, 0);&lt;br /&gt;    exit(1);&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  Prelease(Pr, 0);&lt;br /&gt;  Pr = NULL;&lt;br /&gt; &lt;br /&gt;  exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</description><link>http://milek.blogspot.com/2012/07/locking-running-process-in-ram.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-1146348776931442820</guid><pubDate>Wed, 02 May 2012 15:22:00 +0000</pubDate><atom:updated>2012-05-02T17:22:15.903+02:00</atom:updated><title>Physical disk locations</title><description>zpool(1M) has a very handy option to display physical disk locations on some hardware. &lt;br /&gt;&lt;pre&gt;cwafseng3 $ zpool status -l cwafseng3-0&lt;br /&gt;  pool: cwafseng3-0&lt;br /&gt; state: ONLINE&lt;br /&gt;  scan: scrub canceled on Thu Apr 12 13:52:13 2012&lt;br /&gt;config:&lt;br /&gt; &lt;br /&gt;        NAME                                       STATE     READ WRITE CKSUM&lt;br /&gt;        cwafseng3-0                                ONLINE       0     0     0&lt;br /&gt;          raidz1-0                                 ONLINE       0     0     0&lt;br /&gt;            /dev/chassis/i86pc.unknown/&lt;b&gt;HDD02&lt;/b&gt;/disk  ONLINE       0     0     0&lt;br /&gt;            /dev/chassis/i86pc.unknown/&lt;b&gt;HDD23&lt;/b&gt;/disk  ONLINE       0     0     0&lt;br /&gt;            /dev/chassis/i86pc.unknown/&lt;b&gt;HDD22&lt;/b&gt;/disk  ONLINE       0     0     0&lt;br /&gt;            /dev/chassis/i86pc.unknown/&lt;b&gt;HDD21&lt;/b&gt;/disk  ONLINE       0     0     0&lt;br /&gt;            /dev/chassis/i86pc.unknown/&lt;b&gt;HDD20&lt;/b&gt;/disk  ONLINE       0     0     0&lt;br /&gt;            /dev/chassis/i86pc.unknown/&lt;b&gt;HDD19&lt;/b&gt;/disk  ONLINE       0     0     0&lt;br /&gt;            /dev/chassis/i86pc.unknown/&lt;b&gt;HDD17&lt;/b&gt;/disk  ONLINE       0     0     0&lt;br /&gt;            /dev/chassis/i86pc.unknown/&lt;b&gt;HDD15&lt;/b&gt;/disk  ONLINE       0     0     0&lt;br /&gt; &lt;br /&gt;errors: No known data errors&lt;br /&gt;cwafseng3 $&lt;br /&gt;&lt;/pre&gt;The HDDXX entries directly correspond to the physical slots, in this case in Sun x4270M2 server. Compare it to the standard output: &lt;pre&gt;&lt;br /&gt;cwafseng3 $ zpool status cwafseng3-0&lt;br /&gt;  pool: cwafseng3-0&lt;br /&gt; state: ONLINE&lt;br /&gt;  scan: scrub canceled on Thu Apr 12 13:52:13 2012&lt;br /&gt;config:&lt;br /&gt;&lt;br /&gt;        NAME                       STATE     READ WRITE CKSUM&lt;br /&gt;        cwafseng3-0                ONLINE       0     0     0&lt;br /&gt;          raidz1-0                 ONLINE       0     0     0&lt;br /&gt;            c3t5000CCA00AC87F55d0  ONLINE       0     0     0&lt;br /&gt;            c3t5000CCA00AAA0D1Dd0  ONLINE       0     0     0&lt;br /&gt;            c3t5000CCA00AA95559d0  ONLINE       0     0     0&lt;br /&gt;            c3t5000CCA00AAAD155d0  ONLINE       0     0     0&lt;br /&gt;            c3t5000CCA015214845d0  ONLINE       0     0     0&lt;br /&gt;            c3t5000CCA015214F85d0  ONLINE       0     0     0&lt;br /&gt;            c3t5000CCA01521070Dd0  ONLINE       0     0     0&lt;br /&gt;            c3t5000CCA0151A287Dd0  ONLINE       0     0     0&lt;br /&gt;&lt;br /&gt;errors: No known data errors&lt;br /&gt;cwafseng3 $ &lt;br /&gt;&lt;/pre&gt; See also croinfo(1M) for how to get this information (and more) for all disk drives regardless if they are part of zpool or not.</description><link>http://milek.blogspot.com/2012/05/physical-disk-locations.html</link><author>noreply@blogger.com (milek)</author><thr:total>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-2335567174494243189</guid><pubDate>Fri, 23 Mar 2012 11:35:00 +0000</pubDate><atom:updated>2012-03-23T12:35:59.506+01:00</atom:updated><title>Illumos: Google Summer of Code</title><description>Are you a student and would like to do some interesting coding during the summer? If yes, then &lt;a href="https://www.illumos.org/projects/illumos-gate/wiki/Google_Summer_of_Code"&gt;check this&lt;/a&gt;.</description><link>http://milek.blogspot.com/2012/03/illumos-google-summer-of-code.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-2107545699467815882</guid><pubDate>Fri, 23 Mar 2012 11:08:00 +0000</pubDate><atom:updated>2012-03-23T12:08:13.902+01:00</atom:updated><title>New Comparison of Memory Allocators</title><description></description><link>http://milek.blogspot.com/2012/03/new-comparison-of-memory-allocators.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-4317631088169897434</guid><pubDate>Fri, 20 Jan 2012 17:50:00 +0000</pubDate><atom:updated>2012-01-21T17:35:27.905+01:00</atom:updated><title>MWAC in Global Zone</title><description>Solaris 11 has a new cool feature called &lt;a href="http://docs.oracle.com/cd/E23824_01/html/821-1460/glhdg.html#scrolltoc"&gt;Immutable Zones&lt;/a&gt;. Darren Moffat presented new features in Solaris 11 Zones at the last LOSUG meeting in London. Immutable Zones basically allow for read-only or partially read-only Zones to be deployed. You can even combine it with ZFS encryption - see Darren's &lt;a href="http://blogs.oracle.com/darren/entry/immutable_zones_on_encrypted_zfs"&gt;blog entry&lt;/a&gt; for more details. The underlying technology to immutable zones&amp;nbsp; is called Mandatory Write Access Control (MWAC) and is implemented in kernel. So for each open, unlink, etc. syscall a VFS layer checks if MWAC is enabled for a given filesystem and a zone and if it is it will check white and black lists associated with a zone and potentially deny write access to a file (generating EROFS). The actual definitions for different default profiles are located in /usr/lib/brand/solaris/config.xml file. It is *very* simple to use the pre-defined profiles when creating a zone and it just works. Really cool. Thanks Darren for the great demo.&lt;br /&gt;&lt;br /&gt;Now MWAC only works with non-global zones... at least by default. There is no public interface exposed to manipulate MWAC rules directly or to enable it for a global zone but it doesn't mean one can't try to do it anyway. DTrace, objdump, mdb, etc. were very helpful here to see what's going on. The result of having couple of hours of fun is below.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;root@global # touch /test/file1&lt;br /&gt;root@global # rm -f /test/file1&lt;br /&gt;root@global # ./mwac -b "/test/file1"&lt;br /&gt;MWAC black list for the global zone installed.&lt;br /&gt;&lt;br /&gt;root@global # touch /test/file1&lt;br /&gt;touch: cannot create /test/file1: Read-only file system&lt;br /&gt;root@global # touch /test/file2 ; rm /test/file2&lt;br /&gt;root@global # &lt;br /&gt;&lt;/pre&gt;Now lets disable MWAC again:&lt;br /&gt;&lt;pre&gt;root@global # mwac -u&lt;br /&gt;MWAC unlock succeeded.&lt;br /&gt;&lt;br /&gt;root@global # touch /test/file1 ; rm /test/file1&lt;br /&gt;root@global # &lt;br /&gt;&lt;/pre&gt;You can even use patterns:&lt;br /&gt;&lt;pre&gt;root@global # mwac -b "/test/*"&lt;br /&gt;MWAC black list for the global zone installed.&lt;br /&gt;&lt;br /&gt;root@global # touch /test/a ; mkdir /test/b&lt;br /&gt;touch: cannot create /test/a: Read-only file system&lt;br /&gt;mkdir: Failed to make directory "/test/b"; Read-only file system&lt;br /&gt;root@global # &lt;br /&gt;&lt;/pre&gt;</description><link>http://milek.blogspot.com/2012/01/immutable-global-zone.html</link><author>noreply@blogger.com (milek)</author><thr:total>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-3763568575240315564</guid><pubDate>Thu, 19 Jan 2012 12:26:00 +0000</pubDate><atom:updated>2012-01-19T13:26:02.342+01:00</atom:updated><title>ReFS</title><description>Next generation file system for Windows: &lt;a href="http://blogs.msdn.com/b/b8/archive/2012/01/16/building-the-next-generation-file-system-for-windows-refs.aspx"&gt;ReFS&lt;/a&gt;&lt;br /&gt;It looks pretty interesting and promising. Something like ZFS lite for Windows. &lt;br /&gt;&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;"The key goals of ReFS are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Maintain a high degree of  compatibility with a subset of NTFS features that are widely adopted  while deprecating others that provide limited value at the cost of  system complexity and footprint.&lt;/li&gt;&lt;li&gt;Verify and auto-correct  data. Data can get corrupted due to a number of reasons and therefore  must be verified and, when possible, corrected automatically. Metadata  must not be written in place to avoid the possibility of “torn writes,”  which we will talk about in more detail below.&lt;/li&gt;&lt;li&gt;Optimize for  extreme scale. Use scalable structures for everything. Don’t assume that  disk-checking algorithms, in particular, can scale to the size of the  entire file system.&lt;/li&gt;&lt;li&gt;Never take the file system offline.  Assume that in the event of corruptions, it is advantageous to isolate  the fault while allowing access to the rest of the volume. This is done  while salvaging the maximum amount of data possible, all done live.&lt;/li&gt;&lt;li&gt;Provide  a full end-to-end resiliency architecture when used in conjunction with  the Storage Spaces feature, which was co-designed and built in  conjunction with ReFS.&lt;/li&gt;&lt;/ul&gt;The key features of ReFS are as follows (note that some of these features are provided in conjunction with Storage Spaces).&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Metadata integrity with checksums&lt;/li&gt;&lt;li&gt;Integrity streams providing optional user data integrity&lt;/li&gt;&lt;li&gt;Allocate on write transactional model for robust disk updates (also known as copy on write)&lt;/li&gt;&lt;li&gt;Large volume, file and directory sizes&lt;/li&gt;&lt;li&gt;Storage pooling and virtualization makes file system creation and management easy&lt;/li&gt;&lt;li&gt;Data striping for performance (bandwidth can be managed) and redundancy for fault tolerance&lt;/li&gt;&lt;li&gt;Disk scrubbing for protection against latent disk errors&lt;/li&gt;&lt;li&gt;Resiliency to corruptions with "salvage" for maximum volume availability in all cases&lt;/li&gt;&lt;li&gt;Shared storage pools across machines for additional failure tolerance and load balancing&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;blockquote class="tr_bq"&gt;" &lt;/blockquote&gt;</description><link>http://milek.blogspot.com/2012/01/refs.html</link><author>noreply@blogger.com (milek)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-1255816236745248800</guid><pubDate>Wed, 04 Jan 2012 19:42:00 +0000</pubDate><atom:updated>2012-01-04T20:42:00.329+01:00</atom:updated><title>What is Watson?</title><description>You probably heard about Watson from IBM. Michael Perrone gave a very entertaining presentation on Watson at LISA. Enjoy.&lt;br /&gt;&lt;br /&gt;&lt;iframe width="560" height="315" src="http://www.youtube.com/embed/1x8Jt4Dq2TA" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;</description><link>http://milek.blogspot.com/2012/01/what-is-watson.html</link><author>noreply@blogger.com (milek)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/1x8Jt4Dq2TA/default.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-7132254501315968763</guid><pubDate>Fri, 30 Dec 2011 12:00:00 +0000</pubDate><atom:updated>2011-12-30T17:38:32.841+01:00</atom:updated><title>Solaris 11 Source Code</title><description>It seems that Oracle has &lt;a href="http://www.phoronix.com/scan.php?page=news_item&amp;amp;px=MTAzMDE"&gt;"published"&lt;/a&gt; S11 source code after all...&lt;br /&gt;And a little bit &lt;a href="http://arstechnica.com/business/news/2011/12/disgruntled-employee-oracle-doesnt-seem-to-care-about-solaris-11-code-leak.ars"&gt;more on the story&lt;/a&gt;.</description><link>http://milek.blogspot.com/2011/12/solaris-11-source-code.html</link><author>noreply@blogger.com (milek)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-764523264515585030</guid><pubDate>Fri, 16 Dec 2011 13:01:00 +0000</pubDate><atom:updated>2011-12-16T14:02:14.094+01:00</atom:updated><title>From SunOS thru Solaris and OpenSolaris to illumos</title><description>Last week I attended LISA '11 conference and one of the great and fun presentations was Bryan Cantrill's talk titled "Fork Yeah! The Rise and Development of illumos".&lt;br /&gt;See the &lt;a href="http://www.youtube.com/user/USENIXAssociation#p/u/6/-zRN7XLCRhc"&gt;video&lt;/a&gt; and the &lt;a href="http://www.usenix.org/events/lisa11/tech/slides/cantrill.pdf"&gt;slides&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Also, if you are interested in the whole DevOps transformation watch Ben Rockwood's talk - see the &lt;a href="http://www.youtube.com/user/USENIXAssociation#p/search/0/3KpPBnEtRj4"&gt;video &lt;/a&gt; and the &lt;a href="http://www.usenix.org/events/lisa11/tech/slides/rockwood.pdf"&gt;slides&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There were more interesting talks - you can find them at &lt;a href="http://www.usenix.org/events/lisa11/tech/"&gt;http://www.usenix.org/events/lisa11/tech/&lt;/a&gt;</description><link>http://milek.blogspot.com/2011/12/from-sunos-thru-solaris-and-opensolaris.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-9963485.post-8239506563018942242</guid><pubDate>Fri, 11 Nov 2011 13:31:00 +0000</pubDate><atom:updated>2011-11-11T14:31:05.119+01:00</atom:updated><title>Solaris 11 - hostmodel</title><description>Solaris 11 Express and now Solaris 11 have a new functionality which was long missing in Solaris. It allows to force an application which binds to a given IP address to only use a default gateway configured on the same subnet (hostmodel set to strong), or to prefer such gateway if exists (src-priority) or the default behavior which is to choose "randomly" (weak). This is very useful if you have an additional interface (10GbE for example) and you want a guarantee that all outgoing packets from all applications which bind to an IP address on that interface go thru that dedicated interface even if there are other default gateways on other interfaces/subnets.&lt;br /&gt;&lt;br /&gt;From ipadm(1M) man page:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;br /&gt;&lt;dl&gt;&lt;dt&gt;&lt;tt&gt;hostmodel&lt;/tt&gt; (IPv4), &lt;tt&gt;hostmodel&lt;/tt&gt; (IPv6)&lt;/dt&gt;&lt;dd&gt;Control send/receive behavior for IP packets on a multi-homed system. The value of &lt;tt&gt;hostmodel&lt;/tt&gt; can be set to &lt;tt&gt;strong&lt;/tt&gt; or &lt;tt&gt;weak&lt;/tt&gt;, corresponding to the equivalent end-system model definitions of RFC 1122. In addition, a third value of &lt;tt&gt;src-priority&lt;/tt&gt; is also supported. In the &lt;tt&gt;src-priority&lt;/tt&gt; &lt;tt&gt;hostmodel&lt;/tt&gt; scenario, a packet will be accepted on any interface, as long as the packet's destination IP address is configured and marked &lt;tt&gt;UP&lt;/tt&gt;  on one of the host's interfaces. When transmitting a packet, if  multiple routes for the IP destination in the packet are available, the  system will prefer routes where the IP source address in the packet is  configured on the outgoing interface. If no such route is available, the  system will fall back to selecting the “best” route, as with the weak  ES case.&lt;/dd&gt;&lt;/dl&gt;&lt;/blockquote&gt;</description><link>http://milek.blogspot.com/2011/11/solaris-11-hostmodel.html</link><author>noreply@blogger.com (milek)</author><thr:total>0</thr:total></item></channel></rss>