percpu-km.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) percpu-km.c (1170532bb49f9468aedabdc1d5a560e2521a2bcc)
1/*
2 * mm/percpu-km.c - kernel memory based chunk allocation
3 *
4 * Copyright (C) 2010 SUSE Linux Products GmbH
5 * Copyright (C) 2010 Tejun Heo <tj@kernel.org>
6 *
7 * This file is released under the GPLv2.
8 *

--- 81 unchanged lines hidden (view full) ---

90}
91
92static int __init pcpu_verify_alloc_info(const struct pcpu_alloc_info *ai)
93{
94 size_t nr_pages, alloc_pages;
95
96 /* all units must be in a single group */
97 if (ai->nr_groups != 1) {
1/*
2 * mm/percpu-km.c - kernel memory based chunk allocation
3 *
4 * Copyright (C) 2010 SUSE Linux Products GmbH
5 * Copyright (C) 2010 Tejun Heo <tj@kernel.org>
6 *
7 * This file is released under the GPLv2.
8 *

--- 81 unchanged lines hidden (view full) ---

90}
91
92static int __init pcpu_verify_alloc_info(const struct pcpu_alloc_info *ai)
93{
94 size_t nr_pages, alloc_pages;
95
96 /* all units must be in a single group */
97 if (ai->nr_groups != 1) {
98 printk(KERN_CRIT "percpu: can't handle more than one groups\n");
98 pr_crit("percpu: can't handle more than one groups\n");
99 return -EINVAL;
100 }
101
102 nr_pages = (ai->groups[0].nr_units * ai->unit_size) >> PAGE_SHIFT;
103 alloc_pages = roundup_pow_of_two(nr_pages);
104
105 if (alloc_pages > nr_pages)
99 return -EINVAL;
100 }
101
102 nr_pages = (ai->groups[0].nr_units * ai->unit_size) >> PAGE_SHIFT;
103 alloc_pages = roundup_pow_of_two(nr_pages);
104
105 if (alloc_pages > nr_pages)
106 printk(KERN_WARNING "percpu: wasting %zu pages per chunk\n",
107 alloc_pages - nr_pages);
106 pr_warn("percpu: wasting %zu pages per chunk\n",
107 alloc_pages - nr_pages);
108
109 return 0;
110}
108
109 return 0;
110}