xfs
[Top] [All Lists]

Re: [PATCH] [XFS] Free buffer pages array unconditionally

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] [XFS] Free buffer pages array unconditionally
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 4 Dec 2009 05:15:53 -0500
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20091202222228.GN30608@xxxxxxxxxxxxxxxx>
References: <1259734333-20581-1-git-send-email-david@xxxxxxxxxxxxx> <20091202151742.GA1263@xxxxxxxxxxxxx> <20091202222228.GN30608@xxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Thu, Dec 03, 2009 at 09:22:28AM +1100, Dave Chinner wrote:
> > kmem_free happily takes a NULL pointer, so this is unessecary.
> 
> Yes, it does, but I wanted to make sure that b_pages had been
> assigned before doing the comparison because this is now
> called unconditionally. I?ll remove the check and retest.
> 
> Hmmm - I suspect that this function needs to NULL b_pages
> in case it _xfs_buf_free_pages() is called prior to calling
> xfs_buf_free()...

Yes, at least for now.  Long term we should stop messing with the page array
on a live buffer.  The only place where we currently do that is
xfs_buf_associate_memory, which has two callers, one for the log wrap
reserver buffer, and the other in various places in log recovery for
aligned v2 logs.

For the first one we know the max number of pages we might have to deal
with so we can pass it when allocating the buffer, and for the second
one the number of pages can't be bigger than the original number of
pages for the buffer every so there's no need to do the reallocation
game at all.

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