Thursday, March 29, 2007

To Fedora or not to Fedora

I must admit Fedora Core 6 is such a crappy distro, you 'll love to hate.

Being an ardent fan of Fedora's for nearly 3 years since its release, i am disappointed to see FC6 perform poorly.

First, if i select virtualization during installation, i expect atleast 2 kernels in my /boot .One being stock fedora kernel(which is often buggy) and a domU Xen kernel plus a xen hypervisor binary.

Surprisingly Fedora people think users are some lusers :(. They ll just wipe the stock kernel off the boot. nagging and frustrating it is.

Second can they please improve yum?Yum is beaten hands down by apt-get. Every damn time i want to install a package ,it will start downloading headers. Certainly apt-get install gcc32 is way cool :).

Third it was not able to detect the RealTek's 8169 SC gigabit ethernet NIC. Even a modprobe r8169 didn't help and neither did passing pci=noapic.

Thank god i switch to Ubuntu Edgy.

Edgy detects Rtl 8169 SC like a charm, GUI is way better.Synaptic is super smooth.Rest Development environment i have to set, which i am capable of doing even on a LFS box.

Moreover i am command line gureilla, not some GUI luser.(no pun intended)

But i must admit i still like Fedora as a development environment. :)

As they say it - "First love is first love, you will never forget it" ;) ... and neither did i.

Looking forward to Feisty Fawn.

Sunday, March 25, 2007

Indian IT industry and alternative thoughts

The computing industry has seen a manifold increase in last few decades. As an industry and as an engineering tool too. Not to mention, it affected Indian subcontinent and many over developing nations too.

The rat race has begun but is it effective enough for us to be called a quality service provider?Are we just a bunch people who are providing low cost services? May be yes and may be not? Even if we are not, we are perhaps disillusioned with this fact. We are best and hope fully will be best.

The problem as i personally see is - "When does the service starts acting like a commodity". The difference is visible and is inherently different for different sects of IT people. Maybe how we look at this is exactly how we shouldn't or may be we are right.

Whatever services are good and revenue spinning means for us, but point is services for which? Exactly for some product or some software from xyz inc in Europe or Northern America. This means we are heavily dependent on them. The lateral expansion of the software has certainly been the talk of the town but what about vertical expansion?

Are we ready to call our services commodities?Are we ready to give services which will mean a certain degree of domination in the Western market? Answer is yes and no both, which are self evident.

Initially we had to choose the path which we are traversing right now. Isn't it right time that we should spend some amount on vertical infrastructure?

How about building a competing product for which you can give exclusive services?how about recognizing the value of research and development?

Soon some other country will become cheaper than us in terms of services. Shouldn't we think about it?Definitely we should. But not in terms of cost only but also quality. Lets try to make ourselves a brand name in quality, in innovation, in development that we are known for our quality before cost effectiveness.

Let us innovate, have a bunch of talented engineers who can dedicatedly work on emerging technologies so that we can call ourselves pioneers.

Let us not waste the oppurtunity to make our mark at the right time. Lets have a fore vision. Let us work together for a brighter and talented India.

Are you there yet? :-)

Friday, March 23, 2007

Disappointment with kernel

Came across a livejournal entry comparing between FreeBSD 7 and Linux 2.6.18 kernel on Fedora Core 6. Surprisingly Linux performed poorly when it came to scalability issue with a MySQL server.

Here is my interpretation and inferences( can be wrong also :) ) -

-On a 'n' node system running a SMP kernel, the SQL server handles the load excellently till following condition is met -

num_of_sql_query_threads <= no_of_nodes_in_the_SMP_system

This means till threads(assuming each query launches a thread) are less in number as compared to the num of CPUs(cores if you consider Dual Core processors these days) the threading model performs great.
Every thread gets migrated to each of the ores and thus gives optimum CPU usage. The moment number of threads start increasing beyond the num of cores in the SMP system, it starts causing problems.
Possible reasons :-
* The userland is unable to keep up with the CPU execution speed and thus is not able to feed the right number of threads to the kernel. (Does it means user space threading model needs a look?)
* The kernel is not able to keep the CPUs busy when number of kernel threads increase beyond a limit. Well does this means kernel threading model is a little overlooked?

I think reason 1 is indeed true because replacing glibc's malloc with google's malloc improved performance considerably. But things did not improve that much. Something really bad is happening inside the kernel.

Linux uses a one to one threading model. This means for every thread requesting a priviliged operation, a corresponding kernel thread is spawned by the kernel on its behalf.This means some global/local spinlocks in SMP kernels is hindering effective migration of the kernel threads among runqueues(or waitqueues). Whatever this issue looks plainly separate from the scheduler.No blaming scheduling algo here:). Locking and synchronization primitives are indeed the culprits.

Important point to note here is in Kernel threading model in Linux is relatively new. It was included in the kernel with the 2.6.x kernel series only.

So there is a lot of scope for improvements in the kernel on threading front.
Any takers? :)

On last thoughts, why is malloc performing poorly? No idea.May be Ulrich Drepper is the best person to ask... so don't ask me. :)

Random thoughts : doesn't futexes have some added complexity? Somebody can explain me about futexes i hope ...


Object Orientism with C

C is a language to drive you insane - me :)

Well, C is indeed a wonderful programming language.
Success of C has been limited and overshadowed by the rise of Object Oriented era.
That is indeed disheartening to C fans like me. So i myself learnt C++ with no special goal in mind and found that indeed C++ is a wonderful application language. But C can still provide OO features in complex pieces of software.
A very good example is an Operating System kernel.

Some of the ways we can employ few of the OO feature in C IMO are :-

struct my_struct{
int a;
int (*my_function)(int);

The above structure is just a declaration and not a definition. Catch is kepping declaration and definition separate gives flexibility to a C programmer e.g

struct my_struct A;
A.a = 3;
A.my_function = some_random_function_i_defined;

And again in some other source file in the same namespace i do

struct my_struct _A;
_A.a = 345;
_A.my_function = another_random_function;

Above example shows, one declaration but different invocation of the methods. Indeed fantastic and divine :).

So, this means depending on the definition we can invoke the correct function using function pointer here :).
Indeed something modern *NIX kernels make good use of.

more on this later.

(mis)adventures with networking code

These days i dived into networking subsystem in the linux kernel and studied the networking subsystem.I must say it was one hell of a roller coaster ride :).

Code is elegant and a little on the higher side of intellect.

Some hacks have been wonderfully pulled especially by Alan Cox and Dave Miller :).
A very good example i found was skb_sh_info structure. Have a look at it.

Just for beginners
kernel networking subsystem code is located at
and network driver code can be found in
apart from this rest all headers can be found at standard place like inclue/linux/ and include/linux/net/ etc.

Still i am more than blank. Hoping to get some real insight into networing subsystem. But i must confess, this is fun :) and am loving each and every part of it.


emacs tryst

Recently installed Ubuntu Edgy 6.10 on my work machine.
Is great i must say. I felt deprived of my favourite editor for programming.

So here i went
apt-get update
apt-get install emacs emacs21 emacs-common

And i was working with the mighty emacs :).

Recently saw some posts on antialiasing support for xemacs fonts. Tried my hands on it and i must say now emacs looks pretty cool.

here is the link to install this cool but unstable emacs.

Please note, the software is still in Alpha stage. You have been warned.

Happy programming :)