Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751524AbXAKVvG (ORCPT ); Thu, 11 Jan 2007 16:51:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751518AbXAKVvG (ORCPT ); Thu, 11 Jan 2007 16:51:06 -0500 Received: from mga03.intel.com ([143.182.124.21]:32931 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751517AbXAKVvE (ORCPT ); Thu, 11 Jan 2007 16:51:04 -0500 X-ExtLoop1: 1 X-IronPort-AV: i="4.13,175,1167638400"; d="scan'208"; a="167935837:sNHT20213319" From: "Chen, Kenneth W" To: "'Randy Dunlap'" Cc: "'Andrew Morton'" , "Michael Reed" , "'Zach Brown'" , "'Chris Mason'" , "Christoph Hellwig" , "linux-kernel" , "Jeremy Higdon" , "David Chinner" Subject: RE: [patch] optimize o_direct on block device - v3 Date: Thu, 11 Jan 2007 13:51:04 -0800 Message-ID: <000101c735ca$9782b4e0$eb34030a@amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acc1yewxPqzMuM/aRSOyn/Fxfz5pIgAABm1Q In-Reply-To: <20070111134459.4b43330d.randy.dunlap@oracle.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1869 Lines: 54 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 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 */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/