All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <bo.li.liu@oracle.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: Enhance btrfs chunk allocation algorithm to reduce ENOSPC caused by unbalanced data/metadata allocation.
Date: Thu, 18 Dec 2014 17:23:17 +0800	[thread overview]
Message-ID: <54929D05.8040902@cn.fujitsu.com> (raw)
In-Reply-To: <20141030093941.GC26064@localhost.localdomain>


-------- Original Message --------
Subject: Re: [PATCH] btrfs: Enhance btrfs chunk allocation algorithm to 
reduce ENOSPC caused by unbalanced data/metadata allocation.
From: Liu Bo <bo.li.liu@oracle.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Date: 2014年10月30日 17:39
> On Thu, Oct 30, 2014 at 11:46:18AM +0800, Qu Wenruo wrote:
>> [snipped]
> Okay, I buy this.
>
>> Thanks,
>> Qu
>>>>> Thanks,
>>>>> Qu
>>>>>>>>> [snipped]
>>>>>>>>>       /*
>>>>>>>>> +     * Try not to occupy more than half of the unallocated space.
>>>>>>>>> +     * When run short of space and alloc all the space to
>>>>>>>>> +     * data/metadata will cause ENOSPC to be
>>>>>>>>> triggered more easily.
>>>>>>>>> +     *
>>>>>>>>> +     * And since the minimum chunk size is 16M, the
>>>>>>>>> half-half will cause
>>>>>>>>> +     * 16M allocated from 20M available space and
>>>>>>>>> reset 4M will not be
>>>>>>>>> +     * used ever. In that case(16~32M), allocate all directly.
>>>>>>>>> +     */
>>>>>>>>> +    if (total_avail_space < 32 * 1024 * 1024 &&
>>>>>>>>> +        total_avail_space > 16 * 1024 * 1024)
>>>>>>>>> +        max_chunk_size = total_avail_space;
>>>>>>>>> +    else
>>>>>>>>> +        max_chunk_size = min(total_avail_space / 2,
>>>>>>>>> max_chunk_size);
>>>>>>>>> +    max_chunk_size = min(total_avail_space / 2, max_chunk_size);
>                ^^^^^^^^
>
> Why another one?  This won't make it use all space within [16M, 32M].
>
> thanks,
> -liubo
Sorry for the later reply, I didn't notice the mail for a long time.

Yes, that's my mistake setting the size twice...
Will fix it soon.

Thanks,
Qu
>
>>>>>>>>> +
>>>>>>>>> +    /*
>>>>>>>>>        * now sort the devices by hole size / available space
>>>>>>>>>        */
>>>>>>>>>       sort(devices_info, ndevs, sizeof(struct btrfs_device_info),
>>>>>>>>> -- 
>>>>>>>>> 2.1.2
>>>>>>>>>
>>>>>>>>> -- 
>>>>>>>>> To unsubscribe from this list: send the line
>>>>>>>>> "unsubscribe linux-btrfs" in
>>>>>>>>> the body of a message to majordomo@vger.kernel.org
>>>>>>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html


      reply	other threads:[~2014-12-18  9:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23  2:37 [PATCH] btrfs: Enhance btrfs chunk allocation algorithm to reduce ENOSPC caused by unbalanced data/metadata allocation Qu Wenruo
2014-10-24 11:06 ` Liu Bo
2014-10-27  0:18   ` Qu Wenruo
2014-10-27  8:14     ` Liu Bo
2014-10-27  8:36       ` Qu Wenruo
2014-10-29 14:29         ` Liu Bo
2014-10-30  0:58           ` Qu Wenruo
2014-10-30  3:46             ` Qu Wenruo
2014-10-30  9:39               ` Liu Bo
2014-12-18  9:23                 ` Qu Wenruo [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=54929D05.8040902@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=bo.li.liu@oracle.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.