cpuset.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef _LINUX_CPUSET_H
  2. #define _LINUX_CPUSET_H
  3. /*
  4. * cpuset interface
  5. *
  6. * Copyright (C) 2003 BULL SA
  7. * Copyright (C) 2004 Silicon Graphics, Inc.
  8. *
  9. */
  10. #include <linux/sched.h>
  11. #include <linux/cpumask.h>
  12. #include <linux/nodemask.h>
  13. #ifdef CONFIG_CPUSETS
  14. extern int cpuset_init(void);
  15. extern void cpuset_init_smp(void);
  16. extern void cpuset_fork(struct task_struct *p);
  17. extern void cpuset_exit(struct task_struct *p);
  18. extern cpumask_t cpuset_cpus_allowed(const struct task_struct *p);
  19. void cpuset_init_current_mems_allowed(void);
  20. void cpuset_update_current_mems_allowed(void);
  21. void cpuset_restrict_to_mems_allowed(unsigned long *nodes);
  22. int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl);
  23. int cpuset_zone_allowed(struct zone *z);
  24. extern struct file_operations proc_cpuset_operations;
  25. extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);
  26. #else /* !CONFIG_CPUSETS */
  27. static inline int cpuset_init(void) { return 0; }
  28. static inline void cpuset_init_smp(void) {}
  29. static inline void cpuset_fork(struct task_struct *p) {}
  30. static inline void cpuset_exit(struct task_struct *p) {}
  31. static inline cpumask_t cpuset_cpus_allowed(struct task_struct *p)
  32. {
  33. return cpu_possible_map;
  34. }
  35. static inline void cpuset_init_current_mems_allowed(void) {}
  36. static inline void cpuset_update_current_mems_allowed(void) {}
  37. static inline void cpuset_restrict_to_mems_allowed(unsigned long *nodes) {}
  38. static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
  39. {
  40. return 1;
  41. }
  42. static inline int cpuset_zone_allowed(struct zone *z)
  43. {
  44. return 1;
  45. }
  46. static inline char *cpuset_task_status_allowed(struct task_struct *task,
  47. char *buffer)
  48. {
  49. return buffer;
  50. }
  51. #endif /* !CONFIG_CPUSETS */
  52. #endif /* _LINUX_CPUSET_H */