* [Ocfs2-devel] what is global bitmap, block group, suballocator, etc
@ 2009-11-25 7:43 Coly Li
2009-11-25 7:59 ` Tao Ma
0 siblings, 1 reply; 4+ messages in thread
From: Coly Li @ 2009-11-25 7:43 UTC (permalink / raw)
To: ocfs2-devel
Hi list,
There are some ocfs2 terminologies that I don't understand very well. After checking the ocfs2 wiki and kernel/tools
code, I am still not sure whether I understand them correctly.
- Global bitmap
What's the usage of global bitmap? Which kind of resource allocation will set global bitmap?
- Cluster group
It seems cluster group is similar to block group of ext3/4. Does each node of the cluster has its own data/metadata
bitmap inode in every cluster group ?
- Block group
From Tiger's slide, I don't find block group. But from fs/ocfs2 code, I see block group. Is it same to cluster group ?
- Suballocator & Suballocator slot
I don't find related document explains what is suballocator and how it works. I am checking the code now, but not
clear to me yet.
I know all the answers are in the code, I spent some time on code reading already, if there is some hints, I can do it
faster :-)
Thanks in advance.
--
Coly Li
SuSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Ocfs2-devel] what is global bitmap, block group, suballocator, etc
2009-11-25 7:43 [Ocfs2-devel] what is global bitmap, block group, suballocator, etc Coly Li
@ 2009-11-25 7:59 ` Tao Ma
2009-12-01 8:22 ` Coly Li
0 siblings, 1 reply; 4+ messages in thread
From: Tao Ma @ 2009-11-25 7:59 UTC (permalink / raw)
To: ocfs2-devel
Hi Coly,
Coly Li wrote:
> Hi list,
>
> There are some ocfs2 terminologies that I don't understand very well. After checking the ocfs2 wiki and kernel/tools
> code, I am still not sure whether I understand them correctly.
>
> - Global bitmap
> What's the usage of global bitmap? Which kind of resource allocation will set global bitmap?
global bitmap is a system file which indicates the usage of clusters in
the whole volume. It is a chain file. So it has a ocfs2_chain_list in
its ocfs2_dinode.id2. And the chain_list is a chain of many groups. A
group is a range of clusters and the 1st block of a group has a bitmap
to indicate which cluster(or block, cpg is used here) is allocated or not.
>
> - Cluster group
> It seems cluster group is similar to block group of ext3/4. Does each node of the cluster has its own data/metadata
> bitmap inode in every cluster group ?
See group above.
>
> - Block group
> From Tiger's slide, I don't find block group. But from fs/ocfs2 code, I see block group. Is it same to cluster group ?
you mean ocfs2_block_group_alloc? Actually we allocates clusters from
the allocators(see ocfs2_claim_clusters) and then call
ocfs2_block_group_fill to fill it into different system
file(inode_alloc, extent_alloc).
>
> - Suballocator & Suballocator slot
> I don't find related document explains what is suballocator and how it works. I am checking the code now, but not
> clear to me yet.
suballocator is used so that when a node try to get some resource, it
will try its own suballocator first. If it can't get the resource it
wants, we have to lock the global_bitmap(there are some cases we can try
local_alloc first and if it fails, then try global_bitmap) and ask from
that(it will need a global lock which needs more time). We we the
suballocator grows, it will request a large hunk from the global bitmap
so that the next attempt can success in suballocator. There are
inode_alloc for inode, extent_alloc for extent, and local_alloc(it can
be used by extent_alloc allocation or cluster allocation).
Regards,
Tao
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Ocfs2-devel] what is global bitmap, block group, suballocator, etc
2009-11-25 7:59 ` Tao Ma
@ 2009-12-01 8:22 ` Coly Li
2009-12-01 8:47 ` Tao Ma
0 siblings, 1 reply; 4+ messages in thread
From: Coly Li @ 2009-12-01 8:22 UTC (permalink / raw)
To: ocfs2-devel
Hi Tao,
Thanks for your reply. I spent some time to read the code and understand :)
On 2009?11?25? 15:59, Tao Ma Wrote:
> Hi Coly,
>
> Coly Li wrote:
>> Hi list,
>>
>> There are some ocfs2 terminologies that I don't understand very well.
>> After checking the ocfs2 wiki and kernel/tools
>> code, I am still not sure whether I understand them correctly.
>>
>> - Global bitmap
>> What's the usage of global bitmap? Which kind of resource allocation
>> will set global bitmap?
> global bitmap is a system file which indicates the usage of clusters in
> the whole volume. It is a chain file. So it has a ocfs2_chain_list in
> its ocfs2_dinode.id2. And the chain_list is a chain of many groups. A
> group is a range of clusters and the 1st block of a group has a bitmap
> to indicate which cluster(or block, cpg is used here) is allocated or not.
What is a chain file ? Is it a file not for regular file data storage (a.k.a dinode->i_size == 0), but to record
allocation chains of an ocfs2 volume (a.k.a dinode->id2.i_chain) ?
Another question is, for each node (slot), should it have only 1 chain file ? If yes, I guess the chain number limit is
ocfs2_chain_recs_per_inode().
--
Coly Li
SuSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Ocfs2-devel] what is global bitmap, block group, suballocator, etc
2009-12-01 8:22 ` Coly Li
@ 2009-12-01 8:47 ` Tao Ma
0 siblings, 0 replies; 4+ messages in thread
From: Tao Ma @ 2009-12-01 8:47 UTC (permalink / raw)
To: ocfs2-devel
Coly Li wrote:
> Hi Tao,
>
> Thanks for your reply. I spent some time to read the code and understand :)
>
> On 2009?11?25? 15:59, Tao Ma Wrote:
>> Hi Coly,
>>
>> Coly Li wrote:
>>> Hi list,
>>>
>>> There are some ocfs2 terminologies that I don't understand very well.
>>> After checking the ocfs2 wiki and kernel/tools
>>> code, I am still not sure whether I understand them correctly.
>>>
>>> - Global bitmap
>>> What's the usage of global bitmap? Which kind of resource allocation
>>> will set global bitmap?
>> global bitmap is a system file which indicates the usage of clusters in
>> the whole volume. It is a chain file. So it has a ocfs2_chain_list in
>> its ocfs2_dinode.id2. And the chain_list is a chain of many groups. A
>> group is a range of clusters and the 1st block of a group has a bitmap
>> to indicate which cluster(or block, cpg is used here) is allocated or not.
>
> What is a chain file ? Is it a file not for regular file data storage (a.k.a dinode->i_size == 0), but to record
> allocation chains of an ocfs2 volume (a.k.a dinode->id2.i_chain) ?
yeah, it is used in system file only. So when you allocate some clusters
from the global_bitmap, you add it to your own chain file according to
the usage.
>
> Another question is, for each node (slot), should it have only 1 chain file ? If yes, I guess the chain number limit is
> ocfs2_chain_recs_per_inode().
No, you have different system files for different usage.
Please check the flag of the system file, it should have OCFS2_CHAIN_FL
set. You can also investigate it by debugfs.ocfs2.
e.g
echo 'stat //inode_alloc:0000'|debugfs.ocfs2 /dev/sdx
you can see "Chain" in the "Flags:" field.
So normally we have inode_alloc:000X for inode allocation,
extent_alloc:000X for metadata allocation,
Regards,
Tao
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-12-01 8:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 7:43 [Ocfs2-devel] what is global bitmap, block group, suballocator, etc Coly Li
2009-11-25 7:59 ` Tao Ma
2009-12-01 8:22 ` Coly Li
2009-12-01 8:47 ` Tao Ma
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.