1 #ifndef _LINUX_CPUSET_H
2 #define _LINUX_CPUSET_H
11 #include <linux/sched.h>
19 extern int number_of_cpusets;
27 #define cpuset_current_mems_allowed (current->mems_allowed)
36 return number_of_cpusets <= 1 ||
42 return number_of_cpusets <= 1 ||
48 return cpuset_node_allowed_softwall(zone_to_nid(z), gfp_mask);
51 static inline int cpuset_zone_allowed_hardwall(
struct zone *z,
gfp_t gfp_mask)
53 return cpuset_node_allowed_hardwall(zone_to_nid(z), gfp_mask);
59 #define cpuset_memory_pressure_bump() \
61 if (cpuset_memory_pressure_enabled) \
62 __cpuset_memory_pressure_bump(); \
64 extern int cpuset_memory_pressure_enabled;
75 static inline int cpuset_do_page_mem_spread(
void)
80 static inline int cpuset_do_slab_mem_spread(
void)
98 static inline unsigned int get_mems_allowed(
void)
100 return read_seqcount_begin(&
current->mems_allowed_seq);
108 static inline bool put_mems_allowed(
unsigned int seq)
110 return !read_seqcount_retry(&
current->mems_allowed_seq, seq);
113 static inline void set_mems_allowed(
nodemask_t nodemask)
116 write_seqcount_begin(&
current->mems_allowed_seq);
117 current->mems_allowed = nodemask;
118 write_seqcount_end(&
current->mems_allowed_seq);
129 partition_sched_domains(1,
NULL,
NULL);
135 cpumask_copy(mask, cpu_possible_mask);
147 #define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY])
155 static inline int cpuset_node_allowed_softwall(
int node,
gfp_t gfp_mask)
160 static inline int cpuset_node_allowed_hardwall(
int node,
gfp_t gfp_mask)
165 static inline int cpuset_zone_allowed_softwall(
struct zone *z,
gfp_t gfp_mask)
170 static inline int cpuset_zone_allowed_hardwall(
struct zone *z,
gfp_t gfp_mask)
181 static inline void cpuset_memory_pressure_bump(
void) {}
198 static inline int cpuset_do_page_mem_spread(
void)
203 static inline int cpuset_do_slab_mem_spread(
void)
215 partition_sched_domains(1,
NULL,
NULL);
222 static inline void set_mems_allowed(
nodemask_t nodemask)
226 static inline unsigned int get_mems_allowed(
void)
231 static inline bool put_mems_allowed(
unsigned int seq)