LWN.net Logo

One use for reference-count biases...

One use for reference-count biases...

Posted Jun 9, 2009 13:50 UTC (Tue) by PaulMcKenney (subscriber, #9624)
In reply to: One use for reference-count biases... by neilbrown
Parent article: Linux kernel design patterns - part 1

Hmmmm... I was thinking more in terms of something like the following:

preempt_disable();
if (per_cpu_counter > 0)
        per_cpu_counter++;
else
        do some costly global-lock-and-variable thing
preempt_enable();

But it has been a good ten years since I messed with this, so I should take another look at it.

In any case, I very much agree with your overall premise that higher-level primitives are a very great improvement over continually re-inventing the wheel, most especially for those wheels with a strong history of being re-invented badly!!!


(Log in to post comments)

One use for reference-count biases...

Posted Dec 23, 2011 5:30 UTC (Fri) by atiqure (guest, #81951) [Link]

hii.. i dnt know who r u but i need help... please tell me something about how to develop a kernel without using any source i just want to use programming language like c,c++,java and assembly language can i do that with these languages ..if yes then please tell me from where to start and how ...pls help it will be christmas gift for me from you ...

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds