netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: linux-kernel@vger.kernel.org, axboe@kernel.dk,
	rusty@rustcorp.com.au, akpm@linux-foundation.org,
	ebiederm@xmission.com, tytso@mit.edu, Trond.Myklebust@netapp.com,
	aelder@sgi.com, hch@
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 2/8] percpu: add __percpu sparse annotations to fs
Date: Tue, 26 Jan 2010 00:22:09 +0900	[thread overview]
Message-ID: <1264432935-10453-3-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1264432935-10453-1-git-send-email-tj@kernel.org>

Add __percpu sparse annotations to fs.

These annotations are to make sparse consider percpu variables to be
in a different address space and warn if accessed without going
through percpu accessors.  This patch doesn't affect normal builds.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Alex Elder <aelder@sgi.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
---
 fs/ext4/ext4.h            |    2 +-
 fs/nfs/iostat.h           |    4 ++--
 fs/xfs/xfs_mount.h        |    2 +-
 include/linux/mount.h     |    2 +-
 include/linux/nfs_fs_sb.h |    2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index af7b626..eeb1e36 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1017,7 +1017,7 @@ struct ext4_sb_info {
 	atomic_t s_lock_busy;
 
 	/* locality groups */
-	struct ext4_locality_group *s_locality_groups;
+	struct ext4_locality_group __percpu *s_locality_groups;
 
 	/* for write statistics */
 	unsigned long s_sectors_written_start;
diff --git a/fs/nfs/iostat.h b/fs/nfs/iostat.h
index 46d779a..1d8d5c8 100644
--- a/fs/nfs/iostat.h
+++ b/fs/nfs/iostat.h
@@ -57,12 +57,12 @@ static inline void nfs_add_fscache_stats(struct inode *inode,
 }
 #endif
 
-static inline struct nfs_iostats *nfs_alloc_iostats(void)
+static inline struct nfs_iostats __percpu *nfs_alloc_iostats(void)
 {
 	return alloc_percpu(struct nfs_iostats);
 }
 
-static inline void nfs_free_iostats(struct nfs_iostats *stats)
+static inline void nfs_free_iostats(struct nfs_iostats __percpu *stats)
 {
 	if (stats != NULL)
 		free_percpu(stats);
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 1df7e45..24c8887 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -243,7 +243,7 @@ typedef struct xfs_mount {
 	struct xfs_qmops	*m_qm_ops;	/* vector of XQM ops */
 	atomic_t		m_active_trans;	/* number trans frozen */
 #ifdef HAVE_PERCPU_SB
-	xfs_icsb_cnts_t		*m_sb_cnts;	/* per-cpu superblock counters */
+	xfs_icsb_cnts_t __percpu *m_sb_cnts;	/* per-cpu superblock counters */
 	unsigned long		m_icsb_counters; /* disabled per-cpu counters */
 	struct notifier_block	m_icsb_notifier; /* hotplug cpu notifier */
 	struct mutex		m_icsb_mutex;	/* balancer sync lock */
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 5d52753..b5f43a3 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -66,7 +66,7 @@ struct vfsmount {
 	int mnt_pinned;
 	int mnt_ghosts;
 #ifdef CONFIG_SMP
-	int *mnt_writers;
+	int __percpu *mnt_writers;
 #else
 	int mnt_writers;
 #endif
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 34fc6be..6a2e44f 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -105,7 +105,7 @@ struct nfs_server {
 	struct rpc_clnt *	client;		/* RPC client handle */
 	struct rpc_clnt *	client_acl;	/* ACL RPC client handle */
 	struct nlm_host		*nlm_host;	/* NLM client handle */
-	struct nfs_iostats *	io_stats;	/* I/O statistics */
+	struct nfs_iostats __percpu *io_stats;	/* I/O statistics */
 	struct backing_dev_info	backing_dev_info;
 	atomic_long_t		writeback;	/* number of writeback pages */
 	int			flags;		/* various flags */
-- 
1.6.4.2


  parent reply	other threads:[~2010-01-25 15:19 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1264432935-10453-1-git-send-email-tj@kernel.org>
2010-01-25 15:22 ` [PATCH 1/8] percpu: add __percpu sparse annotations to core kernel subsystems Tejun Heo
2010-01-25 15:22 ` Tejun Heo [this message]
2010-01-25 15:22 ` [PATCH 3/8] percpu: add __percpu sparse annotations to net Tejun Heo
2010-01-25 21:32   ` David Miller
2010-01-25 15:22 ` [PATCH 4/8] percpu: add __percpu sparse annotations to net drivers Tejun Heo
2010-01-25 15:22 ` [PATCH 5/8] percpu: add __percpu sparse annotations to x86 Tejun Heo
2010-01-25 15:22 ` [PATCH 6/8] percpu: add __percpu sparse annotations to trace Tejun Heo
2010-01-25 15:35   ` Steven Rostedt
2010-01-25 15:22 ` [PATCH 7/8] percpu: add __percpu sparse annotations to hw_breakpoint Tejun Heo
2010-01-26  0:19   ` Frederic Weisbecker
2010-01-26  0:48     ` Tejun Heo
2010-01-26  1:02       ` Frederic Weisbecker
2010-01-26  1:19         ` Tejun Heo
2010-01-26  2:01           ` Frederic Weisbecker
2010-01-26  2:10             ` Frederic Weisbecker
2010-01-26  2:13             ` Tejun Heo
2010-01-26  2:18               ` Frederic Weisbecker
2010-01-26  2:22                 ` Frederic Weisbecker
2010-01-26  2:34                   ` Tejun Heo
2010-01-26  2:35                     ` Frederic Weisbecker
2010-01-26  2:47                       ` Tejun Heo
2010-01-26  1:02     ` H. Peter Anvin
2010-01-26  2:06       ` Tejun Heo
2010-01-26  2:04         ` Al Viro
2010-01-26  2:16           ` Tejun Heo
2010-01-26  2:32             ` Al Viro
2010-01-26  2:43               ` Tejun Heo
2010-01-26  2:48                 ` Al Viro
2010-01-26  3:10                   ` Tejun Heo
2010-01-26  3:56                     ` Al Viro
2010-01-26  1:06     ` H. Peter Anvin
2010-01-26  1:12       ` Frederic Weisbecker
2010-01-26  2:10       ` Tejun Heo
2010-01-25 15:22 ` [PATCH 8/8] percpu: add __percpu sparse annotations to what's left Tejun Heo
     [not found] ` <1264432935-10453-9-git-send-email-tj@kernel.org>
2010-01-25 15:54   ` Borislav Petkov
     [not found] ` <1264432935-10453-5-git-send-email-tj@kernel.org>
2010-01-25 21:33   ` [PATCH 4/8] percpu: add __percpu sparse annotations to net drivers David Miller
     [not found] ` <1264432935-10453-2-git-send-email-tj@kernel.org>
2010-01-25 21:58   ` [PATCH 1/8] percpu: add __percpu sparse annotations to core kernel subsystems Christoph Lameter
2010-01-31 11:42   ` Paul E. McKenney
2010-01-25 23:14 ` [PATCHSET] percpu: add __percpu sparse annotations Al Viro
2010-01-26  0:30   ` Tejun Heo
     [not found] ` <1264432935-10453-6-git-send-email-tj@kernel.org>
2010-01-26  1:06   ` [PATCH 5/8] percpu: add __percpu sparse annotations to x86 H. Peter Anvin
2010-01-26  2:17     ` Tejun Heo
2010-02-01  3:30       ` H. Peter Anvin
2010-02-02  5:37 ` [PATCHSET] percpu: add __percpu sparse annotations Tejun Heo

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=1264432935-10453-3-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=aelder@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tytso@mit.edu \
    /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).