All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: Artem Bityutskiy <dedekind1@gmail.com>
Cc: <richard.weinberger@gmail.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH v5] ubifs: introduce UBIFS_ATIME_SUPPORT to ubifs
Date: Wed, 19 Aug 2015 16:27:14 +0800	[thread overview]
Message-ID: <55D43DE2.70008@cn.fujitsu.com> (raw)
In-Reply-To: <CAF4G-tJSMA3yYJZMzoMs4dk-ypVOdK9DsGMRMmo1dq+n+6RmKg@mail.gmail.com>

On 08/18/2015 04:43 PM, Artem Bityutskiy wrote:
> Please, take a look at the mkwrite path, most of the file-systems update
> atime there too,
> I think your patch may need to do something about atime in
> 'ubifs_vm_page_mkwrite()'.

Hi Atem,
	most of the file-systems are updating the ctime and mtime
in mkwrite path by calling file_update_time().It's a writing path
so we don't update atime here.
>
> On Tue, Aug 18, 2015 at 7:40 AM, Dongsheng Yang
> <yangds.fnst@cn.fujitsu.com <mailto:yangds.fnst@cn.fujitsu.com>> wrote:
>
>     To make ubifs support atime flexily, this commit introduces
>     +config UBIFS_ATIME_SUPPORT
>     +       bool "Access time support" if UBIFS_FS
>     +       depends on UBIFS_FS
>     +       default n
>     +       help
>     +         This option allows ubifs to support atime. -o strictatime
>     is harmful to
>     +         your flash, we don't suggest it. But relatime and lazytime
>     are much
>     +         better.
>
>
> How about this.
>
> Originally UBIFS did not support atime, because it looked like a bad
> idea due
> increased flash wear. This option adds atime support and it is disabled
> by default
> to preserve the old behavior. If you enable this option, UBIFS starts
> updating atime,
> which means that file-system read operations will cause writes (inode atime
> updates). This may affect file-system performance and increase flash
> device wear,
> so be careful. How often atime is updated depends on the selected strategy:
> strictatime is the "heavy", relatime is "lighter", etc.

Much better :)
>
>
>     +int ubifs_update_time(struct inode *inode, struct timespec *time,
>     +                            int flags)
>     +{
>     +       struct ubifs_inode *ui = ubifs_inode(inode);
>     +       struct ubifs_info *c = inode->i_sb->s_fs_info;
>     +       struct ubifs_budget_req req = { .dirtied_ino = 1,
>     +                       .dirtied_ino_d = ALIGN(ui->data_len, 8) };
>     +       int iflags = I_DIRTY_TIME;
>     +       int err, release;
>     +
>     +       err = ubifs_budget_space(c, &req);
>     +       if (err)
>     +               return err;
>     +
>     +       mutex_lock(&ui->ui_mutex);
>
>     +       if (flags & S_ATIME)
>     +               inode->i_atime = *time;
>     +       if (flags & S_VERSION)
>     +               inode_inc_iversion(inode);
>     +       if (flags & S_CTIME)
>     +               inode->i_ctime = *time;
>     +       if (flags & S_MTIME)
>     +               inode->i_mtime = *time;
>     +
>     +       if (!(inode->i_sb->s_flags & MS_LAZYTIME) || (flags &
>     S_VERSION))
>     +               iflags |= I_DIRTY_SYNC;
>
>
> The lazytime part looks OK, but I am a bit concerned about the S_VERSION
> part.
> IIRC, the inode version stuff is needed for NFS, which UBIFS does not
> support
> anyway. I do not see that we do anything with inode version in UBIFS, so
> it looks
> like UBIFS just does not support this.
>
> I do not think we should add code we do not really need or understand.
> Could you
> please take a closer look to the S_VERSION stuff and either remove it
> from this
> patch or make sure UBIFS needs this piece of code, which I doubt.

Thanx, I looked some more about it.

Hmmm, yes, agree that we should not introduce some code here
to make it hard for understanding, although that would never
cause some problem. I will remove it.

Maybe we can reintroduce it when we plan to add nfs supporting
in ubifs.:)
>
>
>     -               sb->s_flags |= MS_ACTIVE | MS_NOATIME;
>     +               sb->s_flags |= MS_ACTIVE;
>     +#ifndef CONFIG_UBIFS_ATIME_SUPPORT
>     +               sb->s_flags |= MS_NOATIME;
>     +#else
>     +               ubifs_warn(c, "full atime support is enabled, which
>     may wear out your flash faster");
>     +#endif
>
>
> I am not sure we need to print this warning. If I know what I am doing,
> and want atime,
> why whould I see the warning?
>
> We made the default to be the old behavior, whoudn't it be enough to
> just print a
> message (ubifs_info()) about enabled atime, without the "which may wear
> out your flash
> faster" part, what do you think?

Hmmm "default behavior to disable" makes sense to me. Yes, if someone
  enable it by intention, we need not warning it out to him. Okey,
Just a ubifs_info sounds good to me.

Yang
>
> Thanks!
>
> --
> Best Regards,
> Artem Bityutskiy (Битюцкий Артём)

      parent reply	other threads:[~2015-08-19  8:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18  4:40 [PATCH v5] ubifs: introduce UBIFS_ATIME_SUPPORT to ubifs Dongsheng Yang
2015-08-18  8:44 ` Artem Bityutskiy
2015-08-19  8:27   ` Dongsheng Yang
     [not found] ` <CAF4G-tJSMA3yYJZMzoMs4dk-ypVOdK9DsGMRMmo1dq+n+6RmKg@mail.gmail.com>
2015-08-19  8:27   ` Dongsheng Yang [this message]

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=55D43DE2.70008@cn.fujitsu.com \
    --to=yangds.fnst@cn.fujitsu.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard.weinberger@gmail.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.