xfs
[Top] [All Lists]

Re: [PATCH v4 4/9] xfsrestore: mmap dirent names for faster lookups

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH v4 4/9] xfsrestore: mmap dirent names for faster lookups
From: Bill Kendall <wkendall@xxxxxxx>
Date: Mon, 29 Nov 2010 08:28:05 -0600
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20101123134818.GA31206@xxxxxxxxxxxxx>
References: <20101119183837.GA9505@xxxxxxx> <20101123134818.GA31206@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8
On 11/23/2010 07:48 AM, Christoph Hellwig wrote:
On Fri, Nov 19, 2010 at 12:38:37PM -0600, Bill Kendall wrote:
Pathname resolution in xfsrestore is about 4x faster if the file
containing dirent names ("namreg") is memory mapped.  If xfsrestore is
unable to map the file (e.g., due to virtual memory constraints)
fallback to the existing seek-and-read approach.

The file is mapped after all directory entries have been written to
the "namreg" file. If the caller tries to add additional entries after
the file has been mapped, it will be unmapped and restore will resort
back to seek-and-read lookups.

This looks much simpler indeed.  Is it intentional that the namreg file
is never unmapped any more?

There are several modules in xfsrestore which map files. None of them
currently contain a destructor/cleanup function for unmapping the files.
It would be a good change to make though.

Bill

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