sched: use kzalloc() instead of the bootmem allocator
Now that kmem_cache_init() happens before sched_init(), we should use kzalloc() and not the bootmem allocator. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This commit is contained in:
@@ -68,7 +68,6 @@
|
|||||||
#include <linux/pagemap.h>
|
#include <linux/pagemap.h>
|
||||||
#include <linux/hrtimer.h>
|
#include <linux/hrtimer.h>
|
||||||
#include <linux/tick.h>
|
#include <linux/tick.h>
|
||||||
#include <linux/bootmem.h>
|
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
#include <linux/ftrace.h>
|
#include <linux/ftrace.h>
|
||||||
@@ -7782,21 +7781,18 @@ static void rq_attach_root(struct rq *rq, struct root_domain *rd)
|
|||||||
|
|
||||||
static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem)
|
static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem)
|
||||||
{
|
{
|
||||||
|
gfp_t gfp = GFP_KERNEL;
|
||||||
|
|
||||||
memset(rd, 0, sizeof(*rd));
|
memset(rd, 0, sizeof(*rd));
|
||||||
|
|
||||||
if (bootmem) {
|
if (bootmem)
|
||||||
alloc_bootmem_cpumask_var(&def_root_domain.span);
|
gfp = GFP_NOWAIT;
|
||||||
alloc_bootmem_cpumask_var(&def_root_domain.online);
|
|
||||||
alloc_bootmem_cpumask_var(&def_root_domain.rto_mask);
|
|
||||||
cpupri_init(&rd->cpupri, true);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!alloc_cpumask_var(&rd->span, GFP_KERNEL))
|
if (!alloc_cpumask_var(&rd->span, gfp))
|
||||||
goto out;
|
goto out;
|
||||||
if (!alloc_cpumask_var(&rd->online, GFP_KERNEL))
|
if (!alloc_cpumask_var(&rd->online, gfp))
|
||||||
goto free_span;
|
goto free_span;
|
||||||
if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
|
if (!alloc_cpumask_var(&rd->rto_mask, gfp))
|
||||||
goto free_online;
|
goto free_online;
|
||||||
|
|
||||||
if (cpupri_init(&rd->cpupri, false) != 0)
|
if (cpupri_init(&rd->cpupri, false) != 0)
|
||||||
@@ -9123,7 +9119,7 @@ void __init sched_init(void)
|
|||||||
* we use alloc_bootmem().
|
* we use alloc_bootmem().
|
||||||
*/
|
*/
|
||||||
if (alloc_size) {
|
if (alloc_size) {
|
||||||
ptr = (unsigned long)alloc_bootmem(alloc_size);
|
ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT);
|
||||||
|
|
||||||
#ifdef CONFIG_FAIR_GROUP_SCHED
|
#ifdef CONFIG_FAIR_GROUP_SCHED
|
||||||
init_task_group.se = (struct sched_entity **)ptr;
|
init_task_group.se = (struct sched_entity **)ptr;
|
||||||
|
Reference in New Issue
Block a user