Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1672035 > unrolled thread
| Started by | Andreas Dilger <adilger@dilger.ca> |
|---|---|
| First post | 2017-06-21 23:20 +0200 |
| Last post | 2017-06-21 23:50 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v5 27/28] ext4: xattr inode deduplication Andreas Dilger <adilger@dilger.ca> - 2017-06-21 23:20 +0200
Re: [PATCH v5 27/28] ext4: xattr inode deduplication Tahsin Erdogan <tahsin@google.com> - 2017-06-21 23:40 +0200
Re: [PATCH v5 27/28] ext4: xattr inode deduplication Andreas Dilger <adilger@dilger.ca> - 2017-06-21 23:50 +0200
| From | Andreas Dilger <adilger@dilger.ca> |
|---|---|
| Date | 2017-06-21 23:20 +0200 |
| Subject | Re: [PATCH v5 27/28] ext4: xattr inode deduplication |
| Message-ID | <tUVcD-3k9-51@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
On Jun 20, 2017, at 3:07 AM, Tahsin Erdogan <tahsin@google.com> wrote:
>
> Ext4 now supports xattr values that are up to 64k in size (vfs limit).
> Large xattr values are stored in external inodes each one holding a
> single value. Once written the data blocks of these inodes are immutable.
>
> The real world use cases are expected to have a lot of value duplication
> such as inherited acls etc. To reduce data duplication on disk, this patch
> implements a deduplicator that allows sharing of xattr inodes.
>
> The deduplication is based on an in-memory hash lookup that is a best
> effort sharing scheme. When a xattr inode is read from disk (i.e.
> getxattr() call), its crc32c hash is added to a hash table. Before
> creating a new xattr inode for a value being set, the hash table is
> checked to see if an existing inode holds an identical value. If such an
> inode is found, the ref count on that inode is incremented. On value
> removal the ref count is decremented and if it reaches zero the inode is
> deleted.
>
> The quota charging for such inodes is manually managed. Every reference
> holder is charged the full size as if there was no sharing happening.
> This is consistent with how xattr blocks are also charged.
>
> Signed-off-by: Tahsin Erdogan <tahsin@google.com>
> ---
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index d79d8d7bee88..59e9488c4876 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -1517,6 +1517,7 @@ struct ext4_sb_info {
> long s_es_nr_inode;
> struct ext4_es_stats s_es_stats;
> struct mb_cache *s_mb_cache;
> + struct mb_cache *s_ea_inode_cache;
These names should be consistent, like "s_ea_block_cache".
> diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> index 0484df8dadd1..d7e60358ec91 100644
> --- a/fs/ext4/xattr.c
> +++ b/fs/ext4/xattr.c
> @@ -108,6 +108,9 @@ const struct xattr_handler *ext4_xattr_handlers[] = {
> #define EXT4_GET_MB_CACHE(inode) (((struct ext4_sb_info *) \
> inode->i_sb->s_fs_info)->s_mb_cache)
>
> +#define EA_INODE_CACHE(inode) (((struct ext4_sb_info *) \
> + inode->i_sb->s_fs_info)->s_ea_inode_cache)
These names should be consistent, like EXT4_GET_EA_CACHE() or maybe
EXT4_GET_EA_BLOCK_CACHE() and EXT4_GET_EA_INODE_CACHE().
The rest of the changes look reasonable.
Cheers, Andreas
[toc] | [next] | [standalone]
| From | Tahsin Erdogan <tahsin@google.com> |
|---|---|
| Date | 2017-06-21 23:40 +0200 |
| Message-ID | <tUVvY-3sm-35@gated-at.bofh.it> |
| In reply to | #1672035 |
> Tashin, we are already using the "no_mbcache" option name, so would prefer > to keep that working. It would be OK to accept both option names to mean > the same thing, and only document the "nombcache" option. Updated patch to accept both nombcache and no_mbcache. >> struct mb_cache *s_mb_cache; >> + struct mb_cache *s_ea_inode_cache; > > These names should be consistent, like "s_ea_block_cache". Yes, I will rename this to s_ea_block_cache. >> #define EXT4_GET_MB_CACHE(inode) (((struct ext4_sb_info *) \ >> inode->i_sb->s_fs_info)->s_mb_cache) >> >> +#define EA_INODE_CACHE(inode) (((struct ext4_sb_info *) \ >> + inode->i_sb->s_fs_info)->s_ea_inode_cache) > > These names should be consistent, like EXT4_GET_EA_CACHE() or maybe > EXT4_GET_EA_BLOCK_CACHE() and EXT4_GET_EA_INODE_CACHE(). How about EA_BLOCK_CACHE() and EA_INODE_CACHE() to keep them short?
[toc] | [prev] | [next] | [standalone]
| From | Andreas Dilger <adilger@dilger.ca> |
|---|---|
| Date | 2017-06-21 23:50 +0200 |
| Message-ID | <tUVFD-3xy-1@gated-at.bofh.it> |
| In reply to | #1672082 |
[Multipart message — attachments visible in raw view] — view raw
> On Jun 21, 2017, at 3:34 PM, Tahsin Erdogan <tahsin@google.com> wrote: > >> Tashin, we are already using the "no_mbcache" option name, so would prefer >> to keep that working. It would be OK to accept both option names to mean >> the same thing, and only document the "nombcache" option. > > Updated patch to accept both nombcache and no_mbcache. > >>> struct mb_cache *s_mb_cache; >>> + struct mb_cache *s_ea_inode_cache; >> >> These names should be consistent, like "s_ea_block_cache". > > Yes, I will rename this to s_ea_block_cache. > >>> #define EXT4_GET_MB_CACHE(inode) (((struct ext4_sb_info *) \ >>> inode->i_sb->s_fs_info)->s_mb_cache) >>> >>> +#define EA_INODE_CACHE(inode) (((struct ext4_sb_info *) \ >>> + inode->i_sb->s_fs_info)->s_ea_inode_cache) >> >> These names should be consistent, like EXT4_GET_EA_CACHE() or maybe >> EXT4_GET_EA_BLOCK_CACHE() and EXT4_GET_EA_INODE_CACHE(). > > How about EA_BLOCK_CACHE() and EA_INODE_CACHE() to keep them short? Sure, that is fine since these macros are local to xattr.c. Cheers, Andreas
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web