Re: [PATCH 2/2] dentry: move to per-sb LRU locks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux