public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] lightnvm: break the loop when rqd is not null
@ 2016-05-19  6:38 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:40 ` [PATCH 1/2] lightnvm: break the loop when rqd is not null Matias Bjørling
  0 siblings, 2 replies; 6+ messages in thread
From: Wenwei Tao @ 2016-05-19  6:38 UTC (permalink / raw)
  To: mb; +Cc: linux-kernel, linux-block, ww.tao0320

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);
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-19 15:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 1/2] lightnvm: break the loop when rqd is not null Matias Bjørling
2016-05-19 15:17   ` Wenwei Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox