All of lore.kernel.org
 help / color / mirror / Atom feed
* + fs-direct-ioc-set-bi_rw-when-alloc-bio.patch added to -mm tree
@ 2012-07-31 22:55 akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2012-07-31 22:55 UTC (permalink / raw)
  To: mm-commits; +Cc: majianpeng, jmoyer, neilb, viro


The patch titled
     Subject: fs/direct-io.c: set bi_rw when allocating bio
has been added to the -mm tree.  Its filename is
     fs-direct-ioc-set-bi_rw-when-alloc-bio.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: majianpeng <majianpeng@gmail.com>
Subject: fs/direct-io.c: set bi_rw when allocating bio

When calling bio_alloc(), the bi_rw is zero. But after calling bio_add_page()
it will use bi_rw.

Fox example, in __bio_add_page() it will call merge_bvec_fn().
The merge_bvec_fn of raid456 will use the bi_rw to judge the merge:

	if ((bvm->bi_rw & 1) == WRITE)
		return biovec->bv_len; /* always allow writes to be mergeable */

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/direct-io.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN fs/direct-io.c~fs-direct-ioc-set-bi_rw-when-alloc-bio fs/direct-io.c
--- a/fs/direct-io.c~fs-direct-ioc-set-bi_rw-when-alloc-bio
+++ a/fs/direct-io.c
@@ -349,6 +349,7 @@ dio_bio_alloc(struct dio *dio, struct di
 
 	bio->bi_bdev = bdev;
 	bio->bi_sector = first_sector;
+	bio->bi_rw = dio->rw;
 	if (dio->is_async)
 		bio->bi_end_io = dio_bio_end_aio;
 	else
_

Patches currently in -mm which might be from majianpeng@gmail.com are

origin.patch
linux-next.patch
fs-direct-ioc-set-bi_rw-when-alloc-bio.patch


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

* + fs-direct-ioc-set-bi_rw-when-alloc-bio.patch added to -mm tree
@ 2012-07-31 22:56 akpm
  0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2012-07-31 22:56 UTC (permalink / raw)
  To: mm-commits; +Cc: majianpeng, jmoyer, neilb, stable, viro


The patch titled
     Subject: fs/direct-io.c: set bi_rw when allocating bio
has been added to the -mm tree.  Its filename is
     fs-direct-ioc-set-bi_rw-when-alloc-bio.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: majianpeng <majianpeng@gmail.com>
Subject: fs/direct-io.c: set bi_rw when allocating bio

When calling bio_alloc(), the bi_rw is zero. But after calling bio_add_page()
it will use bi_rw.

Fox example, in __bio_add_page() it will call merge_bvec_fn().
The merge_bvec_fn of raid456 will use the bi_rw to judge the merge:

	if ((bvm->bi_rw & 1) == WRITE)
		return biovec->bv_len; /* always allow writes to be mergeable */

This bug is causing raid5 performance issues.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/direct-io.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN fs/direct-io.c~fs-direct-ioc-set-bi_rw-when-alloc-bio fs/direct-io.c
--- a/fs/direct-io.c~fs-direct-ioc-set-bi_rw-when-alloc-bio
+++ a/fs/direct-io.c
@@ -349,6 +349,7 @@ dio_bio_alloc(struct dio *dio, struct di
 
 	bio->bi_bdev = bdev;
 	bio->bi_sector = first_sector;
+	bio->bi_rw = dio->rw;
 	if (dio->is_async)
 		bio->bi_end_io = dio_bio_end_aio;
 	else
_

Patches currently in -mm which might be from majianpeng@gmail.com are

origin.patch
linux-next.patch
fs-direct-ioc-set-bi_rw-when-alloc-bio.patch


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

end of thread, other threads:[~2012-07-31 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 22:55 + fs-direct-ioc-set-bi_rw-when-alloc-bio.patch added to -mm tree akpm
2012-07-31 22:56 akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.