Linux NILFS development
 help / color / mirror / Atom feed
From: Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org>
To: admin-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org
Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: cleaner: run one cleaning pass based on minimum free space
Date: Wed, 07 Apr 2010 01:06:09 +0900 (JST)	[thread overview]
Message-ID: <20100407.010609.179957904.ryusuke@osrg.net> (raw)
In-Reply-To: <4BB9E726.8020407-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>

Hi,
On Mon, 05 Apr 2010 15:35:34 +0200, David Arendt <admin-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org> wrote:
> Hi,
> 
> here is the patch
> 
> Thanks in advance
> Bye,
> David Arendt

Thanks.

Looks functionally fine. Just a matter of coding style:

The following part of cleaner loop looks bloated.  I think it's a good
opportunity to divide it from the loop.

Also, the length of their lines looks too long.  It's preferable if
they're naturally wrapped within 80-columns.  This is not a must
especially for userland tools, however kernel developers often prefer
this conventional coding rule.  Separating the routine would make this
easy.

                if (cleanerd->c_config.cf_min_clean_segments > 0) {
---> from
                        if (cleanerd->c_running) {
                                if (sustat.ss_ncleansegs > cleanerd->c_config.c\
f_max_clean_segments + r_segments) {
                                        nilfs_cleanerd_clean_check_pause(cleane\
rd, &timeout);
                                        goto sleep;
                                }
                        }
                        else {
                                if (sustat.ss_ncleansegs < cleanerd->c_config.c\
f_min_clean_segments + r_segments)
                                        nilfs_cleanerd_clean_check_resume(clean\
erd);
                                else
                                        goto sleep;
                        }

                        if (sustat.ss_ncleansegs < cleanerd->c_config.cf_min_cl\
ean_segments + r_segments) {
                                cleanerd->c_ncleansegs = cleanerd->c_config.cf_\
mc_nsegments_per_clean;
                                cleanerd->c_cleaning_interval = cleanerd->c_con\
fig.cf_mc_cleaning_interval;
                        }
                        else {
                                cleanerd->c_ncleansegs = cleanerd->c_config.cf_\
nsegments_per_clean;
                                cleanerd->c_cleaning_interval = cleanerd->c_con\
fig.cf_cleaning_interval;
                        }
<---- to
                }

With regards,
Ryusuke Konishi


> On 04/05/10 13:34, Ryusuke Konishi wrote:
> > Hi,
> > On Mon, 05 Apr 2010 09:50:11 +0200, David Arendt <admin-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org> wrote:
> >   
> >> Hi,
> >>
> >> Actually I run with min_clean_segments at 250 and found that to be a
> >> good value. However for example for a 2 gbyte usb key, this value would
> >> not work at all, therefor I find it a good idea to set the default at
> >> 10% as it would be more general for any device size as lots of people
> >> simply try the defaults without changing configuration files.
> >>     
> > Ok, let's start with the 10% min_clean_segments for the default
> > values.
> >
> >   
> >> I really like your idea with having a second set of
> >> nsegments_per_clean and cleaning_interval_parameters for <
> >> min_clean_segments. I am wondering if adaptive optimization will be
> >> good, as I think different people will expect different behavior.
> >> Someones might prefer the system using 100% io usage for cleaning
> >> and the disk not getting full. Other ones might prefer the disk
> >> getting full and using less io usage.
> >>     
> > Well, that's true.  Netbook users would prefer suspending the cleaner
> > wherever possible to avoid their SSD worn out. Meanwhile, NAS users
> > would expect it to operate safely to avoid trouble.
> >
> > For the present, let's try to handle the disk full issue by adding a
> > few parameters effectively.
> >
> >   
> >> Therefor I think it would add a lot of parameters to the
> >> configuration file for giving people the ability to tune it
> >> correctly, and this would possibly complicate the configuration to
> >> much.
> >>     
> >   
> >> If you decide for the second set of nsegments_per_clean and
> >> cleaning_interval_parameters, please tell me if I should implement it or
> >> if you will implement it, not that we are working on the same
> >> functionality at the same time.
> >>     
> > I'll do the change of default values.  And will give over to you for
> > this extension ;)
> >
> >   
> >> I think good names might be
> >>
> >> mc_nsegments_per_clean and
> >> mc_cleaning_interval
> >>
> >> as this would be compatible with the current indentation in
> >> nilfs_cleanerd.conf.
> >>     
> > All right.
> >  
> >   
> >> What would you take as default values ? As you always told that it would
> >> be preferable to reduce cleaning_interval instead of increasing
> >> nsegments_per_clean
> >>     
> > Yes, adjusting mc_cleaning_interval should come before increasing
> > mc_nsegments_per_clean.  My image is, for example, as follows:
> >
> >   mc_cleaning_interval  1 or 2
> >   mc_nsegments_per_clean  2 ~ 4 (as needed)
> >
> >   
> >> would you set cleaning interval to 0 in this case
> >> causing permanent cleaning and leave nsegements_per_clean at or which
> >> values would you choose ?
> >>     
> > The permanent cleaning may spoil responsiveness of the system.  I
> > don't know.  Seems that we need some test.
> >
> > Thanks,
> > Ryusuke Konishi
> >
> >   
> >> On 04/05/10 05:02, Ryusuke Konishi wrote:
> >>     
> >>> Hi!
> >>> On Mon, 29 Mar 2010 16:39:02 +0900 (JST), Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org> wrote:
> >>>   
> >>>       
> >>>> On Mon, 29 Mar 2010 06:35:27 +0200, David Arendt <admin-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org> wrote:
> >>>>     
> >>>>         
> >>>>> Hi,
> >>>>>
> >>>>> here the changes
> >>>>>
> >>>>> Thank in advance,
> >>>>> David Arendt
> >>>>>       
> >>>>>           
> >>>> Looks fine to me.  Will apply later.
> >>>>
> >>>> Thanks for your quick work.
> >>>>
> >>>> Ryusuke Konishi
> >>>>     
> >>>>         
> >>> I enhanced your change so that min_clean_segments and
> >>> max_clean_segments can be specified with a ratio (%) or an absolute
> >>> value (MB, GB, and so on) of capacity.
> >>>
> >>> The change is available on the head of util's git repo.
> >>>
> >>> Now, my question is how we should set the default value of these
> >>> parameters.  During test, I got disk full several times, and I feel
> >>> min_free_segments = 100 is a bit tight.
> >>>
> >>> Of course this depends on the usage of each, but I think that the
> >>> default values are desirable to have some generality (when possible).
> >>>
> >>> The following setting is my current idea for this.  How does it look?
> >>>
> >>>  min_clean_segments      10%
> >>>  max_clean_segments      20%
> >>>  clean_check_interval    10
> >>>
> >>> I also feel GC speed should be accelerated than now while the
> >>> filesystem is close to disk full.  One simple method is adding
> >>> optional nsegments_per_clean and cleaning_interval parameters for <
> >>> min_clean_segments.  Or, some sort of adaptive acceleration should be
> >>> applied.
> >>>
> >>> I'm planning to make the next util release after this settles down.
> >>>
> >>> Any idea?
> >>>
> >>> Thanks,
> >>> 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:[~2010-04-06 16:06 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 13:00 cleaner: run one cleaning pass based on minimum free space admin-/LHdS3kC8BfYtjvyW6yDsg
     [not found] ` <hSSjxhQnnRB5.kxy725KN-GG6YVgmNXeLOQU1ULcgDhA@public.gmane.org>
2010-03-14 14:28   ` Ryusuke Konishi
     [not found]     ` <20100314.232838.05854811.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-03-14 23:03       ` David Arendt
     [not found]         ` <4B9D6B51.5010202-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-15 15:58           ` Ryusuke Konishi
     [not found]             ` <20100316.005815.140047502.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-03-15 17:09               ` David Arendt
     [not found]                 ` <4B9E69D2.4030803-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-17 17:26                   ` Ryusuke Konishi
2010-03-15 21:24               ` David Arendt
     [not found]                 ` <4B9EA58C.1080402-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-17 18:11                   ` Ryusuke Konishi
     [not found]                     ` <20100318.031108.204325310.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-03-17 19:04                       ` David Arendt
2010-03-24  5:35                       ` David Arendt
     [not found]                         ` <4BA9A484.20809-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-27 17:48                           ` Ryusuke Konishi
     [not found]                             ` <20100328.024853.37589748.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-03-27 18:32                               ` David Arendt
2010-03-27 20:00                               ` David Arendt
     [not found]                                 ` <4BAE63F4.1040404-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-28  1:55                                   ` Ryusuke Konishi
     [not found]                                     ` <20100328.105542.258871713.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-03-28 12:17                                       ` David Arendt
     [not found]                                         ` <4BAF48BC.8060505-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-28 15:26                                           ` Ryusuke Konishi
     [not found]                                             ` <20100329.002619.67908494.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-03-28 21:52                                               ` David Arendt
     [not found]                                                 ` <4BAFCFB4.5050401-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-29  3:59                                                   ` Ryusuke Konishi
     [not found]                                                     ` <20100329.125908.56566467.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-03-29  4:35                                                       ` David Arendt
     [not found]                                                         ` <4BB02E0F.90001-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-29  7:39                                                           ` Ryusuke Konishi
     [not found]                                                             ` <20100329.163902.263795283.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-05  3:02                                                               ` Ryusuke Konishi
     [not found]                                                                 ` <20100405.120226.98047309.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-05  7:50                                                                   ` David Arendt
     [not found]                                                                     ` <4BB99633.1030701-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-04-05 11:34                                                                       ` Ryusuke Konishi
     [not found]                                                                         ` <20100405.203450.56374807.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-05 13:35                                                                           ` David Arendt
     [not found]                                                                             ` <4BB9E726.8020407-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-04-06 16:06                                                                               ` Ryusuke Konishi [this message]
     [not found]                                                                                 ` <20100407.010609.179957904.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-06 17:41                                                                                   ` David Arendt
     [not found]                                                                                     ` <4BBB724D.6040207-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-04-06 18:04                                                                                       ` Ryusuke Konishi
     [not found]                                                                                         ` <20100407.030446.52169610.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-07 10:39                                                                                           ` admin-/LHdS3kC8BfYtjvyW6yDsg
     [not found]                                                                                             ` <0f70f9c8a2d58971d6d6af5104c73066.squirrel-YfwCgBv0H3oBXFe83j6qeQ@public.gmane.org>
2010-04-08  5:12                                                                                               ` Ryusuke Konishi
     [not found]                                                                                                 ` <20100408.141218.179775797.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-08 10:54                                                                                                   ` admin-/LHdS3kC8BfYtjvyW6yDsg
2010-04-06 16:12                                                                           ` Ryusuke Konishi
     [not found]                                                                     ` <y2gee5afd761004050430gd8c60707s9505a0d680345fe6@mail.gmail.com>
     [not found]                                                                       ` <y2gee5afd761004050430gd8c60707s9505a0d680345fe6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-05 12:35                                                                         ` Jan de Kruyf
     [not found]                                                                           ` <l2wee5afd761004050535l6214e37dja6f20737865dd856-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-06 17:56                                                                             ` Ryusuke Konishi
2010-03-16 11:17               ` admin-/LHdS3kC8BfYtjvyW6yDsg
     [not found]                 ` <08886d8962faeee94a5ab900a2a78ad2.squirrel-YfwCgBv0H3oBXFe83j6qeQ@public.gmane.org>
2010-03-17 18:32                   ` Ryusuke Konishi
     [not found]                     ` <20100318.033237.203922438.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-03-17 19:12                       ` David Arendt
  -- strict thread matches above, loose matches on Subject: below --
2010-03-13 20:49 David Arendt
     [not found] ` <4B9BFA67.1010501-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-14  5:26   ` Ryusuke Konishi
     [not found]     ` <20100314.142634.172547823.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-03-14  8:47       ` David Arendt
     [not found]         ` <4B9CA2BB.6000907-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org>
2010-03-14 11:59           ` 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=20100407.010609.179957904.ryusuke@osrg.net \
    --to=ryusuke-sg5x7nla6pw@public.gmane.org \
    --cc=admin-/LHdS3kC8BfYtjvyW6yDsg@public.gmane.org \
    --cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@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