public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Dave Chinner <david@fromorbit.com>
Cc: djwong@kernel.org, hch@infradead.org, linux-xfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, hannes@cmpxchg.org
Subject: Re: [PATCH v2] iomap: skip pages past eof in iomap_do_writepage()
Date: Thu, 9 Jun 2022 17:15:22 -0400	[thread overview]
Message-ID: <8f4177bd-80ad-5e22-293e-5d1e944e1921@fb.com> (raw)
In-Reply-To: <20220609005313.GX227878@dread.disaster.area>

On 6/8/22 8:53 PM, Dave Chinner wrote:
> On Tue, Jun 07, 2022 at 05:42:29PM -0700, Chris Mason wrote:
>> iomap_do_writepage() sends pages past i_size through
>> folio_redirty_for_writepage(), which normally isn't a problem because
>> truncate and friends clean them very quickly.
>>
>> When the system has cgroups configured, we can end up in situations
>> where one cgroup has almost no dirty pages at all, and other cgroups
>> consume the entire background dirty limit.  This is especially common in
>> our XFS workloads in production because they have cgroups using O_DIRECT
>> for almost all of the IO mixed in with cgroups that do more traditional
>> buffered IO work.
>>
>> We've hit storms where the redirty path hits millions of times in a few
>> seconds, on all a single file that's only ~40 pages long.  This leads to
>> long tail latencies for file writes because the pdflush workers are
>> hogging the CPU from some kworkers bound to the same CPU.
>>
>> Reproducing this on 5.18 was tricky because 869ae85dae ("xfs: flush new
>> eof page on truncate...") ends up writing/waiting most of these dirty pages
>> before truncate gets a chance to wait on them.
> 
> That commit went into 5.10, so this would mean it's not easily
> reproducable on kernels released since then?

Yes, our main two prod kernels right now are v5.6 and v5.12,  but we 
don't have enough of this database tier on 5.12 to have any meaningful 
data from production.  For my repro, I didn't spend much time on 5.12, 
but it was hard to trigger there as well.

[...]

> Regardless, the change looks fine.
> 
> Reviewed-by: Dave Chinner <dchinner@redhat.com>

Thanks!  Johannes and I are both going on vacation, but I'll get an 
experiment rolled to enough hosts to see if the long tails get shorter. 
  We're unlikely to come back with results before July.

-chris

  reply	other threads:[~2022-06-09 21:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08  0:42 [PATCH v2] iomap: skip pages past eof in iomap_do_writepage() Chris Mason
2022-06-08 18:27 ` Matthew Wilcox
2022-06-09  0:53 ` Dave Chinner
2022-06-09 21:15   ` Chris Mason [this message]
2022-06-11 23:34     ` Chris Mason
2022-06-13 22:04       ` Dave Chinner

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=8f4177bd-80ad-5e22-293e-5d1e944e1921@fb.com \
    --to=clm@fb.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.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