remove no longer use of pdflush interface
Subsystems (4)
PATCH v3 1/1 remove no longer use of pdflush interface
From: Wanpeng Li <[email protected]>
Since per-BDI flusher introduced to linux 2.6, pdflush mechanism is not used any more. But the old interface of pdflush exported in /proc/sys/vm/ is still there. In order to take attention to back-compatibility issues, printk warning information and return -ENOSYS to notice the users the interface is removed.
------------------
v3:
* rename proc_deprecated() to proc_obsolete()
* replace printk in proc_obsolete by prink_once and change warning information
v2:
* add printk warning
* add description in Documentation
v1:
* remove nr_pdflush_threads associated codes
------------------
--- .../ABI/obsolete/proc-sys-vm-nr_pdflush_threads | 5 +++++ Documentation/feature-removal-schedule.txt | 8 ++++++++ Documentation/sysctl/vm.txt | 11 ----------- fs/fs-writeback.c | 5 ----- include/linux/sysctl.h | 3 +++ include/linux/writeback.h | 5 ----- kernel/sysctl.c | 18 +++++++++++++----- kernel/sysctl_binary.c | 2 +- 8 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads
Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads new file +5 -0
@@ -0,0 +1,5 @@ +What: /proc/sys/vm/nr_pdflush_threads +Date: June 2012 +Contact: Wanpeng Li <[email protected]> +Description: Since pdflush is replaced by per-BDI flusher, the interface of old pdflush + exported in /proc/sys/vm/ should be removed.
Documentation/feature-removal-schedule.txt +8 -0
@@ -13,6 +13,14 @@ Who: Jim Cromie <[email protected]>, Jason Baron <[email protected]> --------------------------- +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 <[email protected]> + +--------------------------- + 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,
Documentation/sysctl/vm.txt +0 -11
@@ -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.
fs/fs-writeback.c +0 -5
@@ -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.
include/linux/sysctl.h +3 -0
@@ -964,6 +964,9 @@ extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, void __user *, size_t *, loff_t *);extern int proc_do_large_bitmap (struct ctl_table *,int ,void __user *,size_t *,loff_t *); +extern int proc_obsolete (struct ctl_table *,int , +void __user *,size_t *,loff_t *); +/* * Register a set of sysctl names by calling register_sysctl_table
include/linux/writeback.h +0 -5
@@ -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 */
kernel/sysctl.c +13 -5
@@ -1095,11 +1095,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 = proc_obsolete, }, { .procname = "swappiness",
@@ -2505,6 +2503,15 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,#endif /* CONFIG_PROC_SYSCTL */ +/* notice associated proc obsoleted */ +int proc_obsolete (struct ctl_table *table,int write, +void __user *buffer,size_t *lenp,loff_t *ppos) +{ +printk_once (KERN_WARNING "%s exported in /proc is scheduled for removal\n" , + table->procname); +return -ENOSYS ; +} +/* * No sense putting this after each symbol definition, twice, * exception granted :-)
@@ -2517,3 +2524,4 @@ EXPORT_SYMBOL(proc_dointvec_ms_jiffies);EXPORT_SYMBOL (proc_dostring);EXPORT_SYMBOL (proc_doulongvec_minmax);EXPORT_SYMBOL (proc_doulongvec_ms_jiffies_minmax); +EXPORT_SYMBOL (proc_obsolete);
kernel/sysctl_binary.c +1 -1
@@ -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 */
Signature · 1 line
1.7.9.5
Quoted 162 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Since per-BDI flusher introduced to linux 2.6, pdflush mechanism is not used any more. But the old interface of pdflush exported in
/proc/sys/vm/is still there. In order to take attention to back-compatibility issues, printk warning information and return-ENOSYSto notice the users the interface is removed.Signed-off-by Wanpeng Li <[email protected]>------------------
v3:
* rename
proc_deprecated()toproc_obsolete()
* replace printk inproc_obsoletebyprink_onceand change warning informationv2:
* add printk warning
* add description in Documentationv1:
* remove
nr_pdflush_threadsassociated codes------------------
--- .../ABI/obsolete/proc-sys-vm-nr_pdflush_threads | 5 +++++ Documentation/feature-removal-schedule.txt | 8 ++++++++ Documentation/sysctl/vm.txt | 11 ----------- fs/fs-writeback.c | 5 ----- include/linux/sysctl.h | 3 +++ include/linux/writeback.h | 5 ----- kernel/sysctl.c | 18 +++++++++++++----- kernel/sysctl_binary.c | 2 +- 8 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threadsDocumentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads new file +5
-0@@ -0,0 +1,5 @@ +What: /proc/sys/vm/nr_pdflush_threads +Date: June 2012 +Contact: Wanpeng Li <[email protected]> +Description: Since pdflush is replaced by per-BDI flusher, the interface of old pdflush + exported in /proc/sys/vm/ should be removed.Documentation/feature-removal-schedule.txt +8
-0@@ -13,6 +13,14 @@ Who: Jim Cromie <[email protected]>, Jason Baron <[email protected]> --------------------------- +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 <[email protected]> + +--------------------------- + 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,Documentation/sysctl/vm.txt +0
-11@@ -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.fs/fs-writeback.c +0
-5@@ -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. include/linux/sysctl.h +3
-0@@ -964,6 +964,9 @@ extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, void __user *, size_t *, loff_t *);extern int proc_do_large_bitmap (struct ctl_table *,int ,void __user *,size_t *,loff_t *); +extern int proc_obsolete (struct ctl_table *,int , +void __user *,size_t *,loff_t *); +/* * Register a set of sysctl names by calling register_sysctl_table include/linux/writeback.h +0
-5@@ -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 */ kernel/sysctl.c +3
-5@@ -1095,11 +1095,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 = proc_obsolete, }, { .procname = "swappiness",
kernel/sysctl.c int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, · line 2511
Quoted 9 lines
kernel/sysctl.c +6
-0@@ -2505,6 +2503,15 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,#endif /* CONFIG_PROC_SYSCTL */ +/* notice associated proc obsoleted */ +int proc_obsolete (struct ctl_table *table,int write, +void __user *buffer,size_t *lenp,loff_t *ppos) +{ +printk_once (KERN_WARNING "%s exported in /proc is scheduled for removal\n" , + table->procname);
What Andrew meant is that if you use printk_once here than it means you will no longer be able to also use this generic functions for other obsolete entries. Since only the very first one will print.
Boaz
Quoted 24 lines
kernel/sysctl.c +4
-0+return -ENOSYS ; +} +/* * No sense putting this after each symbol definition, twice, * exception granted :-) @@ -2517,3 +2524,4 @@ EXPORT_SYMBOL(proc_dointvec_ms_jiffies);EXPORT_SYMBOL (proc_dostring);EXPORT_SYMBOL (proc_doulongvec_minmax);EXPORT_SYMBOL (proc_doulongvec_ms_jiffies_minmax); +EXPORT_SYMBOL (proc_obsolete);kernel/sysctl_binary.c +1
-1@@ -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 */