xfs
[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 18/18] xfs: stop using the page cache to back the buffer cache
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 14 Sep 2010 19:20:04 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1284461777-1496-19-git-send-email-david@xxxxxxxxxxxxx>
References: <1284461777-1496-1-git-send-email-david@xxxxxxxxxxxxx> <1284461777-1496-19-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-08-17)
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.

>       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?

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