From: Yu Jian <yujian@whamcloud.com>
To: Theodore Tso <tytso@MIT.EDU>
Cc: Andreas Dilger <adilger@whamcloud.com>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: Increase xattr space by allocating contiguous xattr blocks
Date: Tue, 22 Nov 2011 11:32:19 +0800 [thread overview]
Message-ID: <4ECB17C3.7020601@whamcloud.com> (raw)
In-Reply-To: <401CC4FF-8955-4D5F-B620-5C39AF566123@mit.edu>
On 11/21/11 11:08 PM, Theodore Tso wrote:
>
> On Nov 21, 2011, at 7:22 AM, Yu Jian wrote:
>
>> Now, I've the same question as that in the above thread:
>> In xattr.{h,c}, all of the macros and functions assume the xattr space is contiguous with entries growing downwards and values growing upwards (aligned to the end of the space). Especially, the create, replace, remove and shift operations of xattrs are all performed inside a contiguous buffer. This is no problem with in-inode xattr space and single external xattr block which is associated with one block buffer. But for multiple xattr blocks, since the data of them would be read into different block buffers, which are not contiguous, most of the existing macros and functions need to be changed. Is this way acceptable?
>
> It depends on how cleanly you can implement it, and if you can create some better xfstests to exercise xattr operations --- especially if deleting xattrs will cause existing xattrs to get moved around for better packing, we need to be absolutely sure that the code is completely reliable and doesn't end up corrupting some xattr other than the one that is being inserted, deleted, or replaced.
>
> Currently, one of the primary xattr tests that is in xfstests (#62) doesn't work on ext4 at all, since it assumes that files are returned by readdir in file creation order for newly created directory. So the lack of test coverage is something that would have to be addressed if we want to do major surgery to the xattr code. I'd suggest creating a new series of test from scratch, since I don't believe test #62 can be easily reworked so that it will work under ext4.
>
>> In order to make most of the codes remain as-is, we could allocate a contiguous large buffer (up to 64kB in size) to handle all of the data. However, we have to memcpy the data from block buffers to the large buffer, and after the data are changed, we need memcpy the data back to block buffers to make the data written into the block device. Is this way reasonable?
>
> This is no doubt the simpler way to go. The downsides of doing this are pretty obvious: overhead to do the copy, the extra memory pressure, the need to do the memory allocation (vmalloc is slow, since it requires messing with page tables; if you need to count on contiguous free pages, you may end up stalling while you wait for the pressure on the mm defrag routines). Also, if there are people who want to do large amounts of xattr operations on PCIe attached flash, the extra overhead of doing the copy will definitely show up on the benchmarks.
>
> The first is approach is no doubt he better one, but it at the same time it would be tricker to implement. If it would be totally up to me, I'd suggest the first approach, but it would need to be approached with care (and a lot of testing).
Thanks Ted for the suggestions. I'd use the first approach.
>
> Regards,
>
> -- Ted
>
>
--
Best regards,
Yu Jian
next prev parent reply other threads:[~2011-11-22 3:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4EC10664.1080501@tuxadero.com>
[not found] ` <CAO47_-9nfO32nwOAQMVdqw6iWGWK+FWb+MD=WeOz_vr4YrrKmw@mail.gmail.com>
2011-11-15 14:22 ` ceph and ext4 Ted Ts'o
2011-11-15 16:43 ` Andreas Dilger
2011-11-15 18:43 ` Yehuda Sadeh Weinraub
2011-11-21 12:22 ` Increase xattr space by allocating contiguous xattr blocks Yu Jian
2011-11-21 15:08 ` Theodore Tso
2011-11-22 3:32 ` Yu Jian [this message]
2011-11-22 4:53 ` Eric Sandeen
2011-11-23 17:09 ` [PATCH] xfstests: Sort recursive getfattr output in 062 Eric Sandeen
2011-11-28 11:03 ` Christoph Hellwig
2012-01-25 21:38 ` [PATCH V2] " Eric Sandeen
2012-01-27 10:53 ` Christoph Hellwig
2011-12-08 22:59 ` ceph and ext4 Christian Brunner
2011-12-09 22:24 ` Andreas Dilger
2012-02-12 4:05 ` Yehuda Sadeh Weinraub
2012-02-12 17:18 ` Andreas Dilger
2012-02-12 19:50 ` Yehuda Sadeh Weinraub
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ECB17C3.7020601@whamcloud.com \
--to=yujian@whamcloud.com \
--cc=adilger@whamcloud.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@MIT.EDU \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).