xfs
[Top] [All Lists]

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

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 18/18] xfs: stop using the page cache to back the buffer cache
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 15 Sep 2010 10:06:48 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20100914232004.GC29338@xxxxxxxxxxxxx>
References: <1284461777-1496-1-git-send-email-david@xxxxxxxxxxxxx> <1284461777-1496-19-git-send-email-david@xxxxxxxxxxxxx> <20100914232004.GC29338@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Tue, Sep 14, 2010 at 07:20:04PM -0400, Christoph Hellwig wrote:
> On Tue, Sep 14, 2010 at 08:56:17PM +1000, Dave Chinner wrote:
> > The only open question is how to best handle sub-page buffers - can we use
> > kmalloc/slab memory for sub-page sized buffers, or do we need to split up
> > pages ourselves? Worth noting is that the current code still works on 
> > sub-page
> > block size filesystems, it is just inefficient w.r.t. memory usage.
> 
> As mentioned before I think we're fine to use slab/kmalloc pages now.
> In fact using them will probably be more efficient than the current
> code, given that at least btree blocks usually won't be close to each
> other, so the old code wasted lots of memory for it, too.

Good point. I'll start working on this later today.

> 
> >     for (i = 0; i < bp->b_page_count; i++) {
> >             struct page     *page;
> >             uint            retries = 0;
> > +retry:
> > +           page = alloc_page(gfp_mask);
> >             if (unlikely(page == NULL)) {
> >                     if (flags & XBF_READ_AHEAD) {
> >                             bp->b_page_count = i;
> >                             for (i = 0; i < bp->b_page_count; i++)
> > +                                   __free_page(bp->b_pages[i]);
> >                             return -ENOMEM;
> 
> Maybe convert this to and out_free_pages goto while you're at it?

Yes, sounds reasonable. Will do.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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