mm: prepare for removal of obsolete /proc/sys/vm/nr_pdflush_threads
authorWanpeng Li <liwp@linux.vnet.ibm.com>
Tue, 31 Jul 2012 23:41:52 +0000 (16:41 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Aug 2012 01:42:40 +0000 (18:42 -0700)
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>
Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads [new file with mode: 0644]
Documentation/feature-removal-schedule.txt
Documentation/sysctl/vm.txt
fs/fs-writeback.c
include/linux/backing-dev.h
include/linux/writeback.h
kernel/sysctl.c
kernel/sysctl_binary.c
mm/backing-dev.c

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 (file)
index 0000000..b0b0eeb
--- /dev/null
@@ -0,0 +1,5 @@
+What:          /proc/sys/vm/nr_pdflush_threads
+Date:          June 2012
+Contact:       Wanpeng Li <liwp@linux.vnet.ibm.com>
+Description: Since pdflush is replaced by per-BDI flusher, the interface of old pdflush
+             exported in /proc/sys/vm/ should be removed.
index e9237fb719507abe070064c7fc62848e7307748d..88f2fa48bb63ce3783da288e3052594bc6c1f88a 100644 (file)
@@ -13,6 +13,14 @@ Who: Jim Cromie <jim.cromie@gmail.com>, Jason Baron <jbaron@redhat.com>
 
 ---------------------------
 
+What: /proc/sys/vm/nr_pdflush_threads
+When: 2012
+Why: Since pdflush is deprecated, the interface exported in /proc/sys/vm/
+     should be removed.
+Who: Wanpeng Li <liwp@linux.vnet.ibm.com>
+
+---------------------------
+
 What:  CONFIG_APM_CPU_IDLE, and its ability to call APM BIOS in idle
 When:  2012
 Why:   This optional sub-feature of APM is of dubious reliability,
index 84eb25cd69aae341e552d5c140a10dc0661f29db..06d662b1c5d51dc24dc41952beb545c58131c49e 100644 (file)
@@ -42,7 +42,6 @@ Currently, these files are in /proc/sys/vm:
 - mmap_min_addr
 - nr_hugepages
 - nr_overcommit_hugepages
-- nr_pdflush_threads
 - nr_trim_pages         (only if CONFIG_MMU=n)
 - numa_zonelist_order
 - oom_dump_tasks
@@ -426,16 +425,6 @@ See Documentation/vm/hugetlbpage.txt
 
 ==============================================================
 
-nr_pdflush_threads
-
-The current number of pdflush threads.  This value is read-only.
-The value changes according to the number of dirty pages in the system.
-
-When necessary, additional pdflush threads are created, one per second, up to
-nr_pdflush_threads_max.
-
-==============================================================
-
 nr_trim_pages
 
 This is available only on NOMMU kernels.
index 50d0b78130a1331204e7dc3b0909f57acacd65e1..be3efc4f64f4b8c556e1d6de5c2ff400f05731ab 100644 (file)
@@ -52,11 +52,6 @@ struct wb_writeback_work {
        struct completion *done;        /* set if the caller waits */
 };
 
-/*
- * We don't actually have pdflush, but this one is exported though /proc...
- */
-int nr_pdflush_threads;
-
 /**
  * writeback_in_progress - determine whether there is writeback in progress
  * @bdi: the device's backing_dev_info structure.
index 489de625cd2599c2c2abc33d4ba46e4aeddd9e51..c97c6b9cd38ee34e501735758de2b710decceae0 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/timer.h>
 #include <linux/writeback.h>
 #include <linux/atomic.h>
+#include <linux/sysctl.h>
 
 struct page;
 struct device;
@@ -304,6 +305,8 @@ void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
 void set_bdi_congested(struct backing_dev_info *bdi, int sync);
 long congestion_wait(int sync, long timeout);
 long wait_iff_congested(struct zone *zone, int sync, long timeout);
+int pdflush_proc_obsolete(struct ctl_table *table, int write,
+               void __user *buffer, size_t *lenp, loff_t *ppos);
 
 static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi)
 {
index 6d0a0fcd80e7fcc820042d996221fa7ad3442b10..c66fe3332d8376ab4fd226d60d7afd16e94b1a9f 100644 (file)
@@ -189,9 +189,4 @@ void tag_pages_for_writeback(struct address_space *mapping,
 
 void account_page_redirty(struct page *page);
 
-/* pdflush.c */
-extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
-                                  read-only. */
-
-
 #endif         /* WRITEBACK_H */
index 97186b99b0e40326a739e8b086abb4859f6d1eab..6502d35a25bafb9de258d5f9946c77648c55f368 100644 (file)
@@ -1101,11 +1101,9 @@ static struct ctl_table vm_table[] = {
                .extra1         = &zero,
        },
        {
-               .procname       = "nr_pdflush_threads",
-               .data           = &nr_pdflush_threads,
-               .maxlen         = sizeof nr_pdflush_threads,
-               .mode           = 0444 /* read-only*/,
-               .proc_handler   = proc_dointvec,
+               .procname       = "nr_pdflush_threads",
+               .mode           = 0444 /* read-only */,
+               .proc_handler   = pdflush_proc_obsolete,
        },
        {
                .procname       = "swappiness",
index a650694883a180e93c5ec1d6414e45ba904fcff3..65bdcf198d4e1c3f0727176a439aca4f22800136 100644 (file)
@@ -147,7 +147,7 @@ static const struct bin_table bin_vm_table[] = {
        { CTL_INT,      VM_DIRTY_RATIO,                 "dirty_ratio" },
        /* VM_DIRTY_WB_CS "dirty_writeback_centisecs" no longer used */
        /* VM_DIRTY_EXPIRE_CS "dirty_expire_centisecs" no longer used */
-       { CTL_INT,      VM_NR_PDFLUSH_THREADS,          "nr_pdflush_threads" },
+       /* VM_NR_PDFLUSH_THREADS "nr_pdflush_threads" no longer used */
        { CTL_INT,      VM_OVERCOMMIT_RATIO,            "overcommit_ratio" },
        /* VM_PAGEBUF unused */
        /* VM_HUGETLB_PAGES "nr_hugepages" no longer used */
index 3387aea112092f5ae0bcbba872f08db487bc1f2c..6b4718e2ee341d7fd7f068d83e31da014d1a5ef0 100644 (file)
@@ -886,3 +886,23 @@ out:
        return ret;
 }
 EXPORT_SYMBOL(wait_iff_congested);
+
+int pdflush_proc_obsolete(struct ctl_table *table, int write,
+                       void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+       char kbuf[] = "0\n";
+
+       if (*ppos) {
+               *lenp = 0;
+               return 0;
+       }
+
+       if (copy_to_user(buffer, kbuf, sizeof(kbuf)))
+               return -EFAULT;
+       printk_once(KERN_WARNING "%s exported in /proc is scheduled for removal\n",
+                       table->procname);
+
+       *lenp = 2;
+       *ppos += *lenp;
+       return 2;
+}