sysctl.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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_period_reset;
  45. extern unsigned int sysctl_numa_balancing_scan_size;
  46. extern unsigned int sysctl_numa_balancing_settle_count;
  47. #ifdef CONFIG_SCHED_DEBUG
  48. extern unsigned int sysctl_sched_migration_cost;
  49. extern unsigned int sysctl_sched_nr_migrate;
  50. extern unsigned int sysctl_sched_time_avg;
  51. extern unsigned int sysctl_timer_migration;
  52. extern unsigned int sysctl_sched_shares_window;
  53. int sched_proc_update_handler(struct ctl_table *table, int write,
  54. void __user *buffer, size_t *length,
  55. loff_t *ppos);
  56. #endif
  57. #ifdef CONFIG_SCHED_DEBUG
  58. static inline unsigned int get_sysctl_timer_migration(void)
  59. {
  60. return sysctl_timer_migration;
  61. }
  62. #else
  63. static inline unsigned int get_sysctl_timer_migration(void)
  64. {
  65. return 1;
  66. }
  67. #endif
  68. /*
  69. * control realtime throttling:
  70. *
  71. * /proc/sys/kernel/sched_rt_period_us
  72. * /proc/sys/kernel/sched_rt_runtime_us
  73. */
  74. extern unsigned int sysctl_sched_rt_period;
  75. extern int sysctl_sched_rt_runtime;
  76. #ifdef CONFIG_CFS_BANDWIDTH
  77. extern unsigned int sysctl_sched_cfs_bandwidth_slice;
  78. #endif
  79. #ifdef CONFIG_SCHED_AUTOGROUP
  80. extern unsigned int sysctl_sched_autogroup_enabled;
  81. #endif
  82. extern int sched_rr_timeslice;
  83. extern int sched_rr_handler(struct ctl_table *table, int write,
  84. void __user *buffer, size_t *lenp,
  85. loff_t *ppos);
  86. extern int sched_rt_handler(struct ctl_table *table, int write,
  87. void __user *buffer, size_t *lenp,
  88. loff_t *ppos);
  89. #endif /* _SCHED_SYSCTL_H */