From: "Matias Bjørling" <mb@lightnvm.io>
To: Wenwei Tao <wwtao0320@163.com>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
ww.tao0320@gmail.com
Subject: Re: [PATCH 1/2] lightnvm: break the loop when rqd is not null
Date: Thu, 19 May 2016 14:40:31 +0200 [thread overview]
Message-ID: <573DB43F.2070303@lightnvm.io> (raw)
In-Reply-To: <1463639921-1824-1-git-send-email-wwtao0320@163.com>
On 05/19/2016 08:38 AM, Wenwei Tao wrote:
> From: Wenwei Tao <ww.tao0320@gmail.com>
>
> Break the loop when rqd is not null to reduce
> unnecessary schedule.
>
> Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
> ---
> drivers/lightnvm/rrpc.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
> index 2103e97..2915e39 100644
> --- a/drivers/lightnvm/rrpc.c
> +++ b/drivers/lightnvm/rrpc.c
> @@ -98,6 +98,9 @@ static void rrpc_discard(struct rrpc *rrpc, struct bio *bio)
>
> do {
> rqd = rrpc_inflight_laddr_acquire(rrpc, slba, len);
> + if (rqd)
> + break;
> +
> schedule();
> } while (!rqd);
>
>
If that case, mind if I convert the do..while to while?
while(1) {
rqd = rrpc_inflight_laddr_acquire(rrpc, slba, len);
if (rqd)
break;
schedule();
}
next prev parent reply other threads:[~2016-05-19 12:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-19 6:38 [PATCH 1/2] lightnvm: break the loop when rqd is not null Wenwei Tao
2016-05-19 6:38 ` [PATCH 2/2] lightnvm: hold nvm_lock until finish the target creation Wenwei Tao
2016-05-19 12:42 ` Matias Bjørling
2016-05-19 15:19 ` Wenwei Tao
2016-05-19 12:40 ` Matias Bjørling [this message]
2016-05-19 15:17 ` [PATCH 1/2] lightnvm: break the loop when rqd is not null Wenwei Tao
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=573DB43F.2070303@lightnvm.io \
--to=mb@lightnvm.io \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ww.tao0320@gmail.com \
--cc=wwtao0320@163.com \
/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