Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16911
b: refs/heads/master
c: c417f02
h: refs/heads/master
i:
  16909: 73640b6
  16907: 2994d31
  16903: 2c6707d
  16895: a85d3e6
v: v3
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Jan 9, 2006
1 parent 4144c9f commit 75dd0f5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04c19fa6f16047abff2288ddbc1f0798ede5a849
refs/heads/master: c417f0242ebe578924a30d4e53d35b5059fed4e7
2 changes: 2 additions & 0 deletions trunk/include/linux/cpuset.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

extern int number_of_cpusets; /* How many cpusets are defined in system? */

extern int cpuset_init_early(void);
extern int cpuset_init(void);
extern void cpuset_init_smp(void);
extern void cpuset_fork(struct task_struct *p);
Expand Down Expand Up @@ -49,6 +50,7 @@ extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);

#else /* !CONFIG_CPUSETS */

static inline int cpuset_init_early(void) { return 0; }
static inline int cpuset_init(void) { return 0; }
static inline void cpuset_init_smp(void) {}
static inline void cpuset_fork(struct task_struct *p) {}
Expand Down
1 change: 1 addition & 0 deletions trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ asmlinkage void __init start_kernel(void)
}
#endif
vfs_caches_init_early();
cpuset_init_early();
mem_init();
kmem_cache_init();
setup_per_cpu_pageset();
Expand Down
22 changes: 16 additions & 6 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,7 @@ static void guarantee_online_mems(const struct cpuset *cs, nodemask_t *pmask)
* Do not call this routine if in_interrupt().
*
* Call without callback_sem or task_lock() held. May be called
* with or without manage_sem held. Except in early boot or
* an exiting task, when tsk->cpuset is NULL, this routine will
* acquire task_lock(). We don't need to use task_lock to guard
* with or without manage_sem held. Doesn't need task_lock to guard
* against another task changing a non-NULL cpuset pointer to NULL,
* as that is only done by a task on itself, and if the current task
* is here, it is not simultaneously in the exit code NULL'ing its
Expand All @@ -631,9 +629,6 @@ void cpuset_update_task_memory_state()
struct task_struct *tsk = current;
struct cpuset *cs = tsk->cpuset;

if (unlikely(!cs))
return;

task_lock(tsk);
my_cpusets_mem_gen = cs->mems_generation;
task_unlock(tsk);
Expand Down Expand Up @@ -1836,6 +1831,21 @@ static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry)
return 0;
}

/*
* cpuset_init_early - just enough so that the calls to
* cpuset_update_task_memory_state() in early init code
* are harmless.
*/

int __init cpuset_init_early(void)
{
struct task_struct *tsk = current;

tsk->cpuset = &top_cpuset;
tsk->cpuset->mems_generation = atomic_read(&cpuset_mems_generation);
return 0;
}

/**
* cpuset_init - initialize cpusets at system boot
*
Expand Down

0 comments on commit 75dd0f5

Please sign in to comment.