All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: xuejiufei <xuejiufei-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [bug report] writeback: sync returns with dirty pages exist
Date: Tue, 5 Dec 2017 10:20:07 -0800	[thread overview]
Message-ID: <20171205182007.GV2421075@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <dc694ae2-f07f-61e1-7097-7c8411cee12d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hello, Xuejiufei.

On Mon, Dec 04, 2017 at 03:13:34PM +0800, xuejiufei wrote:
> I have found that system call sync may return even if dirty pages still
> exist. This is caused by the following case:
>
> sync
> -> sync_inodes_sb()
>   -> bdi_split_work_to_wbs() queue works for each wb
>   -> wb_wait_for_completions() wait for these works to complete.
> 
> >>>>>> race window. Writeback thread found it should switch to another
> new wb while doing foreign cgroup detect. So a new wb is created, and
> the inodes are move from old wb to the new one. The writeback work for
> old wb is done, so the sync process is woken while the inodes with dirty
> pages are still queued in new wb.

So, wb_wait_for_completion() may end up returning earlier than
expected but data integrity is waited by wait_sb_inodes() which isn't
affected by inode cgroup wb migrations.  Have you actually seen this
happening?

Thanks.

-- 
tejun

  parent reply	other threads:[~2017-12-05 18:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04  7:13 [bug report] writeback: sync returns with dirty pages exist xuejiufei
     [not found] ` <dc694ae2-f07f-61e1-7097-7c8411cee12d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-04 20:21   ` Tejun Heo
2017-12-05 18:20   ` Tejun Heo [this message]
     [not found]     ` <20171205182007.GV2421075-4dN5La/x3IkLX0oZNxdnEQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2017-12-06  1:37       ` xuejiufei
     [not found]         ` <8844b550-d91c-38d5-997a-a899d1e4aa42-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-11 16:42           ` Tejun Heo
2017-12-11 19:50           ` [PATCH] writeback: synchronize sync(2) against cgroup writeback membership switches Tejun Heo
2017-12-11 19:50             ` Tejun Heo
     [not found]             ` <20171211195052.GN2421075-4dN5La/x3IkLX0oZNxdnEQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2017-12-12  6:04               ` xuejiufei
2017-12-12  6:04                 ` xuejiufei
     [not found]                 ` <ca999c10-5e8d-2bb1-c872-70bf13666849-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-12 16:30                   ` Tejun Heo
2017-12-12 16:30                     ` Tejun Heo
2017-12-12 16:38               ` [PATCH v2] " Tejun Heo
2017-12-12 16:38                 ` Tejun Heo
     [not found]                 ` <20171212163830.GC3919388-4dN5La/x3IkLX0oZNxdnEQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2017-12-13 11:00                   ` Jan Kara
2017-12-13 11:00                     ` Jan Kara
2017-12-13 15:39                     ` Tejun Heo
     [not found]                       ` <20171213153930.GO3919388-4dN5La/x3IkLX0oZNxdnEQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2017-12-19 13:04                         ` Jan Kara
2017-12-19 13:04                           ` Jan Kara
2017-12-19 13:31                           ` Tejun Heo

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=20171205182007.GV2421075@devbig577.frc2.facebook.com \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=xuejiufei-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 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.