From: Joseph Qi <joseph.qi@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] Performance issue about localalloc
Date: Sun, 13 Sep 2015 18:00:01 +0800 [thread overview]
Message-ID: <55F54921.80305@huawei.com> (raw)
In-Reply-To: <55F16831.5060702@huawei.com>
Hi Mark,
Could you please take a look at this?
And I want to change it by setting hint to res->sr_bg_blkno if it is
cluster alloc.
From my test case (block size = 4K, cluster size = 1M, localalloc
2048M), the file allocation is more contiguous than before and has much
better performance.
status = ocfs2_search_chain(ac, handle, bits_wanted, min_bits,
res, &bits_left);
if (!status) {
- hint = ocfs2_group_from_res(res);
+ if (ocfs2_is_cluster_bitmap(ac->ac_inode))
+ hint = res->sr_bg_blkno;
+ else
+ hint = ocfs2_group_from_res(res);
goto set_hint;
}
if (status < 0 && status != -ENOSPC) {
On 2015/9/10 19:23, Joseph Qi wrote:
> Hi Mark,
> I have encountered a performance issue about localalloc.
>
> ocfs2 volume information:
> block size = 4k, cluster size = 1M, mount option with localalloc=2048
>
> So in the above circumstance, gd size is 32256M. Suppose I want to
> create a normal file with size of 50G. Since the localalloc window is
> 2G, it will eventually allocate space like, 2Gfrom gd0, 2G from gd1,
> ..., and this will lead to poor performance because of the
> dis-contiguous file with large span.
>
> One way to resolve this issue is changing the mount option with
> localalloc=31104, but this will make end user confused because 31G is
> "missing" even he has only used 2M.
>
> So I wander if we can let the allocation continues with the last gd if
> it has enough space for a localalloc window. I have blamed the code
> history and found that firstly you have already designed like this but
> disabled in the commit "ocfs2: properly set and use inode group alloc
> hint". I wander why?
>
> A simply code hack is,
> static u64 ocfs2_group_from_res(struct ocfs2_suballoc_result *res)
> {
> if (res->sr_blkno == 0)
> return 0; // This will set the hint to 0
> ...
> }
>
> Am I missing something?
>
> Thanks,
> Joseph
>
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
>
>
prev parent reply other threads:[~2015-09-13 10:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-10 11:23 [Ocfs2-devel] Performance issue about localalloc Joseph Qi
2015-09-13 10:00 ` Joseph Qi [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=55F54921.80305@huawei.com \
--to=joseph.qi@huawei.com \
--cc=ocfs2-devel@oss.oracle.com \
/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