Commit da1eca60 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove /proc/sys/vm/dirty_sync_thresh

This was designed to be a really sterm throttling threshold: if dirty
memory reaches this level then perform writeback and actually wait on
it.

It doesn't work.  Because memory dirtiers are required to perform
writeback if the amount of dirty AND writeback memory exceeds
dirty_async_ratio.

So kill it, and rely just on the request queues being appropriately
scaled to the machine size (they are).

This is basically what 2.4 does.
parent 6fda85f2
...@@ -963,13 +963,6 @@ Contains, as a percentage of total system memory, the number of pages at which ...@@ -963,13 +963,6 @@ Contains, as a percentage of total system memory, the number of pages at which
a process which is generating disk writes will itself start writing out dirty a process which is generating disk writes will itself start writing out dirty
data. data.
dirty_sync_ratio
----------------
Contains, as a percentage of total system memory, the number of pages at which
a process which is generating disk writes will itself start writing out dirty
data and waiting upon completion of that writeout.
dirty_writeback_centisecs dirty_writeback_centisecs
------------------------- -------------------------
......
...@@ -21,13 +21,12 @@ Currently, these files are in /proc/sys/vm: ...@@ -21,13 +21,12 @@ Currently, these files are in /proc/sys/vm:
- dirty_async_ratio - dirty_async_ratio
- dirty_background_ratio - dirty_background_ratio
- dirty_expire_centisecs - dirty_expire_centisecs
- dirty_sync_ratio
- dirty_writeback_centisecs - dirty_writeback_centisecs
============================================================== ==============================================================
dirty_async_ratio, dirty_background_ratio, dirty_expire_centisecs, dirty_async_ratio, dirty_background_ratio, dirty_expire_centisecs,
dirty_sync_ratio dirty_writeback_centisecs: dirty_writeback_centisecs:
See Documentation/filesystems/proc.txt See Documentation/filesystems/proc.txt
......
...@@ -262,9 +262,6 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc) ...@@ -262,9 +262,6 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc)
break; break;
really_sync = (wbc->sync_mode == WB_SYNC_ALL); really_sync = (wbc->sync_mode == WB_SYNC_ALL);
if ((wbc->sync_mode == WB_SYNC_LAST) && (head->prev == head))
really_sync = 1;
BUG_ON(inode->i_state & I_FREEING); BUG_ON(inode->i_state & I_FREEING);
__iget(inode); __iget(inode);
list_move(&inode->i_list, &sb->s_dirty); list_move(&inode->i_list, &sb->s_dirty);
......
...@@ -147,12 +147,11 @@ enum ...@@ -147,12 +147,11 @@ enum
VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */ VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */
VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */ VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */
VM_DIRTY_ASYNC=12, /* dirty_async_ratio */ VM_DIRTY_ASYNC=12, /* dirty_async_ratio */
VM_DIRTY_SYNC=13, /* dirty_sync_ratio */ VM_DIRTY_WB_CS=13, /* dirty_writeback_centisecs */
VM_DIRTY_WB_CS=14, /* dirty_writeback_centisecs */ VM_DIRTY_EXPIRE_CS=14, /* dirty_expire_centisecs */
VM_DIRTY_EXPIRE_CS=15, /* dirty_expire_centisecs */ VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */
VM_NR_PDFLUSH_THREADS=16, /* nr_pdflush_threads */ VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */
VM_OVERCOMMIT_RATIO=17, /* percent of RAM to allow overcommit in */ VM_PAGEBUF=17, /* struct: Control pagebuf parameters */
VM_PAGEBUF=18 /* struct: Control pagebuf parameters */
}; };
......
...@@ -27,10 +27,9 @@ static inline int current_is_pdflush(void) ...@@ -27,10 +27,9 @@ static inline int current_is_pdflush(void)
* fs/fs-writeback.c * fs/fs-writeback.c
*/ */
enum writeback_sync_modes { enum writeback_sync_modes {
WB_SYNC_NONE = 0, /* Don't wait on anything */ WB_SYNC_NONE, /* Don't wait on anything */
WB_SYNC_LAST = 1, /* Wait on the last-written mapping */ WB_SYNC_ALL, /* Wait on every mapping */
WB_SYNC_ALL = 2, /* Wait on every mapping */ WB_SYNC_HOLD, /* Hold the inode on sb_dirty for sys_sync() */
WB_SYNC_HOLD = 3, /* Hold the inode on sb_dirty for sys_sync() */
}; };
/* /*
...@@ -65,7 +64,6 @@ static inline void wait_on_inode(struct inode *inode) ...@@ -65,7 +64,6 @@ static inline void wait_on_inode(struct inode *inode)
/* These 5 are exported to sysctl. */ /* These 5 are exported to sysctl. */
extern int dirty_background_ratio; extern int dirty_background_ratio;
extern int dirty_async_ratio; extern int dirty_async_ratio;
extern int dirty_sync_ratio;
extern int dirty_writeback_centisecs; extern int dirty_writeback_centisecs;
extern int dirty_expire_centisecs; extern int dirty_expire_centisecs;
......
...@@ -292,9 +292,6 @@ static ctl_table vm_table[] = { ...@@ -292,9 +292,6 @@ static ctl_table vm_table[] = {
{VM_DIRTY_ASYNC, "dirty_async_ratio", &dirty_async_ratio, {VM_DIRTY_ASYNC, "dirty_async_ratio", &dirty_async_ratio,
sizeof(dirty_async_ratio), 0644, NULL, &proc_dointvec_minmax, sizeof(dirty_async_ratio), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL, &zero, &one_hundred }, &sysctl_intvec, NULL, &zero, &one_hundred },
{VM_DIRTY_SYNC, "dirty_sync_ratio", &dirty_sync_ratio,
sizeof(dirty_sync_ratio), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL, &zero, &one_hundred },
{VM_DIRTY_WB_CS, "dirty_writeback_centisecs", {VM_DIRTY_WB_CS, "dirty_writeback_centisecs",
&dirty_writeback_centisecs, sizeof(dirty_writeback_centisecs), 0644, &dirty_writeback_centisecs, sizeof(dirty_writeback_centisecs), 0644,
NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL,
......
...@@ -72,11 +72,6 @@ int dirty_background_ratio = 10; ...@@ -72,11 +72,6 @@ int dirty_background_ratio = 10;
*/ */
int dirty_async_ratio = 40; int dirty_async_ratio = 40;
/*
* The generator of dirty data performs sync writeout at this level
*/
int dirty_sync_ratio = 50;
/* /*
* The interval between `kupdate'-style writebacks, in centiseconds * The interval between `kupdate'-style writebacks, in centiseconds
* (hundredths of a second) * (hundredths of a second)
...@@ -105,15 +100,11 @@ static void background_writeout(unsigned long _min_pages); ...@@ -105,15 +100,11 @@ static void background_writeout(unsigned long _min_pages);
* - Does nothing at all. * - Does nothing at all.
* *
* balance_dirty_pages() can sleep. * balance_dirty_pages() can sleep.
*
* FIXME: WB_SYNC_LAST doesn't actually work. It waits on the last dirty
* inode on the superblock list. It should wait when nr_to_write is
* exhausted. Doesn't seem to matter.
*/ */
void balance_dirty_pages(struct address_space *mapping) void balance_dirty_pages(struct address_space *mapping)
{ {
struct page_state ps; struct page_state ps;
long background_thresh, async_thresh, sync_thresh; long background_thresh, async_thresh;
unsigned long dirty_and_writeback; unsigned long dirty_and_writeback;
struct backing_dev_info *bdi; struct backing_dev_info *bdi;
...@@ -122,20 +113,9 @@ void balance_dirty_pages(struct address_space *mapping) ...@@ -122,20 +113,9 @@ void balance_dirty_pages(struct address_space *mapping)
background_thresh = (dirty_background_ratio * total_pages) / 100; background_thresh = (dirty_background_ratio * total_pages) / 100;
async_thresh = (dirty_async_ratio * total_pages) / 100; async_thresh = (dirty_async_ratio * total_pages) / 100;
sync_thresh = (dirty_sync_ratio * total_pages) / 100;
bdi = mapping->backing_dev_info; bdi = mapping->backing_dev_info;
if (dirty_and_writeback > sync_thresh) { if (dirty_and_writeback > async_thresh) {
struct writeback_control wbc = {
.bdi = bdi,
.sync_mode = WB_SYNC_LAST,
.older_than_this = NULL,
.nr_to_write = sync_writeback_pages(),
};
writeback_inodes(&wbc);
get_page_state(&ps);
} else if (dirty_and_writeback > async_thresh) {
struct writeback_control wbc = { struct writeback_control wbc = {
.bdi = bdi, .bdi = bdi,
.sync_mode = WB_SYNC_NONE, .sync_mode = WB_SYNC_NONE,
...@@ -331,8 +311,6 @@ static int __init page_writeback_init(void) ...@@ -331,8 +311,6 @@ static int __init page_writeback_init(void)
dirty_background_ratio /= 100; dirty_background_ratio /= 100;
dirty_async_ratio *= correction; dirty_async_ratio *= correction;
dirty_async_ratio /= 100; dirty_async_ratio /= 100;
dirty_sync_ratio *= correction;
dirty_sync_ratio /= 100;
} }
init_timer(&wb_timer); init_timer(&wb_timer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment