xfs
[Top] [All Lists]

Re: [PATCH v2 1/3] xfs: use b_maps[] for discontiguous buffers

To: Mark Tinguely <tinguely@xxxxxxx>
Subject: Re: [PATCH v2 1/3] xfs: use b_maps[] for discontiguous buffers
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sat, 1 Dec 2012 09:21:10 +1100
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <50B8F2FC.6060501@xxxxxxx>
References: <20121128222309.109033307@.sgi.com> <20121128222622.688093599@xxxxxxx> <20121130160920.GA9873@xxxxxxxxxxxxx> <50B8F2FC.6060501@xxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Nov 30, 2012 at 11:55:08AM -0600, Mark Tinguely wrote:
> On 11/30/12 10:09, Christoph Hellwig wrote:
> >>  use_alloc_page:
> >>-   start = BBTOB(bp->b_map.bm_bn)>>  PAGE_SHIFT;
> >>-   end = (BBTOB(bp->b_map.bm_bn + bp->b_length) + PAGE_SIZE - 1)
> >>+   start = BBTOB(bp->b_maps[0].bm_bn)>>  PAGE_SHIFT;
> >>+   end = (BBTOB(bp->b_maps[0].bm_bn + bp->b_length) + PAGE_SIZE - 1)
> >
> >Btw, how is this logic supposed to work for discontiguous buffers?
> >
> >Each of them might straddle boundaries individually, so doing the
> >start/end calculation for the number of pages isn't going to be correct.
> >
> 
> eeek. yep, I will loop through and count the pages needed in each
> segment.

That's wrong - the pages must be mappable as a contiguous memory
range. That's how this code avoids copying the data from
discontiguous page ranges into a contiguous mapped memory range.
If you separate each IO into to it's own set of pages, then you have
to completely rewrite _xfs_buf_ioapply(), which AFAICT works just
fine with the page allocation that is done right now....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>