xfs
[Top] [All Lists]

Re: XFS mount alignment patch

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>, nathans@xxxxxxx
Subject: Re: XFS mount alignment patch
From: Alok Kataria <alokk@xxxxxxxxxxxxxx>
Date: Sat, 7 Jan 2006 20:03:58 +0530 (IST)
Cc: shai@xxxxxxxxxxxx, kiran@xxxxxxxxxxxx, linux-xfs@xxxxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Fri, 2006-01-06 at 21:48, Christoph Hellwig wrote:
> Any chance you could archive the alignment without the use of anonymous
> structs?  XFS still needs to compile with compilers that don't support
> this (non-ANIS C) feature, and it looks quite ugly.
> 

This version doesn't use anonymous structs. Please check if this could be 
applied.

Thanks & Regards,
Alok

--

This patch seperates out the members of xfs_mount into those showing 
readmostly behavior and those which don't show any specific behaviour. 
The readmostly variables are put into seperate internode cacheline to 
avoid thrashing. 

Signed-off-by: Alok N Kataria <alokk@xxxxxxxxxxxxxx>
Signed-off-by: Ravikiran Thirumalai <kiran@xxxxxxxxxxxx>
Signed-off-by: Shai Fultheim <Shai@xxxxxxxxxxxx>

Index: linux-2.6.15/fs/xfs/xfs_mount.h
===================================================================
--- linux-2.6.15.orig/fs/xfs/xfs_mount.h        2006-01-07 06:29:11.000000000 
-0800
+++ linux-2.6.15/fs/xfs/xfs_mount.h     2006-01-07 06:31:43.000000000 -0800
@@ -267,7 +267,12 @@ typedef struct xfs_ioops {
 #define XFS_IODONE(vfsp) \
        (*(mp)->m_io_ops.xfs_iodone)(vfsp)
 
-
+/*
+ * The varaibles in this structute are seperated into those showing
+ * read mostly behavior and those which don't show any definite behavior.
+ * These variabes are put into seperate internode cachelines, to avoid 
thrashing
+ * of readmostly variables.
+ */
 typedef struct xfs_mount {
        bhv_desc_t              m_bhv;          /* vfs xfs behavior */
        xfs_tid_t               m_tid;          /* next unused tid for fs */
@@ -276,39 +281,13 @@ typedef struct xfs_mount {
        uint                    m_ail_gen;      /* fs AIL generation count */
        xfs_sb_t                m_sb;           /* copy of fs superblock */
        lock_t                  m_sb_lock;      /* sb counter mutex */
-       struct xfs_buf          *m_sb_bp;       /* buffer for superblock */
-       char                    *m_fsname;      /* filesystem name */
-       int                     m_fsname_len;   /* strlen of fs name */
-       char                    *m_rtname;      /* realtime device name */
-       char                    *m_logname;     /* external log device name */
-       int                     m_bsize;        /* fs logical block size */
        xfs_agnumber_t          m_agfrotor;     /* last ag where space found */
        xfs_agnumber_t          m_agirotor;     /* last ag dir inode alloced */
        lock_t                  m_agirotor_lock;/* .. and lock protecting it */
-       xfs_agnumber_t          m_maxagi;       /* highest inode alloc group */
-       uint                    m_ihsize;       /* size of next field */
-       struct xfs_ihash        *m_ihash;       /* fs private inode hash table*/
        struct xfs_inode        *m_inodes;      /* active inode list */
        struct list_head        m_del_inodes;   /* inodes to reclaim */
        mutex_t                 m_ilock;        /* inode list mutex */
        uint                    m_ireclaims;    /* count of calls to reclaim*/
-       uint                    m_readio_log;   /* min read size log bytes */
-       uint                    m_readio_blocks; /* min read size blocks */
-       uint                    m_writeio_log;  /* min write size log bytes */
-       uint                    m_writeio_blocks; /* min write size blocks */
-       struct log              *m_log;         /* log specific stuff */
-       int                     m_logbufs;      /* number of log buffers */
-       int                     m_logbsize;     /* size of each log buffer */
-       uint                    m_rsumlevels;   /* rt summary levels */
-       uint                    m_rsumsize;     /* size of rt summary, bytes */
-       struct xfs_inode        *m_rbmip;       /* pointer to bitmap inode */
-       struct xfs_inode        *m_rsumip;      /* pointer to summary inode */
-       struct xfs_inode        *m_rootip;      /* pointer to root directory */
-       struct xfs_quotainfo    *m_quotainfo;   /* disk quota information */
-       xfs_buftarg_t           *m_ddev_targp;  /* saves taking the address */
-       xfs_buftarg_t           *m_logdev_targp;/* ptr to log device */
-       xfs_buftarg_t           *m_rtdev_targp; /* ptr to rt device */
-#define m_dev          m_ddev_targp->pbr_dev
        __uint8_t               m_dircook_elog; /* log d-cookie entry bits */
        __uint8_t               m_blkbit_log;   /* blocklog + NBBY */
        __uint8_t               m_blkbb_log;    /* blocklog - BBSHIFT */
@@ -331,14 +310,45 @@ typedef struct xfs_mount {
        struct xfs_perag        *m_perag;       /* per-ag accounting info */
        struct rw_semaphore     m_peraglock;    /* lock for m_perag (pointer) */
        sema_t                  m_growlock;     /* growfs mutex */
-       int                     m_fixedfsid[2]; /* unchanged for life of FS */
        uint                    m_dmevmask;     /* DMI events for this FS */
-       __uint64_t              m_flags;        /* global mount flags */
        uint                    m_attroffset;   /* inode attribute offset */
        uint                    m_dir_node_ents; /* #entries in a dir danode */
        uint                    m_attr_node_ents; /* #entries in attr danode */
        int                     m_ialloc_inos;  /* inodes in inode allocation */
        int                     m_ialloc_blks;  /* blocks in inode allocation */
+       __uint64_t              m_resblks_avail;/* available reserved blocks */
+       atomic_t                m_active_trans; /* number trans frozen */ 
+
+       /* All the variables below this show read-mostly behaviour */
+       struct xfs_buf          *m_sb_bp ____cacheline_internodealigned_in_smp;
+                                               /* buffer for superblock */
+       char                    *m_fsname;      /* filesystem name */
+       int                     m_fsname_len;   /* strlen of fs name */
+       char                    *m_rtname;      /* realtime device name */
+       char                    *m_logname;     /* external log device name */
+       int                     m_bsize;        /* fs logical block size */
+       xfs_agnumber_t          m_maxagi;       /* highest inode alloc group */
+       uint                    m_ihsize;       /* size of next field */
+       struct xfs_ihash        *m_ihash;       /* fs private inode hash table*/
+       uint                    m_readio_log;   /* min read size log bytes */
+       uint                    m_readio_blocks; /* min read size blocks */
+       uint                    m_writeio_log;  /* min write size log bytes */
+       uint                    m_writeio_blocks; /* min write size blocks */
+       struct log              *m_log;         /* log specific stuff */
+       int                     m_logbufs;      /* number of log buffers */
+       int                     m_logbsize;     /* size of each log buffer */
+       uint                    m_rsumlevels;   /* rt summary levels */
+       uint                    m_rsumsize;     /* size of rt summary, bytes */
+       struct xfs_inode        *m_rbmip;       /* pointer to bitmap inode */
+       struct xfs_inode        *m_rsumip;      /* pointer to summary inode */
+       struct xfs_inode        *m_rootip;      /* pointer to root directory */
+       struct xfs_quotainfo    *m_quotainfo;   /* disk quota information */
+       xfs_buftarg_t           *m_ddev_targp;  /* saves taking the address */
+       xfs_buftarg_t           *m_logdev_targp;/* ptr to log device */
+       xfs_buftarg_t           *m_rtdev_targp; /* ptr to rt device */
+#define m_dev          m_ddev_targp->pbr_dev
+       int                     m_fixedfsid[2]; /* unchanged for life of FS */
+       __uint64_t              m_flags;        /* global mount flags */
        int                     m_litino;       /* size of inode union area */
        int                     m_inoalign_mask;/* mask sb_inoalignmt if used */
        uint                    m_qflags;       /* quota status flags */
@@ -346,7 +356,6 @@ typedef struct xfs_mount {
        __uint64_t              m_maxicount;    /* maximum inode count */
        __uint64_t              m_maxioffset;   /* maximum inode offset */
        __uint64_t              m_resblks;      /* total reserved blocks */
-       __uint64_t              m_resblks_avail;/* available reserved blocks */
 #if XFS_BIG_INUMS
        xfs_ino_t               m_inoadd;       /* add value for ino64_offset */
 #endif
@@ -372,7 +381,6 @@ typedef struct xfs_mount {
        struct xfs_dmops        m_dm_ops;       /* vector of DMI ops */
        struct xfs_qmops        m_qm_ops;       /* vector of XQM ops */
        struct xfs_ioops        m_io_ops;       /* vector of I/O ops */
-       atomic_t                m_active_trans; /* number trans frozen */
 } xfs_mount_t;
 
 /*


<Prev in Thread] Current Thread [Next in Thread>