From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Mark Tinguely <tinguely@sgi.com>, xfs@oss.sgi.com
Subject: Re: [PATCH v2 1/3] xfs: use b_maps[] for discontiguous buffers
Date: Sat, 1 Dec 2012 09:18:26 +1100 [thread overview]
Message-ID: <20121130221826.GA12955@dastard> (raw)
In-Reply-To: <20121130160920.GA9873@infradead.org>
On Fri, Nov 30, 2012 at 11:09:20AM -0500, 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.
AFAICT it is correct - the first page is always aligned to the start
of the buffer (i.e. b_offset = 0), and the end is extended to ensure
that it covers any partial tail page. e.g:
Page 0 1 2
+---------------+---------------+---------------+
map[0] |----------|
map[1] |------------|
map[2] |--------------|
|---------------bp->b_length-----------|
| |
start end
Maps are always multiples of basic blocks, so every segment boundary
aligns to something that IO can be done on, and the array of pages
always spans the entire range of the maps.
Hence I'm not sure what the problem is here, Christoph. Can you
expand on the issue?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-11-30 22:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-28 22:23 [PATCH v2 0/3] discontiguous buffer patches Mark Tinguely
2012-11-28 22:23 ` [PATCH v2 1/3] xfs: use b_maps[] for discontiguous buffers Mark Tinguely
2012-11-30 16:09 ` Christoph Hellwig
2012-11-30 17:55 ` Mark Tinguely
2012-11-30 22:21 ` Dave Chinner
2012-11-30 23:09 ` Christoph Hellwig
2012-11-30 22:18 ` Dave Chinner [this message]
2012-12-02 23:31 ` Dave Chinner
2012-11-28 22:23 ` [PATCH v2 2/3] xfs: fix the buffer log format for contiguous buffers Mark Tinguely
2012-12-02 23:46 ` Dave Chinner
2012-11-28 22:23 ` [PATCH v2 3/3] xfs: fix the multi-segment log buffer format Mark Tinguely
2012-11-30 23:14 ` Christoph Hellwig
2012-12-02 23:52 ` Dave Chinner
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=20121130221826.GA12955@dastard \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=tinguely@sgi.com \
--cc=xfs@oss.sgi.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox