From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Akinobu Mita <akinobu.mita@gmail.com>, Tejun Heo <tj@kernel.org>,
Jens Axboe <axboe@kernel.dk>
Subject: [PATCH] writeback: account BDI's min_ratio for unregistered device
Date: Mon, 17 Aug 2015 23:45:53 +0900 [thread overview]
Message-ID: <1439822753-10575-1-git-send-email-akinobu.mita@gmail.com> (raw)
>From mm/page-writeback.c:
/*
* bdi_min_ratio keeps the sum of the minimum dirty shares of all
* registered backing devices, which, for obvious reasons, can not
* exceed 100%.
*/
static unsigned int bdi_min_ratio;
But when a backing device is unregistered, the BDI's min_ratio is not
subtracted from bdi_min_ratio. So the second attempt to set min_ratio
in the following commands will fail.
# modprobe null_blk
# echo 50 > /sys/block/nullb0/bdi/min_ratio
# modprobe -r null_blk
# modprobe null_blk
# echo 50 > /sys/block/nullb0/bdi/min_ratio
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
---
mm/backing-dev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 42e0a63..92eefe3 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -849,6 +849,7 @@ void bdi_destroy(struct backing_dev_info *bdi)
}
wb_exit(&bdi->wb);
+ bdi_set_min_ratio(bdi, 0);
}
EXPORT_SYMBOL(bdi_destroy);
--
1.9.1
next reply other threads:[~2015-08-17 14:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-17 14:45 Akinobu Mita [this message]
2015-08-17 19:58 ` Tejun Heo
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=1439822753-10575-1-git-send-email-akinobu.mita@gmail.com \
--to=akinobu.mita@gmail.com \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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
all inboxes | Powered by JetHome®