From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-block@vger.kernel.org
Cc: damien.lemoal@wdc.com, Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Subject: [PATCH] block: allow zone_mgmt_ops to bail out on SIGKILL
Date: Fri, 8 Nov 2019 15:38:20 -0800 [thread overview]
Message-ID: <20191108233820.4325-1-chaitanya.kulkarni@wdc.com> (raw)
This patch is on the similar concept which is posted earlier:-
https://marc.info/?l=linux-block&m=157321402002207&w=2.
This allows zone-mgmt ops to handle SIGKILL.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
In case someone is interested here is the test on null blk with
added prints for zoneid.
Without this patch :-
# blkzone reset -o 0 -c 1000 /dev/nullb0
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
[ 174.115065] null_blk: null_zone_mgmt 163 zoneid 993
[ 174.125071] null_blk: null_zone_mgmt 163 zoneid 994
[ 174.135076] null_blk: null_zone_mgmt 163 zoneid 995
[ 174.145082] null_blk: null_zone_mgmt 163 zoneid 996
[ 174.155087] null_blk: null_zone_mgmt 163 zoneid 997
[ 174.165091] null_blk: null_zone_mgmt 163 zoneid 998
[ 174.175096] null_blk: null_zone_mgmt 163 zoneid 999
With this patch :-
# blkzone reset -o 0 -c 1000 /dev/nullb0
^C
[ 211.889379] null_blk: null_zone_mgmt 163 zoneid 191
[ 211.899420] null_blk: null_zone_mgmt 163 zoneid 192
[ 211.909424] null_blk: null_zone_mgmt 163 zoneid 193
---
block/blk-zoned.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 481eaf7d04d4..07ff2b75e6d7 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -17,6 +17,7 @@
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/sched/mm.h>
+#include <linux/sched/signal.h>
#include "blk.h"
@@ -287,6 +288,8 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op,
/* This may take a while, so be nice to others */
cond_resched();
+ if (fatal_signal_pending(current))
+ break;
}
ret = submit_bio_wait(bio);
--
2.22.1
next reply other threads:[~2019-11-08 23:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 23:38 Chaitanya Kulkarni [this message]
2019-11-09 1:39 ` [PATCH] block: allow zone_mgmt_ops to bail out on SIGKILL Damien Le Moal
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=20191108233820.4325-1-chaitanya.kulkarni@wdc.com \
--to=chaitanya.kulkarni@wdc.com \
--cc=damien.lemoal@wdc.com \
--cc=linux-block@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;
as well as URLs for NNTP newsgroup(s).