Re: [RFC][PATCH 1/7] Resource counters



Srivatsa Vaddagiri wrote:
On Tue, Mar 13, 2007 at 06:41:05PM +0300, Pavel Emelianov wrote:
right, but atomic ops have much less impact on most
architectures than locks :)
Right. But atomic_add_unless() is slower as it is
essentially a loop. See my previous letter in this sub-thread.

If I am not mistaken, you shouldn't loop in normal cases, which means
it boils down to a atomic_read() + atomic_cmpxch()



So does the lock - in a normal case (when it's not
heavily contented) it will boil down to atomic_dec_and_test().

Nevertheless, making charge like in this patchset
requires two atomic ops with atomic_xxx and only
one with spin_lock().
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [RFC][PATCH 1/7] Resource counters
    ... architectures than locks:) ... But atomic_add_unlessis slower as it is ... See my previous letter in this sub-thread. ... If I am not mistaken, you shouldn't loop in normal cases, which means ...
    (Linux-Kernel)
  • Re: 2.6.16-rc6-rt1
    ... includes releasing _all_ locks at each ... Or a higher priority task change the structures along the way... ... The basic loop is: ...
    (Linux-Kernel)
  • Re: [patch] Real-Time Preemption, -RT-2.6.12-rc1-V0.7.43-00
    ... > serial, to do sysrq. ... The console is using X which locks (even all the ... That was a BUG where as this has something in a spinning loop somewhere. ... Probably for kjournald to run, ...
    (Linux-Kernel)
  • Re: Populate an ImageList from another thread
    ... Now, as for what happens when I run the code you posted: I do not find that the application locks up, nor do I get an hourglass cursor and no repainting. ... The other thing about the code is that it's in a fairly tight loop. ... Because this is timing related, it's possible that if your hardware is significantly different from mine, that could explain a perceived difference in responsiveness. ...
    (microsoft.public.dotnet.languages.csharp)
  • bad karma with loop?
    ... I use this Count Occurrences public sub with modifications ... in several VBA macros I've written. ... it or it locks up if I try to run any macro (including the ... basic one, below) containing the loop. ...
    (microsoft.public.word.vba.general)