public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: paulmck@us.ibm.com
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] shrinks dentry struct
Date: Tue, 13 Dec 2005 19:24:57 +0100	[thread overview]
Message-ID: <439F11F9.8070300@cosmosbay.com> (raw)
In-Reply-To: <20051213180315.GB14158@us.ibm.com>

Paul E. McKenney a écrit :
> On Tue, Nov 29, 2005 at 04:22:00PM +0100, Eric Dumazet wrote:
> 
>>Hi Andrew
>>
>>Could you add this patch to mm ?
>>
>>Thank you
>>
>>[PATCH] shrinks dentry struct
>>
>>Some long time ago, dentry struct was carefully tuned so that on 32 bits 
>>UP, sizeof(struct dentry) was exactly 128, ie a power of 2, and a multiple 
>>of memory cache lines.
>>
>>Then RCU was added and dentry struct enlarged by two pointers, with nice 
>>results for SMP, but not so good on UP, because breaking the above tuning 
>>(128 + 8 = 136 bytes)
>>
>>This patch reverts this unwanted side effect, by using an union (d_u), 
>>where d_rcu and d_child are placed so that these two fields can share their 
>>memory needs.
>>
>>At the time d_free() is called (and d_rcu is really used), d_child is known 
>>to be empty and not touched by the dentry freeing.
>>
>>Lockless lookups only access d_name, d_parent, d_lock, d_op, d_flags (so 
>>the previous content of d_child is not needed if said dentry was unhashed 
>>but still accessed by a CPU because of RCU constraints)
>>
>>As dentry cache easily contains millions of entries, a size reduction is 
>>worth the extra complexity of the ugly C union.
> 
> 
> Looks sound to me!  Some opportunities for simplification below.
> 
> (Please accept my apologies for the delay -- some diversions turned out
> to be more consuming than I had expected.)
> 
> 							Thanx, Paul
> 

Hi Paul

My patch only address the layout of dentry structure, basically a 'global 
substitute' on various places.

Adding some 'optimizations' or simplifications was not the goal, so please 
submit a patch if you feel the need for it :)

Thank you

Eric

      reply	other threads:[~2005-12-13 18:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-29  7:17 [PATCH] race condition in procfs Grzegorz Nosek
2005-11-29  8:09 ` Andrew Morton
2005-11-29  8:38   ` Grzegorz Nosek
2005-11-29 13:25     ` Grzegorz Nosek
2005-11-29 14:04       ` Grzegorz Nosek
2005-11-29 14:28         ` Steven Rostedt
2005-11-29 14:39           ` Grzegorz Nosek
2005-11-29 14:49             ` Steven Rostedt
2005-11-30 14:41               ` Grzegorz Nosek
2005-11-30 15:14                 ` Steven Rostedt
2005-11-30 15:29                   ` Grzegorz Nosek
2005-11-30 16:25                     ` Steven Rostedt
2005-11-30 17:23                       ` Grzegorz Nosek
2005-12-01 20:38                         ` Grzegorz Nosek
2005-11-29 15:22   ` [PATCH] shrinks dentry struct Eric Dumazet
2005-11-30  2:06     ` Paul Jackson
2005-11-30  2:14       ` Andrew Morton
2005-11-30  2:43         ` Paul Jackson
2005-11-30  6:56         ` Hugh Dickins
2005-12-03  1:15     ` [PATCH] remove unused blkp field in percpu_data Eric Dumazet
2005-12-13 18:03     ` [PATCH] shrinks dentry struct Paul E. McKenney
2005-12-13 18:24       ` Eric Dumazet [this message]

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=439F11F9.8070300@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@us.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox