From: Willy Tarreau <w@1wt.eu>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Jens Axboe <jens.axboe@oracle.com>, Jonathan Nieder <jrnieder@gmail.com>
Subject: [ 03/12] writeback: fixups for !dirty_writeback_centisecs
Date: Mon, 12 Mar 2012 01:20:48 +0100 [thread overview]
Message-ID: <20120312002046.081639698@1wt.eu> (raw)
In-Reply-To: <feb44625a10a45049eddf27890e95d54@local>
2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <jens.axboe@oracle.com>
commit 6423104b6a1e6f0c18be60e8c33f02d263331d5e upstream.
Commit 69b62d01 fixed up most of the places where we would enter
busy schedule() spins when disabling the periodic background
writeback. This fixes up the sb timer so that it doesn't get
hammered on with the delay disabled, and ensures that it gets
rearmed if needed when /proc/sys/vm/dirty_writeback_centisecs
gets modified.
bdi_forker_task() also needs to check for !dirty_writeback_centisecs
and use schedule() appropriately, fix that up too.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Tested-by: Xavier Roche <roche@httrack.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
include/linux/backing-dev.h | 1 +
mm/backing-dev.c | 15 ++++++++++-----
mm/page-writeback.c | 1 +
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index b449e73..61e43a6 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -105,6 +105,7 @@ void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb,
long nr_pages);
int bdi_writeback_task(struct bdi_writeback *wb);
int bdi_has_dirty_io(struct backing_dev_info *bdi);
+void bdi_arm_supers_timer(void);
extern spinlock_t bdi_lock;
extern struct list_head bdi_list;
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 67a33a5..d824401 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -41,7 +41,6 @@ static struct timer_list sync_supers_timer;
static int bdi_sync_supers(void *);
static void sync_supers_timer_fn(unsigned long);
-static void arm_supers_timer(void);
static void bdi_add_default_flusher_task(struct backing_dev_info *bdi);
@@ -242,7 +241,7 @@ static int __init default_bdi_init(void)
init_timer(&sync_supers_timer);
setup_timer(&sync_supers_timer, sync_supers_timer_fn, 0);
- arm_supers_timer();
+ bdi_arm_supers_timer();
err = bdi_init(&default_backing_dev_info);
if (!err)
@@ -364,10 +363,13 @@ static int bdi_sync_supers(void *unused)
return 0;
}
-static void arm_supers_timer(void)
+void bdi_arm_supers_timer(void)
{
unsigned long next;
+ if (!dirty_writeback_interval)
+ return;
+
next = msecs_to_jiffies(dirty_writeback_interval * 10) + jiffies;
mod_timer(&sync_supers_timer, round_jiffies_up(next));
}
@@ -375,7 +377,7 @@ static void arm_supers_timer(void)
static void sync_supers_timer_fn(unsigned long unused)
{
wake_up_process(sync_supers_tsk);
- arm_supers_timer();
+ bdi_arm_supers_timer();
}
static int bdi_forker_task(void *ptr)
@@ -418,7 +420,10 @@ static int bdi_forker_task(void *ptr)
spin_unlock_bh(&bdi_lock);
wait = msecs_to_jiffies(dirty_writeback_interval * 10);
- schedule_timeout(wait);
+ if (wait)
+ schedule_timeout(wait);
+ else
+ schedule();
try_to_freeze();
continue;
}
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 2c5d792..52f71ae 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -694,6 +694,7 @@ int dirty_writeback_centisecs_handler(ctl_table *table, int write,
void __user *buffer, size_t *length, loff_t *ppos)
{
proc_dointvec(table, write, buffer, length, ppos);
+ bdi_arm_supers_timer();
return 0;
}
--
1.7.2.1.45.g54fbc
next prev parent reply other threads:[~2012-03-12 0:49 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <feb44625a10a45049eddf27890e95d54@local>
2012-03-12 0:20 ` [ 00/12] 2.6.32.59-longterm review Willy Tarreau
2012-03-12 0:20 ` [ 01/12] compat: Re-add missing asm/compat.h include to fix compile breakage on s390 Willy Tarreau
2012-03-12 0:20 ` [ 02/12] Remove COMPAT_IA32 support Willy Tarreau
2012-03-12 1:07 ` Ben Hutchings
2012-03-12 2:49 ` Greg KH
2012-03-12 6:30 ` Willy Tarreau
2012-03-12 6:48 ` stripping [PATCH] without losing later tags from mailed patches (Re: [ 02/12] Remove COMPAT_IA32 support) Jonathan Nieder
2012-03-12 8:58 ` Willy Tarreau
2012-03-12 15:20 ` Greg KH
2012-03-12 15:24 ` Willy Tarreau
2012-03-12 16:41 ` Thomas Rast
2012-03-12 16:53 ` Willy Tarreau
2012-03-12 16:57 ` Jonathan Nieder
2012-03-12 18:04 ` Junio C Hamano
2012-03-12 18:50 ` Willy Tarreau
2012-03-12 18:54 ` Jonathan Nieder
2012-03-12 19:17 ` Willy Tarreau
2012-03-12 21:47 ` Thomas Rast
2012-03-12 21:56 ` [PATCH] git-am: error out when seeing -b/--binary Jonathan Nieder
2012-03-12 22:03 ` Thomas Rast
2012-03-12 22:22 ` Jonathan Nieder
2012-03-13 15:31 ` Thomas Rast
2012-03-13 17:31 ` Junio C Hamano
2012-03-13 17:51 ` Jonathan Nieder
2012-03-13 18:22 ` Junio C Hamano
2012-03-13 18:38 ` [PATCH] git-am: officially deprecate -b/--binary Junio C Hamano
2012-03-12 22:12 ` [PATCH] git-am: error out when seeing -b/--binary Junio C Hamano
2012-03-12 21:57 ` stripping [PATCH] without losing later tags from mailed patches (Re: [ 02/12] Remove COMPAT_IA32 support) Junio C Hamano
2012-03-12 16:40 ` Junio C Hamano
2012-03-12 16:48 ` Willy Tarreau
2012-03-12 17:57 ` Junio C Hamano
2012-03-12 18:45 ` Willy Tarreau
2012-03-12 19:29 ` Junio C Hamano
2012-03-12 17:12 ` Greg KH
2012-03-12 18:01 ` Junio C Hamano
2012-03-12 19:26 ` Greg KH
2012-03-12 19:51 ` Junio C Hamano
2012-03-12 20:19 ` Willy Tarreau
2012-03-12 15:25 ` [ 02/12] Remove COMPAT_IA32 support Ben Hutchings
2012-03-12 17:02 ` Arnd Bergmann
2012-03-12 17:14 ` Willy Tarreau
2012-03-12 19:34 ` Ben Hutchings
2012-03-12 19:45 ` Willy Tarreau
2012-03-12 0:20 ` Willy Tarreau [this message]
2012-03-12 0:20 ` [ 04/12] bsg: fix sysfs link remove warning Willy Tarreau
2012-03-12 0:20 ` [ 05/12] eCryptfs: Handle failed metadata read in lookup Willy Tarreau
2012-03-12 0:20 ` [ 06/12] [S390] KEYS: Enable the compat keyctl wrapper on s390x Willy Tarreau
2012-03-12 0:20 ` [ 07/12] cifs: fix dentry refcount leak when opening a FIFO on lookup Willy Tarreau
2012-03-12 0:20 ` [ 08/12] mac80211: zero initialize count field in ieee80211_tx_rate Willy Tarreau
2012-03-12 1:57 ` Ben Hutchings
2012-03-12 4:36 ` Mohammed Shafi Shajakhan
2012-03-12 6:34 ` Willy Tarreau
2012-03-12 6:52 ` Mohammed Shafi Shajakhan
2012-03-12 15:23 ` Ben Hutchings
2012-03-12 15:55 ` Mohammed Shafi Shajakhan
2012-03-12 16:10 ` Mohammed Shafi Shajakhan
2012-03-12 6:31 ` Willy Tarreau
2012-03-12 0:20 ` [ 09/12] net/usbnet: avoid recursive locking in usbnet_stop() Willy Tarreau
2012-03-12 0:20 ` [ 10/12] regset: Prevent null pointer reference on readonly regsets Willy Tarreau
2012-03-12 0:20 ` [ 11/12] regset: Return -EFAULT, not -EIO, on host-side memory fault Willy Tarreau
2012-03-12 0:20 ` [ 12/12] watchdog: hpwdt: clean up set_memory_x call for 32 bit Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120312002046.081639698@1wt.eu \
--to=w@1wt.eu \
--cc=jens.axboe@oracle.com \
--cc=jrnieder@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox