All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miao Xie <miaox@cn.fujitsu.com>
To: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 4/7] Btrfs: use a slab for ordered extents allocation
Date: Thu, 06 Sep 2012 09:08:23 +0800	[thread overview]
Message-ID: <5047F787.2080705@cn.fujitsu.com> (raw)
In-Reply-To: <20120905161619.GM17430@twin.jikos.cz>

On Wed, 5 Sep 2012 18:16:19 +0200, David Sterba wrote:
> On Wed, Aug 29, 2012 at 12:12:50PM +0800, Miao Xie wrote:
>> The ordered extent allocation is in the fast path of the IO, so use a slab
>> to improve the speed of the allocation.
> 
> Good. Size of the struct is 280, so this will fall into the size-512
> bucket, giving 8 objects per page, while own slab will pack 14 objects
> into a page.
> 
> Another benefit I see is to check for leaked objects when the
> module is removed (and the cache destroy takes place).
> 
>> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
>> ---
>>  fs/btrfs/ordered-data.c |   23 +++++++++++++++++++++--
>>  fs/btrfs/ordered-data.h |    2 ++
>>  fs/btrfs/super.c        |    9 ++++++++-
>>  3 files changed, 31 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
>> index 2eb79cc..a07ae77 100644
>> --- a/fs/btrfs/ordered-data.c
>> +++ b/fs/btrfs/ordered-data.c
>> @@ -958,3 +960,20 @@ void btrfs_add_ordered_operation(struct btrfs_trans_handle *trans,
>>  	}
>>  	spin_unlock(&root->fs_info->ordered_extent_lock);
>>  }
>> +
>> +int __init ordered_data_init(void)
>> +{
>> +	ordered_extent_cache = kmem_cache_create("ordered_extent",
> 
> Please use the 'btrfs_' prefix, ie. 'btrfs_ordered_extent'

Thanks for your review. I'll update this patch by your advice.

Regards
Miao

> 
>> +				sizeof(struct btrfs_ordered_extent), 0,
>> +				SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD,
>> +				NULL);
>> +	if (!ordered_extent_cache)
>> +		return -ENOMEM;
>> +	return 0;
>> +}
>> +
> 



      reply	other threads:[~2012-09-06  1:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-29  4:12 [PATCH 4/7] Btrfs: use a slab for ordered extents allocation Miao Xie
2012-09-05 16:16 ` David Sterba
2012-09-06  1:08   ` Miao Xie [this message]

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=5047F787.2080705@cn.fujitsu.com \
    --to=miaox@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.