linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: 王矛 <spearmao@126.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] Question about f2fs UDC(userdata checkpointing)
Date: Tue, 29 Oct 2019 17:33:11 +0800	[thread overview]
Message-ID: <8e7b930d-3c93-4edf-ad2c-cdff3e71ec49@huawei.com> (raw)
In-Reply-To: <14c6b12e.4b95.16e111552ce.Coremail.spearmao@126.com>

Hello,

On 2019/10/28 14:37, 王矛 wrote:
> Hi Chao,
> 
> Sorry to bother you again with last question about this topic. :)
> 
> "Actually, APP can update data during CP disabling, unless there is no enough
> free space"
> So we don't prevent app update data during CP disabling, but we prevent the
> dirty node/data information to be synced into storage, right?
> 
> From code i can see below sync operation will return directly if find CP is
> disabled:
>         f2fs_sync_fs()
>         f2fs_do_sync_file()
>             if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED)))
>                   return 0;
> 
> My question is, i didn't find any code to check CP is disabled in the Wribe-Back
> procedure.
> As you know, WB procedure would be executed periodically and flush dirty data
> into storage.
> Thus if WB is not prevented during CP disabled, data still be updated onto
> flash,  this is out of expectation of UDC, is this right?

We don't need to take care of WB, if CP and fsync is disabled, after sudden
power-cut, we will rollback to previous CP, which will not contain writebacked
data/node.

Thanks,

> 
> Thanks,
> Mao
> 
> 
> At 2019-10-24 21:15:20, "王矛" <spearmao@126.com> wrote:
> 
>     Chao,
> 
>     Very appreciated for your kind and prompt reply. :)
> 
>     Let me try to spend more time on the f2fs UDC related code and get back
>     later if I have further questions.
> 
>     Thanks!
>     Mao
> 
>     At 2019-10-23 17:42:03, "Chao Yu" <yuchao0@huawei.com> wrote:
>     >Hello,
>     >
>     >On 2019/10/23 16:35, 王矛 wrote:
>     >
>     >[snip]
>     >
>     >> When CP is disabled, I saw many f2fs operations are prevented(listed above).
>     >> 
>     >> If so, during the period CP disabled, app can’t do any change to f2fs? 
>     >
>     >Please Cc f2fs mailing list for any f2fs question.
>     >
>     >Actually, APP can update data during CP disabling, unless there is no enough
>     >free space, the logic was indicated by below codes:
>     >
>     >static inline bool f2fs_is_checkpoint_ready(struct f2fs_sb_info *sbi)
>     >{
>     >	if (likely(!is_sbi_flag_set(sbi, SBI_CP_DISABLED)))
>     >		return true;
>     >	if (likely(!has_not_enough_free_secs(sbi, 0, 0)))
>     >		return true;
>     >	return false;
>     >}
>     >
>     >static int f2fs_mknod(struct inode *dir, struct dentry *dentry,
>     >				umode_t mode, dev_t rdev)
>     >{
>     >	struct f2fs_sb_info *sbi = F2FS_I_SB(dir);
>     >	struct inode *inode;
>     >	int err = 0;
>     >
>     >	if (unlikely(f2fs_cp_error(sbi)))
>     >		return -EIO;
>     >	if (!f2fs_is_checkpoint_ready(sbi))
>     >		return -ENOSPC;
>     >...
>     >}
>     >
>     >Once all data was updated by Android, we can terminate CP disabling status, and
>     >trigger a checkpoint to persist all previous updates.
>     >
>     >Thanks,
>     >
>     >> 
>     >> If yes, how it implemented the checkpoint function?
>     >> 
>     >> Maybe the patch I
>     >> found(https://sourceforge.net/p/linux-f2fs/mailman/message/36425511/) is not the
>     >> whole implementation of this feaute….
>     >> 
>     >>  
>     >> 
>     >> 
>     >> Thanks,
>     >> 
>     >> Mao
>     >> 
>     >> 
>     >> 
>     >>  
>     >> 
> 
> 
> 
>      
> 
> 
> 
>  
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

       reply	other threads:[~2019-10-29  9:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <51b426e.685b.16df7c1dfeb.Coremail.spearmao@126.com>
     [not found] ` <41ebc7c0-d302-af52-f201-825220ed70f0@huawei.com>
     [not found]   ` <6a90286.7f06.16dfde844d3.Coremail.spearmao@126.com>
     [not found]     ` <14c6b12e.4b95.16e111552ce.Coremail.spearmao@126.com>
2019-10-29  9:33       ` Chao Yu [this message]
     [not found]         ` <57b2493f.8414.16e8d939f1f.Coremail.spearmao@126.com>
2019-11-30  3:31           ` [f2fs-dev] F2fs mount cost long time due to waiting f2fs gc with f2fs checkpoint disabled Chao Yu

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=8e7b930d-3c93-4edf-ad2c-cdff3e71ec49@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=spearmao@126.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).