linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: viro@ZenIV.linux.org.uk, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/2] dentry: move to per-sb LRU locks
Date: Tue, 9 Aug 2011 21:04:21 +1000	[thread overview]
Message-ID: <20110809110420.GT3162@dastard> (raw)
In-Reply-To: <1312808544.10488.31.camel@twins>

On Mon, Aug 08, 2011 at 03:02:24PM +0200, Peter Zijlstra wrote:
> On Mon, 2011-08-08 at 17:03 +1000, Dave Chinner wrote:
> > +       /* s_dentry_lru_lock protects s_dentry_lru, s_nr_dentry_unused */
> > +       spinlock_t              s_dentry_lru_lock ____cacheline_aligned_in_smp;
> >         struct list_head        s_dentry_lru;   /* unused dentry lru */ 
> 
> Wouldn't it make sense to have both those on the same cacheline?

Um, they are, aren't they? The annotation moves s_dentry_lru_lock to
the start of a new cacheline, and everything packs in after that?

$ pahole fs/dcache.o
....
        /* --- cacheline 8 boundary (512 bytes) --- */
        spinlock_t                 s_dentry_lru_lock;    /*   512    72 */
        /* --- cacheline 9 boundary (576 bytes) was 8 bytes ago --- */
        struct list_head           s_dentry_lru;         /*   584    16 */
        int                        s_nr_dentry_unused;   /*   600     4 */

Oh, bloody hell. When did that change? (let me guess - gcc changed
the implementation of attribute __aligned__ to affect the size of 
variables for packing as well as alignment at some point?)

Ok, so how do I it move the lock to the start of the next cache line
and have the following variables pack tightly against it so they are
all on the same cache line? And on a different cacheline to the
s_inode_lru* variables that also have the same
____cacheline_aligned_in_smp annotations....

/me sees a patch to other XFS structures in the not-to-distant future

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2011-08-09 11:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08  7:03 [PATCH 0/2] dcache: per-sb LRU locks Dave Chinner
2011-08-08  7:03 ` [PATCH 1/2] dcache: convert dentry_stat.nr_unused to per-cpu counters Dave Chinner
2011-08-08  7:08   ` Pekka Enberg
2011-08-09 10:48     ` Dave Chinner
2011-08-08  7:03 ` [PATCH 2/2] dentry: move to per-sb LRU locks Dave Chinner
2011-08-08 13:02   ` Peter Zijlstra
2011-08-09 11:04     ` Dave Chinner [this message]
2011-08-09 11:21       ` Peter Zijlstra
2011-08-10  5:35       ` Dave Chinner

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=20110809110420.GT3162@dastard \
    --to=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).