Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43cf38eb authored by Tejun Heo's avatar Tejun Heo
Browse files

percpu: add __percpu sparse annotations to core kernel subsystems



Add __percpu sparse annotations to core subsystems.

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: default avatarTejun Heo <tj@kernel.org>
Reviewed-by: default avatarChristoph Lameter <cl@linux-foundation.org>
Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-mm@kvack.org
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Eric Biederman <ebiederm@xmission.com>
parent ab386128
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -150,8 +150,8 @@ struct blk_user_trace_setup {
struct blk_trace {
	int trace_state;
	struct rchan *rchan;
	unsigned long *sequence;
	unsigned char *msg_data;
	unsigned long __percpu *sequence;
	unsigned char __percpu *msg_data;
	u16 act_mask;
	u64 start_lba;
	u64 end_lba;
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ struct hd_struct {
	unsigned long stamp;
	int in_flight[2];
#ifdef	CONFIG_SMP
	struct disk_stats *dkstats;
	struct disk_stats __percpu *dkstats;
#else
	struct disk_stats dkstats;
#endif
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ extern struct kimage *kexec_crash_image;
 */
extern struct resource crashk_res;
typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4];
extern note_buf_t *crash_notes;
extern note_buf_t __percpu *crash_notes;
extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
extern size_t vmcoreinfo_size;
extern size_t vmcoreinfo_max_size;
+1 −1
Original line number Diff line number Diff line
@@ -301,7 +301,7 @@ struct zone {
	unsigned long		min_unmapped_pages;
	unsigned long		min_slab_pages;
#endif
	struct per_cpu_pageset	*pageset;
	struct per_cpu_pageset __percpu *pageset;
	/*
	 * free areas of different sizes
	 */
+1 −1
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ struct module

	struct module_ref {
		int count;
	} *refptr;
	} __percpu *refptr;
#endif

#ifdef CONFIG_CONSTRUCTORS
Loading