ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
From: tristan <tristan.ye@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 2/2] Ocfs2: Add a new code 'OCFS2_INFO_FREEFRAG' for o2info ioctl.
Date: Thu, 04 Nov 2010 15:05:14 +0800	[thread overview]
Message-ID: <4CD25B2A.7040909@oracle.com> (raw)
In-Reply-To: <20101104063221.GC22663@mail.oracle.com>

Joel Becker wrote:
> On Thu, Nov 04, 2010 at 10:56:09AM +0800, tristan wrote:
>> While the user-specified chunksize is brand-new concept here;), it 
>> splits the whole bitmap from chunk to chunk sequentially.
>> and then to see how many of this sequential/fixed-size chunks are free. 
>> it sounds like the concept of page frame for main memory.
>> When a user is doing I/Os in a very size-fixed fashion, they may be 
>> happy to see how many chunks were fully free there.
>
> 	Let me see if I understand this.  If the user specified a
> chunksize of 64M and you find a free extent of 640M, your free list will
> say, "I've got one free extent of more than 128M," while your chunksize
> logic also reports, "I've got ten 64M chunks?"  Is that right?
Hmmm...

    Not exactly, while your first guess is right, my free list do says: 
"I've got
one free extent of more than 128M", while chunksize logic may not report 
10 free
chunks in this case, 10 free chunks will only be reported when the start 
of this
640M extent was fully 64M aligned. otherwise, 9 free chunks get reported.

So the essence of 'user-specified-chunksize' logic is splitting the 
whole bitmap
into chunks with fixed size. then check if these chunks are fully free 
from chunk to
chunk sequentially, a counter called 'free_chunks' will only be 
increased when all
clusters in this chunk were free. it sounds like a situation when we 
specify the
pagesize for a page frame, then counting the free pages in the physical 
memory.
it's all about aligned/fixed-size/sequential things.

While another counter called 'real_free_chunks' is dedicated to counting 
the number
of all free chunks we detected when scaning the whole bitmap from 
cluster to cluster.

Take following figure as example, say user specified the chunksize as 4 
clusters, and
the total size of global bitmap is 16 clusters. '0' denotes free 
cluster, while '1'
stands for used one.

#1 chunk   #2 chunk   #3 chunk    #4 chunk
1100       0010       0000        1100

 From above case, we found 3 real free chunks, they are:

1st free_chunk_size = 4

2nd free_chunk_size = 5

3rd free_chunk_size = 2

Therefore, real_free_chunks = 3

While for the 'user-specified-chunksize' logic, we have 4 
chunks(chunksize = 4), and only
one(#3 chunk) was free.

Does it make sense?

>
>>>> +		status = ocfs2_read_inode_block(gb_inode, &bh);
>>>> +		if (status < 0) {
>>>> +			mlog_errno(status);
>>>> +			goto bail;
>>>> +		}
>>>> +	}
>>> 	Same thoughts about ocfs2_ilookup() here.
>> Why we need to think about ocfs2_ilookup? since we're just trying to get 
>> a inode block here, not a cached VFS inode.
>
> 	If you already have the blkno, you're not igetting, and that's
> fine.  My bad.
>
> Joel
>

  reply	other threads:[~2010-11-04  7:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-03 11:02 [Ocfs2-devel] [PATCH 1/2] Ocfs2: Add a new code 'OCFS2_INFO_FREEINODE' for o2info ioctl Tristan Ye
2010-11-03 11:02 ` [Ocfs2-devel] [PATCH 2/2] Ocfs2: Add a new code 'OCFS2_INFO_FREEFRAG' " Tristan Ye
2010-11-04  1:29   ` Joel Becker
2010-11-04  2:56     ` tristan
2010-11-04  4:47       ` tristan
2010-11-04  6:32       ` Joel Becker
2010-11-04  7:05         ` tristan [this message]
2010-12-07  0:46           ` Joel Becker
2010-11-04  1:18 ` [Ocfs2-devel] [PATCH 1/2] Ocfs2: Add a new code 'OCFS2_INFO_FREEINODE' " Joel Becker
2010-11-04  2:27   ` tristan
2010-11-04  6:28     ` Joel Becker
2010-11-04  8:10       ` tristan
2010-11-04 21:24         ` Joel Becker

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=4CD25B2A.7040909@oracle.com \
    --to=tristan.ye@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).