aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2012-01-12 18:02:14 -0500
committerRusty Russell <rusty@rustcorp.com.au>2012-01-12 18:02:14 -0500
commitbd77c04772da38fca510c81f78e51f727123b919 (patch)
tree8554b40191d3d5adebbd2461d26450c0ed7295d4 /kernel/module.c
parent48fd11880b5ef04270be8a87d9a9a9ee2fdae338 (diff)
module: struct module_ref should contains long fields
module_ref contains two "unsigned int" fields. Thats now too small, since some machines can open more than 2^32 files. Check commit 518de9b39e8 (fs: allow for more than 2^31 files) for reference. We can add an aligned(2 * sizeof(unsigned long)) attribute to force alloc_percpu() allocating module_ref areas in single cache lines. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Tejun Heo <tj@kernel.org> CC: Robin Holt <holt@sgi.com> CC: David Miller <davem@davemloft.net> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 4928cffc3dcc..14b8e82e05d4 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -725,9 +725,9 @@ static int try_stop_module(struct module *mod, int flags, int *forced)
725 } 725 }
726} 726}
727 727
728unsigned int module_refcount(struct module *mod) 728unsigned long module_refcount(struct module *mod)
729{ 729{
730 unsigned int incs = 0, decs = 0; 730 unsigned long incs = 0, decs = 0;
731 int cpu; 731 int cpu;
732 732
733 for_each_possible_cpu(cpu) 733 for_each_possible_cpu(cpu)
@@ -853,7 +853,7 @@ static inline void print_unload_info(struct seq_file *m, struct module *mod)
853 struct module_use *use; 853 struct module_use *use;
854 int printed_something = 0; 854 int printed_something = 0;
855 855
856 seq_printf(m, " %u ", module_refcount(mod)); 856 seq_printf(m, " %lu ", module_refcount(mod));
857 857
858 /* Always include a trailing , so userspace can differentiate 858 /* Always include a trailing , so userspace can differentiate
859 between this and the old multi-field proc format. */ 859 between this and the old multi-field proc format. */
@@ -903,7 +903,7 @@ EXPORT_SYMBOL_GPL(symbol_put_addr);
903static ssize_t show_refcnt(struct module_attribute *mattr, 903static ssize_t show_refcnt(struct module_attribute *mattr,
904 struct module_kobject *mk, char *buffer) 904 struct module_kobject *mk, char *buffer)
905{ 905{
906 return sprintf(buffer, "%u\n", module_refcount(mk->mod)); 906 return sprintf(buffer, "%lu\n", module_refcount(mk->mod));
907} 907}
908 908
909static struct module_attribute refcnt = { 909static struct module_attribute refcnt = {