cpuset.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask);
  24. extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
  25. extern struct file_operations proc_cpuset_operations;
  26. extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);
  27. #else /* !CONFIG_CPUSETS */
  28. static inline int cpuset_init(void) { return 0; }
  29. static inline void cpuset_init_smp(void) {}
  30. static inline void cpuset_fork(struct task_struct *p) {}
  31. static inline void cpuset_exit(struct task_struct *p) {}
  32. static inline cpumask_t cpuset_cpus_allowed(struct task_struct *p)
  33. {
  34. return cpu_possible_map;
  35. }
  36. static inline void cpuset_init_current_mems_allowed(void) {}
  37. static inline void cpuset_update_current_mems_allowed(void) {}
  38. static inline void cpuset_restrict_to_mems_allowed(unsigned long *nodes) {}
  39. static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
  40. {
  41. return 1;
  42. }
  43. static inline int cpuset_zone_allowed(struct zone *z,
  44. unsigned int __nocast gfp_mask)
  45. {
  46. return 1;
  47. }
  48. static inline int cpuset_excl_nodes_overlap(const struct task_struct *p)
  49. {
  50. return 1;
  51. }
  52. static inline char *cpuset_task_status_allowed(struct task_struct *task,
  53. char *buffer)
  54. {
  55. return buffer;
  56. }
  57. #endif /* !CONFIG_CPUSETS */
  58. #endif /* _LINUX_CPUSET_H */