<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9037519023231377694</id><updated>2011-07-08T22:50:08.073+05:30</updated><category term='linux'/><category term='POSIX'/><category term='scalability'/><category term='lock'/><category term='processor'/><category term='giant lock'/><category term='kernel'/><category term='sun'/><category term='AMD'/><category term='port'/><category term='solaris'/><category term='Intel'/><category term='SGI'/><title type='text'>Kernel Junkie</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kerneljunkie.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kerneljunkie.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Manoj Joseph</name><uri>http://www.blogger.com/profile/07650579355330090468</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp2.blogger.com/_6a2ndBid6_w/RijTdnWeXVI/AAAAAAAAAAM/sK616ylfDQE/s320/manoj1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9037519023231377694.post-8819351149108896515</id><published>2010-04-06T01:26:00.003+05:30</published><updated>2010-04-06T01:28:20.777+05:30</updated><title type='text'>The irony of opensource</title><content type='html'>Have you noticed that many open source evangelists and developers are big fans of Apple and Mac/iPhone?&lt;br /&gt;&lt;br /&gt;See [Open]Solaris evangelist Ben Rockwood blog about how &lt;a href="http://www.cuddletech.com/blog/pivot/entry.php?id=1120"&gt;Solaris is no longer free&lt;/a&gt; followed by a post with &lt;a href="http://www.cuddletech.com/blog/pivot/entry.php?id=1121"&gt;rave reviews of the iPad&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9037519023231377694-8819351149108896515?l=kerneljunkie.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kerneljunkie.blogspot.com/feeds/8819351149108896515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9037519023231377694&amp;postID=8819351149108896515' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/8819351149108896515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/8819351149108896515'/><link rel='alternate' type='text/html' href='http://kerneljunkie.blogspot.com/2010/04/irony-of-opensource.html' title='The irony of opensource'/><author><name>Manoj Joseph</name><uri>http://www.blogger.com/profile/07650579355330090468</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp2.blogger.com/_6a2ndBid6_w/RijTdnWeXVI/AAAAAAAAAAM/sK616ylfDQE/s320/manoj1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9037519023231377694.post-8896059993429835466</id><published>2007-07-03T11:34:00.000+05:30</published><updated>2007-07-03T12:15:43.386+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='sun'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='port'/><category scheme='http://www.blogger.com/atom/ns#' term='POSIX'/><category scheme='http://www.blogger.com/atom/ns#' term='solaris'/><title type='text'>Porting hell</title><content type='html'>I have been working on a project, porting something from Linux to Solaris and from the kernel to the userland. It was interesting and a learning experience.&lt;br /&gt;&lt;br /&gt;I have always had a strong preference to work by myself - solo projects. This one wasn't. I always find working with other engineers a challenge. This time, however, was a relatively positive experience.&lt;br /&gt;&lt;br /&gt;But, before I digress to much, let me talk about the port. I expected the kernel to userland part to be the challenge. Linux userland to Solaris userland, hmm, I didn't expect much trouble. I was in for a surprise. :)&lt;br /&gt;&lt;br /&gt;There are so many differences, so many that you wonder if there are more differences than similarities. With Linux, POSIX seems irrelevant. ;)&lt;br /&gt;&lt;br /&gt;But the most interesting was a null dereference panic we were seeing on Solaris; never happened on Linux. Turned out that a null pointer was being passed to a 'debug print' routine.&lt;br /&gt;&lt;br /&gt;The interesting part was that this was not a programming error. This was done intentionally. What I learned was that the snprintf() routine when faced with a null pointer prints "null" instead of aborting. The code we were porting assumed this behavior and used it all over the place.&lt;br /&gt;&lt;br /&gt;Finally, we came across a &lt;a href="http://technopark02.blogspot.com/2006/04/solaris-null-pointer-bugs-usrlib00so1.html"&gt;solution devised by Sun's engineers&lt;/a&gt;. The library /usr/lib/0@0.so.1 can be preloaded to mark the address 0 as valid. This is a workaround and dirty but effective. ;)&lt;br /&gt;&lt;br /&gt;For more on issues porting to Solaris, see &lt;a href="http://developers.sun.com/solaris/articles/portingUNIXapps.html"&gt;this&lt;/a&gt; document.&lt;br /&gt;&lt;span class="down" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9037519023231377694-8896059993429835466?l=kerneljunkie.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kerneljunkie.blogspot.com/feeds/8896059993429835466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9037519023231377694&amp;postID=8896059993429835466' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/8896059993429835466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/8896059993429835466'/><link rel='alternate' type='text/html' href='http://kerneljunkie.blogspot.com/2007/07/porting-hell.html' title='Porting hell'/><author><name>Manoj Joseph</name><uri>http://www.blogger.com/profile/07650579355330090468</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp2.blogger.com/_6a2ndBid6_w/RijTdnWeXVI/AAAAAAAAAAM/sK616ylfDQE/s320/manoj1.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9037519023231377694.post-936649507096931169</id><published>2007-04-28T02:15:00.000+05:30</published><updated>2007-04-28T02:19:13.931+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='SGI'/><title type='text'>Linux scaling to 1024 processors?</title><content type='html'>Hmm... See my earlier &lt;a href="http://kerneljunkie.blogspot.com/2007/04/giant-lock-in-linux.html"&gt;post&lt;/a&gt; about the giant lock in the linux kernel.&lt;br /&gt;&lt;br /&gt;Inspite of that, (believe it or not ;) ), folks at SGI claim to have got linux to &lt;a href="http://www.sgi.com/products/servers/altix/4000/"&gt;scale to 512&lt;/a&gt; and &lt;a href="http://www.hpcwire.com/hpc/952412.html"&gt;1024 processors&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;How well this really scales, I don't have a clue. But it is very interesting and impressive, all the same, I must say!&lt;br /&gt;&lt;br /&gt;-Manoj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9037519023231377694-936649507096931169?l=kerneljunkie.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kerneljunkie.blogspot.com/feeds/936649507096931169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9037519023231377694&amp;postID=936649507096931169' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/936649507096931169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/936649507096931169'/><link rel='alternate' type='text/html' href='http://kerneljunkie.blogspot.com/2007/04/linux-scaling-to-1024-processors.html' title='Linux scaling to 1024 processors?'/><author><name>Manoj Joseph</name><uri>http://www.blogger.com/profile/07650579355330090468</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp2.blogger.com/_6a2ndBid6_w/RijTdnWeXVI/AAAAAAAAAAM/sK616ylfDQE/s320/manoj1.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9037519023231377694.post-2766069369851974986</id><published>2007-04-17T09:08:00.000+05:30</published><updated>2007-04-21T12:38:18.583+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='processor'/><category scheme='http://www.blogger.com/atom/ns#' term='AMD'/><category scheme='http://www.blogger.com/atom/ns#' term='Intel'/><title type='text'>AMD64 on Pentium D</title><content type='html'>This is what I saw on a build machine that I use.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;-bash-3.00$ uname -a&lt;br /&gt;SunOS sata5 5.11 snv_55b i86pc i386 i86pc&lt;br /&gt;-bash-3.00$ /usr/sbin/prtdiag | grep CPU&lt;br /&gt;Intel(R) Pentium(R) D CPU 2.80GHz LGA775/U1&lt;br /&gt;-bash-3.00$ isainfo -v&lt;br /&gt;64-bit amd64 applications&lt;br /&gt;       cx16 mon sse3 sse2 sse fxsr mmx cmov amd_sysc cx8 tsc fpu&lt;br /&gt;32-bit i386 applications&lt;br /&gt;       cx16 mon sse3 sse2 sse fxsr mmx cmov sep cx8 tsc fpu&lt;br /&gt;-bash-3.00$&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;An Intel Pentium processor does amd64 instructions! Ha ha! What has the world come to??&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9037519023231377694-2766069369851974986?l=kerneljunkie.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kerneljunkie.blogspot.com/feeds/2766069369851974986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9037519023231377694&amp;postID=2766069369851974986' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/2766069369851974986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/2766069369851974986'/><link rel='alternate' type='text/html' href='http://kerneljunkie.blogspot.com/2007/04/amd64-on-pentium-d.html' title='AMD64 on Pentium D'/><author><name>Manoj Joseph</name><uri>http://www.blogger.com/profile/07650579355330090468</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp2.blogger.com/_6a2ndBid6_w/RijTdnWeXVI/AAAAAAAAAAM/sK616ylfDQE/s320/manoj1.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9037519023231377694.post-2254184786148526732</id><published>2007-04-04T22:48:00.000+05:30</published><updated>2007-04-21T12:38:36.366+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='lock'/><category scheme='http://www.blogger.com/atom/ns#' term='scalability'/><category scheme='http://www.blogger.com/atom/ns#' term='kernel'/><category scheme='http://www.blogger.com/atom/ns#' term='giant lock'/><title type='text'>Giant lock in Linux</title><content type='html'>For a brief while, 5 years ago, I used to work on a &lt;a href="http://winext2fsd.sourceforge.net/"&gt;Windows NT filesystem&lt;/a&gt;. More recently, I worked on a &lt;a href="http://docs.sun.com/app/docs/doc/806-1424/6jan9i70l?a=view#x-b1mkg"&gt;Solaris filesystem&lt;/a&gt;. And I will be working with Linux kernels in the forth coming days, or so it seems.&lt;br /&gt;&lt;br /&gt;I have read about the old Linux kernels using a giant spin lock for synchronization. And I always thought it was w.r.t the old 2.0, 2.2 kernels.&lt;br /&gt;&lt;br /&gt;A giant lock is like "one lock to rule the entire kernel". :) Using different locks (synchronization elements) to protect different kernel data structures and critical sections means more granularity and it leads to greater parallelisation. It also means &lt;span style="font-weight: bold;"&gt;more&lt;/span&gt; complexity.&lt;br /&gt;&lt;br /&gt;Using the same lock to protect everything means lesser paralalization. Such a lock is often termed a &lt;span style="font-style: italic;"&gt;giant&lt;/span&gt; lock.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://cscope.sourceforge.net/"&gt;Cscope&lt;/a&gt;ing in linux-2.6.9 source, I could see 527 direct calls to lock_kernel(). There are 39 more calls to reiserfs_write_lock(foobar) which is defined thus:&lt;br /&gt;&lt;pre&gt;    #define reiserfs_write_lock( sb ) lock_kernel()&lt;/pre&gt;And to prevent recursive spinlock deadlocks, this is how lock_kernel() is defined:&lt;br /&gt;&lt;pre&gt;static inline void lock_kernel(void)&lt;br /&gt;{&lt;br /&gt;int depth = current-&gt;lock_depth+1;&lt;br /&gt;if (likely(!depth))&lt;br /&gt;   get_kernel_lock();&lt;br /&gt;current-&gt;lock_depth = depth;&lt;br /&gt;}&lt;/pre&gt;In the 2.4 kernels it &lt;a href="http://bfi.s0ftpj.org/dev/en/BFi12-dev-08-en"&gt;apparently&lt;/a&gt; used to be&lt;br /&gt;&lt;pre&gt;static __inline__ void lock_kernel(void)&lt;br /&gt;{&lt;br /&gt;if (!++current-&gt;lock_depth)&lt;br /&gt;   spin_lock(&amp;kernel_flag);&lt;br /&gt;}&lt;/pre&gt;I am &lt;span style="font-weight: bold;"&gt;very&lt;/span&gt; surprised!&lt;br /&gt;&lt;br /&gt;I am tempted to quote what someone thought about the Linux kernel on &lt;a href="http://www.osronline.com/cf.cfm?PageURL=showlists.CFM?list=NTFSD"&gt;NTFSD&lt;/a&gt;. But I won't. I'll be nice. ;)&lt;br /&gt;&lt;br /&gt;-Manoj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9037519023231377694-2254184786148526732?l=kerneljunkie.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kerneljunkie.blogspot.com/feeds/2254184786148526732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9037519023231377694&amp;postID=2254184786148526732' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/2254184786148526732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9037519023231377694/posts/default/2254184786148526732'/><link rel='alternate' type='text/html' href='http://kerneljunkie.blogspot.com/2007/04/giant-lock-in-linux.html' title='Giant lock in Linux'/><author><name>Manoj Joseph</name><uri>http://www.blogger.com/profile/07650579355330090468</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp2.blogger.com/_6a2ndBid6_w/RijTdnWeXVI/AAAAAAAAAAM/sK616ylfDQE/s320/manoj1.jpg'/></author><thr:total>2</thr:total></entry></feed>
