LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: "'Randy Dunlap'" <randy.dunlap@oracle.com>
Cc: "'Andrew Morton'" <akpm@osdl.org>, "Michael Reed" <mdr@sgi.com>,
	"'Zach Brown'" <zach.brown@oracle.com>,
	"'Chris Mason'" <chris.mason@oracle.com>,
	"Christoph Hellwig" <hch@infradead.org>,
	"linux-kernel" <linux-kernel@vger.kernel.org>,
	"Jeremy Higdon" <jeremy@sgi.com>, "David Chinner" <dgc@sgi.com>
Subject: RE: [patch] optimize o_direct on block device - v3
Date: Thu, 11 Jan 2007 13:51:04 -0800	[thread overview]
Message-ID: <000101c735ca$9782b4e0$eb34030a@amr.corp.intel.com> (raw)
In-Reply-To: <20070111134459.4b43330d.randy.dunlap@oracle.com>

Randy Dunlap wrote on Thursday, January 11, 2007 1:45 PM
> > +/* return a pge back to pvec array */
> 
> is pge just a typo or some other tla that i don't know?
> (not portland general electric or pacific gas & electric)


Typo with fat fingers. Thanks for catching it. Full patch with typo fixed.



[patch] fix blk_direct_IO bio preparation.

For large size DIO that needs multiple bio, one full page worth of data
was lost at the boundary of bio's maximum sector or segment limits.
After a bio is full and got submitted.  The outer while (nbytes) { ... }
loop will allocate a new bio and just march on to index into next page.
It just forget about the page that bio_add_page() rejected when previous
bio is full.  Fix it by put the rejected page back to pvec so we pick it
up again for the next bio.


Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>

diff -Nurp linux-2.6.20-rc4/fs/block_dev.c linux-2.6.20.ken/fs/block_dev.c
--- linux-2.6.20-rc4/fs/block_dev.c	2007-01-06 21:45:51.000000000 -0800
+++ linux-2.6.20.ken/fs/block_dev.c	2007-01-10 19:54:53.000000000 -0800
@@ -190,6 +190,12 @@ static struct page *blk_get_page(unsigne
 	return pvec->page[pvec->idx++];
 }
 
+/* return a page back to pvec array */
+static void blk_unget_page(struct page *page, struct pvec *pvec)
+{
+	pvec->page[--pvec->idx] = page;
+}
+
 static ssize_t
 blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
 		 loff_t pos, unsigned long nr_segs)
@@ -278,6 +284,8 @@ same_bio:
 				count = min(count, nbytes);
 				goto same_bio;
 			}
+		} else {
+			blk_unget_page(page, &pvec);
 		}
 
 		/* bio is ready, submit it */

  reply	other threads:[~2007-01-11 21:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-06 23:23 Chen, Kenneth W
2006-12-07 23:02 ` Zach Brown
2007-01-11 19:21 ` Michael Reed
2007-01-11 19:29   ` Andrew Morton
2007-01-11 20:43     ` Michael Reed
2007-01-11 21:36     ` Chen, Kenneth W
2007-01-11 21:44       ` Randy Dunlap
2007-01-11 21:51         ` Chen, Kenneth W [this message]
2007-01-19 18:14     ` Michael Reed
2007-01-19 21:30       ` Andrew Morton

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='000101c735ca$9782b4e0$eb34030a@amr.corp.intel.com' \
    --to=kenneth.w.chen@intel.com \
    --cc=akpm@osdl.org \
    --cc=chris.mason@oracle.com \
    --cc=dgc@sgi.com \
    --cc=hch@infradead.org \
    --cc=jeremy@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdr@sgi.com \
    --cc=randy.dunlap@oracle.com \
    --cc=zach.brown@oracle.com \
    --subject='RE: [patch] optimize o_direct on block device - v3' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).