Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151522
b: refs/heads/master
c: 58568d2
h: refs/heads/master
v: v3
  • Loading branch information
Miao Xie authored and Linus Torvalds committed Jun 17, 2009
1 parent 9e860ca commit 01f6d70
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 192 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: 950592f7b991f267d707d372b90f508bbe72acbc
refs/heads/master: 58568d2a8215cb6f55caf2332017d7bdff954e1c
13 changes: 9 additions & 4 deletions trunk/include/linux/cpuset.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

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_cpus_allowed(struct task_struct *p, struct cpumask *mask);
Expand All @@ -27,7 +26,6 @@ extern void cpuset_cpus_allowed_locked(struct task_struct *p,
extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
#define cpuset_current_mems_allowed (current->mems_allowed)
void cpuset_init_current_mems_allowed(void);
void cpuset_update_task_memory_state(void);
int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask);

extern int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask);
Expand Down Expand Up @@ -92,9 +90,13 @@ extern void rebuild_sched_domains(void);

extern void cpuset_print_task_mems_allowed(struct task_struct *p);

static inline void set_mems_allowed(nodemask_t nodemask)
{
current->mems_allowed = nodemask;
}

#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) {}

Expand All @@ -116,7 +118,6 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)

#define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY])
static inline void cpuset_init_current_mems_allowed(void) {}
static inline void cpuset_update_task_memory_state(void) {}

static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask)
{
Expand Down Expand Up @@ -188,6 +189,10 @@ static inline void cpuset_print_task_mems_allowed(struct task_struct *p)
{
}

static inline void set_mems_allowed(nodemask_t nodemask)
{
}

#endif /* !CONFIG_CPUSETS */

#endif /* _LINUX_CPUSET_H */
8 changes: 4 additions & 4 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,8 @@ struct task_struct {
/* Thread group tracking */
u32 parent_exec_id;
u32 self_exec_id;
/* Protection of (de-)allocation: mm, files, fs, tty, keyrings */
/* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed,
* mempolicy */
spinlock_t alloc_lock;

#ifdef CONFIG_GENERIC_HARDIRQS
Expand Down Expand Up @@ -1386,8 +1387,7 @@ struct task_struct {
cputime_t acct_timexpd; /* stime + utime since last update */
#endif
#ifdef CONFIG_CPUSETS
nodemask_t mems_allowed;
int cpuset_mems_generation;
nodemask_t mems_allowed; /* Protected by alloc_lock */
int cpuset_mem_spread_rotor;
#endif
#ifdef CONFIG_CGROUPS
Expand All @@ -1410,7 +1410,7 @@ struct task_struct {
struct list_head perf_counter_list;
#endif
#ifdef CONFIG_NUMA
struct mempolicy *mempolicy;
struct mempolicy *mempolicy; /* Protected by alloc_lock */
short il_next;
#endif
atomic_t fs_excl; /* holding fs exclusive resources */
Expand Down
6 changes: 5 additions & 1 deletion trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@ asmlinkage void __init start_kernel(void)
initrd_start = 0;
}
#endif
cpuset_init_early();
page_cgroup_init();
enable_debug_pagealloc();
cpu_hotplug_init();
Expand Down Expand Up @@ -867,6 +866,11 @@ static noinline int init_post(void)
static int __init kernel_init(void * unused)
{
lock_kernel();

/*
* init can allocate pages on any node
*/
set_mems_allowed(node_possible_map);
/*
* init can run on any cpu.
*/
Expand Down
Loading

0 comments on commit 01f6d70

Please sign in to comment.