From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/3] ocfs2: Optimize inode allocation by remembering last group.
Date: Wed, 07 Jan 2009 08:29:19 +0800 [thread overview]
Message-ID: <4963F75F.30309@oracle.com> (raw)
In-Reply-To: <20090106190245.GQ17410@wotan.suse.de>
Mark Fasheh wrote:
>> @@ -1602,6 +1606,21 @@ int ocfs2_claim_new_inode(struct ocfs2_super *osb,
>> BUG_ON(ac->ac_bits_wanted != 1);
>> BUG_ON(ac->ac_which != OCFS2_AC_USE_INODE);
>>
>> + /*
>> + * Try to allocate inodes from some specific group.
>> + *
>> + * If the parent dir has recorded the last group used in allocation,
>> + * cool, use it. Otherwise if we try to allocate new inode from the
>> + * same slot the parent dir belongs to, use the same chunk.
>> + */
>> + if (OCFS2_I(dir)->ip_last_used_group &&
>> + OCFS2_I(dir)->ip_last_used_slot == ac->ac_alloc_slot)
>> + ac->ac_last_group = OCFS2_I(dir)->ip_last_used_group;
>> + else if (le16_to_cpu(parent_fe->i_suballoc_slot) ==
>> + ac->ac_alloc_slot)
>> + ac->ac_last_group = le64_to_cpu(parent_fe->i_blkno) -
>> + le16_to_cpu(parent_fe->i_suballoc_bit);
>
> You should use ocfs2_which_suballoc_group() here, instead of open coding the
> math to get ac_last_group.
yeah, you are right. It looks that I am still not familiar with all
those helpful functions. ;)
>
> Also, would it be possible for us to put this block in it's own function so
> that it's easier to play with the logic in the future?
No problem. I will wrap it with a function.
>
>
> One last thing - can you add to the comment:
>
> *
> * We are very careful here to avoid the mistake of setting ac_last_group to
> * a group descriptor from a different (unlocked) slot.
> */
OK, thanks.
Regards,
Tao
next prev parent reply other threads:[~2009-01-07 0:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-28 6:49 [Ocfs2-devel] [PATCH 0/3] ocfs2: Inode Allocation Strategy Improvement Tao Ma
2008-11-27 22:58 ` [Ocfs2-devel] [PATCH 1/3] ocfs2: Optimize inode allocation by remembering last group Tao Ma
2009-01-06 19:02 ` Mark Fasheh
2009-01-07 0:29 ` Tao Ma [this message]
2008-11-27 22:58 ` [Ocfs2-devel] [PATCH 2/3] ocfs2: Allocate inode groups from global_bitmap Tao Ma
2009-01-06 19:47 ` Mark Fasheh
2008-11-27 22:58 ` [Ocfs2-devel] [PATCH 3/3] ocfs2: Optimize inode group allocation by recording last used group Tao Ma
2009-01-06 21:23 ` Mark Fasheh
2009-01-07 0:49 ` Tao Ma
2009-01-07 1:03 ` Mark Fasheh
2009-01-06 21:41 ` [Ocfs2-devel] [PATCH 0/3] ocfs2: Inode Allocation Strategy Improvement Mark Fasheh
2009-01-07 0:27 ` Tao Ma
-- strict thread matches above, loose matches on Subject: below --
2009-01-15 21:58 [Ocfs2-devel] [PATCH 0/3] ocfs2: Inode Allocation Strategy Improvement.v2 Tao Ma
2009-01-15 22:00 ` [Ocfs2-devel] [PATCH 1/3] ocfs2: Optimize inode allocation by remembering last group Tao Ma
2009-02-24 16:53 Tao Ma
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=4963F75F.30309@oracle.com \
--to=tao.ma@oracle.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 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.