sysctl.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef _SCHED_SYSCTL_H
  2. #define _SCHED_SYSCTL_H
  3. #ifdef CONFIG_DETECT_HUNG_TASK
  4. extern unsigned int sysctl_hung_task_panic;
  5. extern unsigned long sysctl_hung_task_check_count;
  6. extern unsigned long sysctl_hung_task_timeout_secs;
  7. extern unsigned long sysctl_hung_task_warnings;
  8. extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
  9. void __user *buffer,
  10. size_t *lenp, loff_t *ppos);
  11. #else
  12. /* Avoid need for ifdefs elsewhere in the code */
  13. enum { sysctl_hung_task_timeout_secs = 0 };
  14. #endif
  15. /*
  16. * Default maximum number of active map areas, this limits the number of vmas
  17. * per mm struct. Users can overwrite this number by sysctl but there is a
  18. * problem.
  19. *
  20. * When a program's coredump is generated as ELF format, a section is created
  21. * per a vma. In ELF, the number of sections is represented in unsigned short.
  22. * This means the number of sections should be smaller than 65535 at coredump.
  23. * Because the kernel adds some informative sections to a image of program at
  24. * generating coredump, we need some margin. The number of extra sections is
  25. * 1-3 now and depends on arch. We use "5" as safe margin, here.
  26. */
  27. #define MAPCOUNT_ELF_CORE_MARGIN (5)
  28. #define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN)
  29. extern int sysctl_max_map_count;
  30. extern unsigned int sysctl_sched_latency;
  31. extern unsigned int sysctl_sched_min_granularity;
  32. extern unsigned int sysctl_sched_wakeup_granularity;
  33. extern unsigned int sysctl_sched_child_runs_first;
  34. enum sched_tunable_scaling {
  35. SCHED_TUNABLESCALING_NONE,
  36. SCHED_TUNABLESCALING_LOG,
  37. SCHED_TUNABLESCALING_LINEAR,
  38. SCHED_TUNABLESCALING_END,
  39. };
  40. extern enum sched_tunable_scaling sysctl_sched_tunable_scaling;
  41. extern unsigned int sysctl_numa_balancing_scan_delay;
  42. extern unsigned int sysctl_numa_balancing_scan_period_min;
  43. extern unsigned int sysctl_numa_balancing_scan_period_max;
  44. extern unsigned int sysctl_numa_balancing_scan_size;
  45. extern unsigned int sysctl_numa_balancing_settle_count;
  46. #ifdef CONFIG_SCHED_DEBUG
  47. extern unsigned int sysctl_sched_migration_cost;
  48. extern unsigned int sysctl_sched_nr_migrate;
  49. extern unsigned int sysctl_sched_time_avg;
  50. extern unsigned int sysctl_timer_migration;
  51. extern unsigned int sysctl_sched_shares_window;
  52. int sched_proc_update_handler(struct ctl_table *table, int write,
  53. void __user *buffer, size_t *length,
  54. loff_t *ppos);
  55. #endif
  56. #ifdef CONFIG_SCHED_DEBUG
  57. static inline unsigned int get_sysctl_timer_migration(void)
  58. {
  59. return sysctl_timer_migration;
  60. }
  61. #else
  62. static inline unsigned int get_sysctl_timer_migration(void)
  63. {
  64. return 1;
  65. }
  66. #endif
  67. /*
  68. * control realtime throttling:
  69. *
  70. * /proc/sys/kernel/sched_rt_period_us
  71. * /proc/sys/kernel/sched_rt_runtime_us
  72. */
  73. extern unsigned int sysctl_sched_rt_period;
  74. extern int sysctl_sched_rt_runtime;
  75. #ifdef CONFIG_CFS_BANDWIDTH
  76. extern unsigned int sysctl_sched_cfs_bandwidth_slice;
  77. #endif
  78. #ifdef CONFIG_SCHED_AUTOGROUP
  79. extern unsigned int sysctl_sched_autogroup_enabled;
  80. #endif
  81. extern int sched_rr_timeslice;
  82. extern int sched_rr_handler(struct ctl_table *table, int write,
  83. void __user *buffer, size_t *lenp,
  84. loff_t *ppos);
  85. extern int sched_rt_handler(struct ctl_table *table, int write,
  86. void __user *buffer, size_t *lenp,
  87. loff_t *ppos);
  88. #endif /* _SCHED_SYSCTL_H */