linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
To: Ryusuke Konishi
	<konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
Cc: linux-nilfs <linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Clemens Eisserer
	<linuxhippy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] nilfs2: implement calculation of free inodes count
Date: Tue, 07 May 2013 16:49:37 +0400	[thread overview]
Message-ID: <1367930977.2216.34.camel@slavad-ubuntu> (raw)
In-Reply-To: <CAKFNMo=mnO=kTVWySGLYTC1o8A3uavEo6VhtthgT_kJhN+0Zfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Ryusuke,

On Mon, 2013-05-06 at 23:07 +0900, Ryusuke Konishi wrote:

[snip]
> I agree to use count of descriptor blocks of ifile to
> calculate the approximate value of the total file nodes.
> 
> Here are my comments on the patch:
> 
> (1) Consider using nilfs_bmap_last_key()  instead of repeating read
>      of descriptor blocks to decide new desc_blocks count.
>      The current logic may incur many device read accesses
>      even if it is updated in a stepwise fashion with
>      NILFS_IFILE_I(ifile)->mi.mi_desc_blocks_count.
> 

Maybe I misunderstand something but I think that nilfs_bmap_last_key()
can be less efficient solution. As I understand, descriptor block with 4
KB in size can describe 1024 groups. Every group can describe 32768
inodes. As a result, we can describe 32768 * 1024 = 33554432 inodes by
means of one descriptor block. So, the most frequent use-case will be
calculation with 1 descriptor block, from my point of view. Yes, I agree
that it is possible not read mi_desc_blocks_count in the beginning of
nilfs_count_free_inodes() but to use simply 1 as constant value. But,
anyway, even if we need to define a real count of descriptor blocks then
it makes only once (if we exhaust descriptor block capacity or after
mount in the case of presence of several descriptor blocks). This
counted value is saved in mi_desc_blocks_count and is used in further
calculations by means of reading mi_desc_blocks_count during exhausting
of next 33554432 inodes count.

Do you mean that nilfs_bmap_last_key() can initiate lesser read requests
as my way of using nilfs_palloc_get_desc_block() call?

> (2) Do not use __statfs_word type for local variables or arguments of
>      functions.  I think an integer type such as u64 should be used
>      instead.
> 

Ok. I agree.

> (3) Consider moving the main part of nilfs_count_free_inodes()
>      function to alloc.c, for example, as a function like:
> 
>      int nilfs_palloc_count_max_entries(struct inode *inode, u64 nentries,
>                                                         u64 *nmaxentries);
> 
>      Then, nilfs_palloc_groups_per_desc_block() and
>      nilfs_palloc_groups_count() do not need to be moved,
>      and nilfs_root argument becomes eliminable from the routine
>      added to ifile.c.
> 

Ok. I'll do it.

> (4) Please consider the name convention of functions in ifile.c.
>      The ifile.c includes routines related to ifile inode,
>      and all its functions have the same name convention (i.e.
>      nilfs_ifile_xxxx() ).
> 

Ok. I agree.

> (5) nilfs_count_free_inodes() may return -ERANGE.
>      (It's OK if inode_count is given as an argument of the function.)
>      But, nilfs_statfs() should not return -ERANGE as-is.
> 
>      In that case, I think nilfs_statfs() should output a warning
>      message and ignore the error code.
> 

Currently, it is processed returned error of nilfs_count_free_blocks()
in nilfs_statfs(). Yes, nilfs_count_free_blocks() doesn't return any
error really. But, potentially, nilfs_statfs() can return error from
this method. So, as I understand, you suggest simply to warn in
nilfs_statfs() about errors in called methods and doesn't return these
errors from it. Am I correct?

With the best regards,
Vyacheslav Dubeyko.

> Regards,
> Ryusuke Konishi
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-05-07 12:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-03 13:12 [PATCH] nilfs2: implement calculation of free inodes count Vyacheslav Dubeyko
     [not found] ` <1367586746.5050.4.camel-dzAnj6fV1RxGeWtTaGDT1UEK6ufn8VP3@public.gmane.org>
2013-05-06 14:07   ` Ryusuke Konishi
     [not found]     ` <CAKFNMo=mnO=kTVWySGLYTC1o8A3uavEo6VhtthgT_kJhN+0Zfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-07 12:49       ` Vyacheslav Dubeyko [this message]
2013-05-07 14:38         ` Ryusuke Konishi
     [not found]           ` <20130507.233850.160073573.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2013-05-07 15:17             ` Ryusuke Konishi

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=1367930977.2216.34.camel@slavad-ubuntu \
    --to=slava-yeenwd64clxbdgjk7y7tuq@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linuxhippy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 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).