lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110809110420.GT3162@dastard>
Date:	Tue, 9 Aug 2011 21:04:21 +1000
From:	Dave Chinner <david@...morbit.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	viro@...IV.linux.org.uk, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 2/2] dentry: move to per-sb LRU locks

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@...morbit.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ