All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Andrew Morton <akpm@osdl.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
Date: Fri, 26 Aug 2005 00:51:30 +1000	[thread overview]
Message-ID: <430DDAF2.6030601@yahoo.com.au> (raw)
In-Reply-To: <430DB8FA.4080009@cosmosbay.com>

Eric Dumazet wrote:
> Nick Piggin a écrit :
> 

>> Would you just be able to add the atomic sysctl handler that
>> Christoph suggested?
>>
> 
> Quite a lot of work indeed, and it would force to convert 3 int 
> (nr_files, nr_free_files, max_files) to 3 atomic_t. I feel bad 
> introducing a lot of sysctl rework for a tiny change (removing 
> filp_count_lock)
> 

True, I didn't notice that.

>> This introduces lost update problems. 2 CPUs may store to nr_files
>> in the opposite order that they incremented atomic_nr_files.
>>
> 
> That's true, and the difference can be relatively important in case of 
> preemption.
> 
> Each time the true and correct value  (atomic_nr_files) is updated, a 
> copy is done on nr_files : as nr_files is only used to be a guard value 
> against too many file allocations, a somewhat 'lazy' value has no impact 
> at all.
> 

OK, well I would prefer you do the proper atomic operations throughout
where it "really matters" in file_table.c, and do your lazy synchronize
with just the sysctl exported value.

Unless the fs people had a problem with that.

And you may as well get rid of the atomic_inc_return which can be more
expensive on some platforms and doesn't buy you much.
   atomic_inc;
   atomic_read;
Should be enough if you don't care about lost updates here, yeah?

Nick

-- 
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com 

  reply	other threads:[~2005-08-25 14:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24 21:46 [patch] Additions to .data.read_mostly section Ravikiran G Thirumalai
2005-08-24 22:38 ` Eric Dumazet
2005-08-25  7:56 ` Arjan van de Ven
2005-08-25  8:45   ` [PATCH] removes filp_count_lock and changes nr_files type to atomic_t Eric Dumazet
2005-08-25  9:05     ` Arjan van de Ven
2005-08-25  9:20       ` Eric Dumazet
2005-08-25  9:31         ` Arjan van de Ven
2005-08-25  9:08     ` Christoph Hellwig
2005-08-25  9:17       ` Eric Dumazet
2005-08-25  9:23         ` Christoph Hellwig
2005-08-25 10:41           ` Eric Dumazet
2005-08-25 11:11             ` Nick Piggin
2005-08-25 12:26               ` Eric Dumazet
2005-08-25 14:51                 ` Nick Piggin [this message]
2005-08-25 14:56                   ` Christoph Hellwig
2005-08-25 15:13                   ` Eric Dumazet
2005-08-25 18:19                     ` Dipankar Sarma
2005-08-25 18:36                       ` Christoph Hellwig
2005-08-26  1:16                     ` Nick Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=430DDAF2.6030601@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=dada1@cosmosbay.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.