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

2007-03-15 Thread Eric W. Biederman
Pavel Emelianov <[EMAIL PROTECTED]> writes: > 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 >>> essentiall

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

2007-03-13 Thread Pavel Emelianov
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.

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

2007-03-13 Thread Herbert Poetzl
On Tue, Mar 13, 2007 at 06:41:05PM +0300, Pavel Emelianov wrote: > >>> PS: atomic_add_unless() didn't exist back then > >>> (at least I think so) but that might be an option > >>> too ... > >> I think as far as having this discussion if you can remove that race > >> people will be more willing to t

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

2007-03-13 Thread Srivatsa Vaddagiri
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

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

2007-03-13 Thread Pavel Emelianov
>>> PS: atomic_add_unless() didn't exist back then >>> (at least I think so) but that might be an option >>> too ... >> I think as far as having this discussion if you can remove that race >> people will be more willing to talk about what vserver does. > > well, shouldn't be a big deal to brush th

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

2007-03-13 Thread Herbert Poetzl
On Tue, Mar 13, 2007 at 03:09:06AM -0600, Eric W. Biederman wrote: > Herbert Poetzl <[EMAIL PROTECTED]> writes: > > > On Sun, Mar 11, 2007 at 01:00:15PM -0600, Eric W. Biederman wrote: > >> Herbert Poetzl <[EMAIL PROTECTED]> writes: > >> > >> > > >> > Linux-VServer does the accounting with atomic

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

2007-03-13 Thread Kirill Korotaev
>> - doesn't store the accounted value but >> limit - accounted (i.e. the free resource) >> - uses atomic_add_return() >> - when negative, an error is returned and >> the resource amount is added back >> >>changes to the limit have to adjust the 'current' >>value too, but that is again simple

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

2007-03-13 Thread Pavel Emelianov
Eric W. Biederman wrote: > Herbert Poetzl <[EMAIL PROTECTED]> writes: > >> On Sun, Mar 11, 2007 at 01:00:15PM -0600, Eric W. Biederman wrote: >>> Herbert Poetzl <[EMAIL PROTECTED]> writes: >>> Linux-VServer does the accounting with atomic counters, so that works quite fine, just do the c

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

2007-03-13 Thread Eric W. Biederman
Herbert Poetzl <[EMAIL PROTECTED]> writes: > On Sun, Mar 11, 2007 at 01:00:15PM -0600, Eric W. Biederman wrote: >> Herbert Poetzl <[EMAIL PROTECTED]> writes: >> >> > >> > Linux-VServer does the accounting with atomic counters, >> > so that works quite fine, just do the checks at the >> > beginnin

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

2007-03-11 Thread Herbert Poetzl
On Sun, Mar 11, 2007 at 01:00:15PM -0600, Eric W. Biederman wrote: > Herbert Poetzl <[EMAIL PROTECTED]> writes: > > > > > Linux-VServer does the accounting with atomic counters, > > so that works quite fine, just do the checks at the > > beginning of whatever resource allocation and the > > accoun

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

2007-03-11 Thread Eric W. Biederman
Herbert Poetzl <[EMAIL PROTECTED]> writes: > > Linux-VServer does the accounting with atomic counters, > so that works quite fine, just do the checks at the > beginning of whatever resource allocation and the > accounting once the resource is acquired ... Atomic operations versus locks is only a

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

2007-03-11 Thread Pavel Emelianov
Herbert Poetzl wrote: > On Wed, Mar 07, 2007 at 10:19:05AM +0300, Pavel Emelianov wrote: >> Balbir Singh wrote: >>> Pavel Emelianov wrote: Introduce generic structures and routines for resource accounting. Each resource accounting container is supposed to aggregate it, cont

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

2007-03-09 Thread Herbert Poetzl
On Wed, Mar 07, 2007 at 10:19:05AM +0300, Pavel Emelianov wrote: > Balbir Singh wrote: > > Pavel Emelianov wrote: > >> Introduce generic structures and routines for > >> resource accounting. > >> > >> Each resource accounting container is supposed to > >> aggregate it, container_subsystem_state and

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

2007-03-06 Thread Pavel Emelianov
Balbir Singh wrote: > Pavel Emelianov wrote: >> Introduce generic structures and routines for >> resource accounting. >> >> Each resource accounting container is supposed to >> aggregate it, container_subsystem_state and its >> resource-specific members within. >> >> >>

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

2007-03-06 Thread Balbir Singh
Pavel Emelianov wrote: Introduce generic structures and routines for resource accounting. Each resource accounting container is supposed to aggregate it, container_subsystem_state and its resource-specific members within.