public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] block: change to use atomic_inc_return_release()
@ 2015-11-17  3:24 yalin wang
  2015-11-17  3:38 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: yalin wang @ 2015-11-17  3:24 UTC (permalink / raw)
  To: axboe, linux-kernel; +Cc: yalin wang

Some arch define this atomic_inc_return_release() OP.

Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
---
 block/bio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index fbc558b..b251857 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -310,8 +310,7 @@ static void bio_chain_endio(struct bio *bio, int error)
 static inline void bio_inc_remaining(struct bio *bio)
 {
 	bio->bi_flags |= (1 << BIO_CHAIN);
-	smp_mb__before_atomic();
-	atomic_inc(&bio->__bi_remaining);
+	atomic_inc_return_release(&bio->__bi_remaining);
 }
 
 /**
-- 
1.9.1


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

end of thread, other threads:[~2015-11-17  4:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-17  3:24 [RFC] block: change to use atomic_inc_return_release() yalin wang
2015-11-17  3:38 ` Jens Axboe
2015-11-17  4:11   ` yalin wang

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