xfs
[Top] [All Lists]

Re: [PATCH] xfs: stop using the page cache to back the buffer cache

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: stop using the page cache to back the buffer cache
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sat, 12 Mar 2011 10:02:15 +1100
Cc: xfs@xxxxxxxxxxx, chris.mason@xxxxxxxxxx
In-reply-to: <20110311101642.GA15786@xxxxxxxxxxxxx>
References: <1299719104-11961-1-git-send-email-david@xxxxxxxxxxxxx> <20110311101642.GA15786@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Mar 11, 2011 at 05:16:42AM -0500, Christoph Hellwig wrote:
> > +           if (((unsigned long)(bp->b_addr + bp->b_buffer_length - 1) &
> > +                                                           PAGE_MASK) !=
> > +               ((unsigned long)bp->b_addr & PAGE_MASK)) {
> > +                   /* b_addr spans two pages - use alloc_page instead */
> > +                   kmem_free(bp->b_addr);
> > +                   bp->b_addr = NULL;
> > +                   goto use_alloc_page;
> > +           }
> 
> Did you manage to hit this case?  If it happens with any frequency under
> real workloads we really need to find a wayto avoid the allocation to
> start with.

It's the replacement for the assert that you managed to trigger in
the previous version. The assert fired if the returned memory
spanned two pages, so this is catching and handling that case if it
ever occurs. No, I haven't sen it trip, but then again I only ever
saw the previous assert fire once and was never able to reproduce
it.

I'd prefer to leave it there as a definsive mechanism, especially if
the kernel grows a new SLxB allocator with different behaviour...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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