public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Cuong Tran <cuonghuutran@gmail.com>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: Java Stop-the-World GC stall induced by FS flush or many large file deletions
Date: Thu, 12 Sep 2013 15:02:51 -0400	[thread overview]
Message-ID: <20130912190251.GB28067@thunk.org> (raw)
In-Reply-To: <CALQm4jhE8aRjOsK2HpSuqNCzNqZm5RU9QOJi0q0SwgR=1JKZsQ@mail.gmail.com>

Are you absolutely certain your JVM attempting to write to any files
in its GC thread?  Say, to do some kind of logging?  It might be worth
stracing the JVM and correlating the GC stall with any syscalls that
might have been issued from the JVM GC thread.

Especially in the case of the FS Flush, the writeback thread isn't CPU
bound.  It will wait for the writeback to complete, but while it's
waiting, other processes or threads will be allowed to run on the CPU.

Now, if the GC thread tries to do some kind of fs operation which
requires writing to the file system, and the file sytstem is trying to
start a jbd transaction commit, file system operations can block until
all of the jbd handles associated with the previous commit can
complete.  If you are storage devices are slow, or you are using a
block cgroup to control how much I/O bandwidth a particular cgroup
could use, this can end up causing a priority inversion where a low
priority cgroup takes a while to complete, this can stall the jbd
commit completion, and this can cause new ext4 operations can stall
waiting to start a new jbd handle.

So you could have a stall happening, if it's taking a long time for
commits to complete, but it might be completely unrelated to a GC
stall.

If you enable the jbd2_run_stats tracepoint, you can get some
interesting numbers about how long the various phases of the jbd2
commit are taking.

              				- Ted

  parent reply	other threads:[~2013-09-12 19:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12  4:17 Java Stop-the-World GC stall induced by FS flush or many large file deletions Cuong Tran
2013-09-12  5:32 ` Sidorov, Andrei
2013-09-12  5:45   ` Cuong Tran
2013-09-12  6:01     ` Sidorov, Andrei
2013-09-12  6:02     ` Sidorov, Andrei
2013-09-12  6:08       ` Cuong Tran
2013-09-12 15:47         ` Sidorov, Andrei
2013-09-12 16:58           ` Cuong Tran
2013-09-12  7:46 ` Zheng Liu
2013-09-12 11:46   ` Cuong Tran
2013-09-12 19:02 ` Theodore Ts'o [this message]
2013-09-13 15:25   ` Cuong Tran
2013-09-13 18:36     ` Theodore Ts'o
2013-09-14 18:47       ` Cuong Tran

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=20130912190251.GB28067@thunk.org \
    --to=tytso@mit.edu \
    --cc=cuonghuutran@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@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