aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWanpeng Li <liwp@linux.vnet.ibm.com>2012-07-31 19:41:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:40 -0400
commit3965c9ae47d64aadf6f13b6fcd37767b83c0689a (patch)
tree9896fbd841edbaa8e374b593ad0f7b96191cda5d
parentdeaf386ee58d5336bbef8959bf304573afb67c20 (diff)
mm: prepare for removal of obsolete /proc/sys/vm/nr_pdflush_threads
Since per-BDI flusher threads were introduced in 2.6, the pdflush mechanism is not used any more. But the old interface exported through /proc/sys/vm/nr_pdflush_threads still exists and is obviously useless. For back-compatibility, printk warning information and return 2 to notify the users that the interface is removed. Signed-off-by: Wanpeng Li <liwp@linux.vnet.ibm.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads5
-rw-r--r--Documentation/feature-removal-schedule.txt8
-rw-r--r--Documentation/sysctl/vm.txt11
-rw-r--r--fs/fs-writeback.c5
-rw-r--r--include/linux/backing-dev.h3
-rw-r--r--include/linux/writeback.h5
-rw-r--r--kernel/sysctl.c8
-rw-r--r--kernel/sysctl_binary.c2
-rw-r--r--mm/backing-dev.c20
9 files changed, 40 insertions, 27 deletions
diff --git a/Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads b/Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads
new file mode 100644
index 000000000000..b0b0eeb20fe3
--- /dev/null
+++ b/Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads
@@ -0,0 +1,5 @@
1What: /proc/sys/vm/nr_pdflush_threads
2Date: June 2012
3Contact: Wanpeng Li <liwp@linux.vnet.ibm.com>
4Description: Since pdflush is replaced by per-BDI flusher, the interface of old pdflush
5 exported in /proc/sys/vm/ should be removed.
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index e9237fb71950..88f2fa48bb63 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -13,6 +13,14 @@ Who: Jim Cromie <jim.cromie@gmail.com>, Jason Baron <jbaron@redhat.com>
13 13
14--------------------------- 14---------------------------
15 15
16What: /proc/sys/vm/nr_pdflush_threads
17When: 2012
18Why: Since pdflush is deprecated, the interface exported in /proc/sys/vm/
19 should be removed.
20Who: Wanpeng Li <liwp@linux.vnet.ibm.com>
21
22---------------------------
23
16What: CONFIG_APM_CPU_IDLE, and its ability to call APM BIOS in idle 24What: CONFIG_APM_CPU_IDLE, and its ability to call APM BIOS in idle
17When: 2012 25When: 2012
18Why: This optional sub-feature of APM is of dubious reliability, 26Why: This optional sub-feature of APM is of dubious reliability,
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index 84eb25cd69aa..06d662b1c5d5 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -42,7 +42,6 @@ Currently, these files are in /proc/sys/vm:
42- mmap_min_addr 42- mmap_min_addr
43- nr_hugepages 43- nr_hugepages
44- nr_overcommit_hugepages 44- nr_overcommit_hugepages
45- nr_pdflush_threads
46- nr_trim_pages (only if CONFIG_MMU=n) 45- nr_trim_pages (only if CONFIG_MMU=n)
47- numa_zonelist_order 46- numa_zonelist_order
48- oom_dump_tasks 47- oom_dump_tasks
@@ -426,16 +425,6 @@ See Documentation/vm/hugetlbpage.txt
426 425
427============================================================== 426==============================================================
428 427
429nr_pdflush_threads
430
431The current number of pdflush threads. This value is read-only.
432The value changes according to the number of dirty pages in the system.
433
434When necessary, additional pdflush threads are created, one per second, up to
435nr_pdflush_threads_max.
436
437==============================================================
438
439nr_trim_pages 428nr_trim_pages
440 429
441This is available only on NOMMU kernels. 430This is available only on NOMMU kernels.
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 50d0b78130a1..be3efc4f64f4 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -52,11 +52,6 @@ struct wb_writeback_work {
52 struct completion *done; /* set if the caller waits */ 52 struct completion *done; /* set if the caller waits */
53}; 53};
54 54
55/*
56 * We don't actually have pdflush, but this one is exported though /proc...
57 */
58int nr_pdflush_threads;
59
60/** 55/**
61 * writeback_in_progress - determine whether there is writeback in progress 56 * writeback_in_progress - determine whether there is writeback in progress
62 * @bdi: the device's backing_dev_info structure. 57 * @bdi: the device's backing_dev_info structure.
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 489de625cd25..c97c6b9cd38e 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -17,6 +17,7 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/writeback.h> 18#include <linux/writeback.h>
19#include <linux/atomic.h> 19#include <linux/atomic.h>
20#include <linux/sysctl.h>
20 21
21struct page; 22struct page;
22struct device; 23struct device;
@@ -304,6 +305,8 @@ void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
304void set_bdi_congested(struct backing_dev_info *bdi, int sync); 305void set_bdi_congested(struct backing_dev_info *bdi, int sync);
305long congestion_wait(int sync, long timeout); 306long congestion_wait(int sync, long timeout);
306long wait_iff_congested(struct zone *zone, int sync, long timeout); 307long wait_iff_congested(struct zone *zone, int sync, long timeout);
308int pdflush_proc_obsolete(struct ctl_table *table, int write,
309 void __user *buffer, size_t *lenp, loff_t *ppos);
307 310
308static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) 311static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi)
309{ 312{
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 6d0a0fcd80e7..c66fe3332d83 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -189,9 +189,4 @@ void tag_pages_for_writeback(struct address_space *mapping,
189 189
190void account_page_redirty(struct page *page); 190void account_page_redirty(struct page *page);
191 191
192/* pdflush.c */
193extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
194 read-only. */
195
196
197#endif /* WRITEBACK_H */ 192#endif /* WRITEBACK_H */
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 97186b99b0e4..6502d35a25ba 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1101,11 +1101,9 @@ static struct ctl_table vm_table[] = {
1101 .extra1 = &zero, 1101 .extra1 = &zero,
1102 }, 1102 },
1103 { 1103 {
1104 .procname = "nr_pdflush_threads", 1104 .procname = "nr_pdflush_threads",
1105 .data = &nr_pdflush_threads, 1105 .mode = 0444 /* read-only */,
1106 .maxlen = sizeof nr_pdflush_threads, 1106 .proc_handler = pdflush_proc_obsolete,
1107 .mode = 0444 /* read-only*/,
1108 .proc_handler = proc_dointvec,
1109 }, 1107 },
1110 { 1108 {
1111 .procname = "swappiness", 1109 .procname = "swappiness",
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
index a650694883a1..65bdcf198d4e 100644
--- a/kernel/sysctl_binary.c
+++ b/kernel/sysctl_binary.c
@@ -147,7 +147,7 @@ static const struct bin_table bin_vm_table[] = {
147 { CTL_INT, VM_DIRTY_RATIO, "dirty_ratio" }, 147 { CTL_INT, VM_DIRTY_RATIO, "dirty_ratio" },
148 /* VM_DIRTY_WB_CS "dirty_writeback_centisecs" no longer used */ 148 /* VM_DIRTY_WB_CS "dirty_writeback_centisecs" no longer used */
149 /* VM_DIRTY_EXPIRE_CS "dirty_expire_centisecs" no longer used */ 149 /* VM_DIRTY_EXPIRE_CS "dirty_expire_centisecs" no longer used */
150 { CTL_INT, VM_NR_PDFLUSH_THREADS, "nr_pdflush_threads" }, 150 /* VM_NR_PDFLUSH_THREADS "nr_pdflush_threads" no longer used */
151 { CTL_INT, VM_OVERCOMMIT_RATIO, "overcommit_ratio" }, 151 { CTL_INT, VM_OVERCOMMIT_RATIO, "overcommit_ratio" },
152 /* VM_PAGEBUF unused */ 152 /* VM_PAGEBUF unused */
153 /* VM_HUGETLB_PAGES "nr_hugepages" no longer used */ 153 /* VM_HUGETLB_PAGES "nr_hugepages" no longer used */
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 3387aea11209..6b4718e2ee34 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -886,3 +886,23 @@ out:
886 return ret; 886 return ret;
887} 887}
888EXPORT_SYMBOL(wait_iff_congested); 888EXPORT_SYMBOL(wait_iff_congested);
889
890int pdflush_proc_obsolete(struct ctl_table *table, int write,
891 void __user *buffer, size_t *lenp, loff_t *ppos)
892{
893 char kbuf[] = "0\n";
894
895 if (*ppos) {
896 *lenp = 0;
897 return 0;
898 }
899
900 if (copy_to_user(buffer, kbuf, sizeof(kbuf)))
901 return -EFAULT;
902 printk_once(KERN_WARNING "%s exported in /proc is scheduled for removal\n",
903 table->procname);
904
905 *lenp = 2;
906 *ppos += *lenp;
907 return 2;
908}