diff options
author | Tejun Heo <tj@kernel.org> | 2009-02-23 22:32:28 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-02-24 00:24:30 -0500 |
commit | 40150d37be7f7949b2ec07d511244da856647d84 (patch) | |
tree | 6edc4e8d0a0302328f5e65ec6378b703cb6c2e35 /mm | |
parent | 8ac837571491e239e64bd87863c1679d8002e8a2 (diff) |
percpu: add __read_mostly to variables which are mostly read only
Most global variables in percpu allocator are initialized during boot
and read only from that point on. Add __read_mostly as per Rusty's
suggestion.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/percpu.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mm/percpu.c b/mm/percpu.c index 9ac01980cce0..5954e7a9eb1e 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -83,18 +83,18 @@ struct pcpu_chunk { | |||
83 | struct page *page[]; /* #cpus * UNIT_PAGES */ | 83 | struct page *page[]; /* #cpus * UNIT_PAGES */ |
84 | }; | 84 | }; |
85 | 85 | ||
86 | static int pcpu_unit_pages; | 86 | static int pcpu_unit_pages __read_mostly; |
87 | static int pcpu_unit_size; | 87 | static int pcpu_unit_size __read_mostly; |
88 | static int pcpu_chunk_size; | 88 | static int pcpu_chunk_size __read_mostly; |
89 | static int pcpu_nr_slots; | 89 | static int pcpu_nr_slots __read_mostly; |
90 | static size_t pcpu_chunk_struct_size; | 90 | static size_t pcpu_chunk_struct_size __read_mostly; |
91 | 91 | ||
92 | /* the address of the first chunk which starts with the kernel static area */ | 92 | /* the address of the first chunk which starts with the kernel static area */ |
93 | void *pcpu_base_addr; | 93 | void *pcpu_base_addr __read_mostly; |
94 | EXPORT_SYMBOL_GPL(pcpu_base_addr); | 94 | EXPORT_SYMBOL_GPL(pcpu_base_addr); |
95 | 95 | ||
96 | /* the size of kernel static area */ | 96 | /* the size of kernel static area */ |
97 | static int pcpu_static_size; | 97 | static int pcpu_static_size __read_mostly; |
98 | 98 | ||
99 | /* | 99 | /* |
100 | * One mutex to rule them all. | 100 | * One mutex to rule them all. |
@@ -112,7 +112,7 @@ static int pcpu_static_size; | |||
112 | */ | 112 | */ |
113 | static DEFINE_MUTEX(pcpu_mutex); | 113 | static DEFINE_MUTEX(pcpu_mutex); |
114 | 114 | ||
115 | static struct list_head *pcpu_slot; /* chunk list slots */ | 115 | static struct list_head *pcpu_slot __read_mostly; /* chunk list slots */ |
116 | static struct rb_root pcpu_addr_root = RB_ROOT; /* chunks by address */ | 116 | static struct rb_root pcpu_addr_root = RB_ROOT; /* chunks by address */ |
117 | 117 | ||
118 | static int __pcpu_size_to_slot(int size) | 118 | static int __pcpu_size_to_slot(int size) |