From: <stockhausen@collogia.de>
To: linux-raid@vger.kernel.org
Subject: [Patch v1 4/4] md/raid5: Fix rmw/rcw parametrization check
Date: Fri, 7 Aug 2015 20:21:04 +0000 [thread overview]
Message-ID: <6fb0d15a-95da-494c-8bf8-9722933108be@EXCHANGE.collogia.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 1872 bytes --]
md/raid5: Fix rmw/rcw parametrization check
Commit 584acdd49cd2472ca0f5a06adbe979db82d0b4af (activate rmw feature) and
commit d06f191f8ecaef4d524e765fdb455f96392fbd42 (rmw_level) allow to set the
desired rmw/rcw handling for a raid456 device. For the corner case that IO
costs of rmw and rcw are equal setting PARITY_PREFER_RMW should favour rmw
over rcw. The implementation is slightly messed. Instead the default setting
PARITY_ENABLE_RMW already favours rmw. Fix that.
Signed-off-by: Markus Stockhausen <stockhausen@collogia.de>
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index f8630c1..f94c389 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3564,7 +3564,7 @@ static void handle_stripe_dirtying(struct r5conf *conf,
/* Calculate the real rcw later - for now make it
* look like rcw is cheaper
*/
- rcw = 1; rmw = 2;
+ rcw = 1; rmw = 3;
pr_debug("force RCW rmw_level=%u, recovery_cp=%llu sh->sector=%llu\n",
conf->rmw_level, (unsigned long long)recovery_cp,
(unsigned long long)sh->sector);
@@ -3584,7 +3584,9 @@ static void handle_stripe_dirtying(struct r5conf *conf,
}
pr_debug("for sector %llu, rmw=%d rcw=%d\n",
(unsigned long long)sh->sector, rmw, rcw);
- if ((rmw < rcw || (rmw == rcw && conf->rmw_level == PARITY_ENABLE_RMW)) && rmw > 0) {
+ if (rcw && conf->rmw_level == PARITY_PREFER_RMW)
+ rcw++;
+ if (rmw && rmw < rcw) {
/* prefer read-modify-write, but need to get some data */
if (conf->mddev->queue)
blk_add_trace_msg(conf->mddev->queue,
@@ -3611,7 +3613,7 @@ static void handle_stripe_dirtying(struct r5conf *conf,
}
}
}
- if ((rcw < rmw || (rcw == rmw && conf->rmw_level != PARITY_ENABLE_RMW)) && rcw > 0) {
+ if (rcw && rcw <= rmw) {
/* want reconstruct write, but need to get some data */
int qread =0;
rcw = 0;
[-- Attachment #2: InterScan_Disclaimer.txt --]
[-- Type: text/plain, Size: 1650 bytes --]
****************************************************************************
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.
Ãber das Internet versandte E-Mails können unter fremden Namen erstellt oder
manipuliert werden. Deshalb ist diese als E-Mail verschickte Nachricht keine
rechtsverbindliche Willenserklärung.
Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln
Vorstand:
Kadir Akin
Dr. Michael Höhnerbach
Vorsitzender des Aufsichtsrates:
Hans Kristian Langva
Registergericht: Amtsgericht Köln
Registernummer: HRB 52 497
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
e-mails sent over the internet may have been written under a wrong name or
been manipulated. That is why this message sent as an e-mail is not a
legally binding declaration of intention.
Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln
executive board:
Kadir Akin
Dr. Michael Höhnerbach
President of the supervisory board:
Hans Kristian Langva
Registry office: district court Cologne
Register number: HRB 52 497
****************************************************************************
reply other threads:[~2015-08-07 20:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=6fb0d15a-95da-494c-8bf8-9722933108be@EXCHANGE.collogia.de \
--to=stockhausen@collogia.de \
--cc=linux-raid@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