Commit cd17cbfda004fe5f406c01b318c6378d9895896f

Authored by Jens Axboe
1 parent 05dc7b6134

Revert "mm: add /proc controls for pdflush threads"

This reverts commit fafd688e4c0c34da0f3de909881117d374e4c7af.

Work is progressing to switch away from pdflush as the process backing
for flushing out dirty data. So it seems pointless to add more knobs
to control pdflush threads. The original author of the patch did not
have any specific use cases for adding the knobs, so we can easily
revert this before 2.6.30 to avoid having to maintain this API
forever.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

Showing 4 changed files with 12 additions and 72 deletions Side-by-side Diff

Documentation/sysctl/vm.txt
... ... @@ -39,8 +39,6 @@
39 39 - nr_hugepages
40 40 - nr_overcommit_hugepages
41 41 - nr_pdflush_threads
42   -- nr_pdflush_threads_min
43   -- nr_pdflush_threads_max
44 42 - nr_trim_pages (only if CONFIG_MMU=n)
45 43 - numa_zonelist_order
46 44 - oom_dump_tasks
... ... @@ -466,32 +464,6 @@
466 464 is used in oom_kill_allocating_task.
467 465  
468 466 The default value is 0.
469   -
470   -==============================================================
471   -
472   -nr_pdflush_threads_min
473   -
474   -This value controls the minimum number of pdflush threads.
475   -
476   -At boot time, the kernel will create and maintain 'nr_pdflush_threads_min'
477   -threads for the kernel's lifetime.
478   -
479   -The default value is 2. The minimum value you can specify is 1, and
480   -the maximum value is the current setting of 'nr_pdflush_threads_max'.
481   -
482   -See 'nr_pdflush_threads_max' below for more information.
483   -
484   -==============================================================
485   -
486   -nr_pdflush_threads_max
487   -
488   -This value controls the maximum number of pdflush threads that can be
489   -created. The pdflush algorithm will create a new pdflush thread (up to
490   -this maximum) if no pdflush threads have been available for >= 1 second.
491   -
492   -The default value is 8. The minimum value you can specify is the
493   -current value of 'nr_pdflush_threads_min' and the
494   -maximum is 1000.
495 467  
496 468 ==============================================================
497 469  
include/linux/writeback.h
... ... @@ -168,8 +168,6 @@
168 168 /* pdflush.c */
169 169 extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
170 170 read-only. */
171   -extern int nr_pdflush_threads_max; /* Global so it can be exported to sysctl */
172   -extern int nr_pdflush_threads_min; /* Global so it can be exported to sysctl */
173 171  
174 172  
175 173 #endif /* WRITEBACK_H */
... ... @@ -101,7 +101,6 @@
101 101 static int __maybe_unused two = 2;
102 102 static unsigned long one_ul = 1;
103 103 static int one_hundred = 100;
104   -static int one_thousand = 1000;
105 104  
106 105 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
107 106 static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
... ... @@ -1032,28 +1031,6 @@
1032 1031 .maxlen = sizeof nr_pdflush_threads,
1033 1032 .mode = 0444 /* read-only*/,
1034 1033 .proc_handler = &proc_dointvec,
1035   - },
1036   - {
1037   - .ctl_name = CTL_UNNUMBERED,
1038   - .procname = "nr_pdflush_threads_min",
1039   - .data = &nr_pdflush_threads_min,
1040   - .maxlen = sizeof nr_pdflush_threads_min,
1041   - .mode = 0644 /* read-write */,
1042   - .proc_handler = &proc_dointvec_minmax,
1043   - .strategy = &sysctl_intvec,
1044   - .extra1 = &one,
1045   - .extra2 = &nr_pdflush_threads_max,
1046   - },
1047   - {
1048   - .ctl_name = CTL_UNNUMBERED,
1049   - .procname = "nr_pdflush_threads_max",
1050   - .data = &nr_pdflush_threads_max,
1051   - .maxlen = sizeof nr_pdflush_threads_max,
1052   - .mode = 0644 /* read-write */,
1053   - .proc_handler = &proc_dointvec_minmax,
1054   - .strategy = &sysctl_intvec,
1055   - .extra1 = &nr_pdflush_threads_min,
1056   - .extra2 = &one_thousand,
1057 1034 },
1058 1035 {
1059 1036 .ctl_name = VM_SWAPPINESS,
... ... @@ -58,14 +58,6 @@
58 58 int nr_pdflush_threads = 0;
59 59  
60 60 /*
61   - * The max/min number of pdflush threads. R/W by sysctl at
62   - * /proc/sys/vm/nr_pdflush_threads_max/min
63   - */
64   -int nr_pdflush_threads_max __read_mostly = MAX_PDFLUSH_THREADS;
65   -int nr_pdflush_threads_min __read_mostly = MIN_PDFLUSH_THREADS;
66   -
67   -
68   -/*
69 61 * The time at which the pdflush thread pool last went empty
70 62 */
71 63 static unsigned long last_empty_jifs;
... ... @@ -76,7 +68,7 @@
76 68 * Thread pool management algorithm:
77 69 *
78 70 * - The minimum and maximum number of pdflush instances are bound
79   - * by nr_pdflush_threads_min and nr_pdflush_threads_max.
  71 + * by MIN_PDFLUSH_THREADS and MAX_PDFLUSH_THREADS.
80 72 *
81 73 * - If there have been no idle pdflush instances for 1 second, create
82 74 * a new one.
... ... @@ -142,13 +134,14 @@
142 134 * To throttle creation, we reset last_empty_jifs.
143 135 */
144 136 if (time_after(jiffies, last_empty_jifs + 1 * HZ)) {
145   - if (list_empty(&pdflush_list) &&
146   - nr_pdflush_threads < nr_pdflush_threads_max) {
147   - last_empty_jifs = jiffies;
148   - nr_pdflush_threads++;
149   - spin_unlock_irq(&pdflush_lock);
150   - start_one_pdflush_thread();
151   - spin_lock_irq(&pdflush_lock);
  137 + if (list_empty(&pdflush_list)) {
  138 + if (nr_pdflush_threads < MAX_PDFLUSH_THREADS) {
  139 + last_empty_jifs = jiffies;
  140 + nr_pdflush_threads++;
  141 + spin_unlock_irq(&pdflush_lock);
  142 + start_one_pdflush_thread();
  143 + spin_lock_irq(&pdflush_lock);
  144 + }
152 145 }
153 146 }
154 147  
... ... @@ -160,7 +153,7 @@
160 153 */
161 154 if (list_empty(&pdflush_list))
162 155 continue;
163   - if (nr_pdflush_threads <= nr_pdflush_threads_min)
  156 + if (nr_pdflush_threads <= MIN_PDFLUSH_THREADS)
164 157 continue;
165 158 pdf = list_entry(pdflush_list.prev, struct pdflush_work, list);
166 159 if (time_after(jiffies, pdf->when_i_went_to_sleep + 1 * HZ)) {
167 160  
... ... @@ -266,9 +259,9 @@
266 259 * Pre-set nr_pdflush_threads... If we fail to create,
267 260 * the count will be decremented.
268 261 */
269   - nr_pdflush_threads = nr_pdflush_threads_min;
  262 + nr_pdflush_threads = MIN_PDFLUSH_THREADS;
270 263  
271   - for (i = 0; i < nr_pdflush_threads_min; i++)
  264 + for (i = 0; i < MIN_PDFLUSH_THREADS; i++)
272 265 start_one_pdflush_thread();
273 266 return 0;
274 267 }