linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: linux-ext4@vger.kernel.org
Subject: [Bug 76821] jbd2 write on disk each 2/3 seconds
Date: Sat, 24 May 2014 14:42:23 +0000	[thread overview]
Message-ID: <bug-76821-13602-lKfKAY8hNb@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-76821-13602@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=76821

Theodore Tso <tytso@mit.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tytso@mit.edu

--- Comment #2 from Theodore Tso <tytso@mit.edu> ---
If your kernel doesn't have ftrace enabled, please enable it by enabling the
following kernel config options:

    CONFIG_FUNCTION_TRACER
    CONFIG_FUNCTION_GRAPH_TRACER
    CONFIG_STACK_TRACER
    CONFIG_DYNAMIC_FTRACE

Once you do that, make sure debugfs is mounted:

mount -t debugfs debugfs /sys/kernel/debug

Now enable the ext4_mark_inode_dirty tracepoint and start tracing:

cd /sys/kernel/debug/tracing
echo 1 > events/ext4/ext4_mark_inode_dirty/enable
cat trace_pipe

You will start seeing lines like this:

   kworker/u16:2-14718 [006] ...1 616239.342464: ext4_mark_inode_dirty: dev
252,0 ino 4203428 caller ext4_writepages+0x743/0x93e
 BrowserBlocking-5875  [006] ...1 616241.972533: ext4_mark_inode_dirty: dev 8,3
ino 3545316 caller ext4_dirty_inode+0x40/0x59


The first line indicates that process 14718, which is a kernel thread named
kworking/u16:2, dirtied inode 4203428 on device 252,0, which is /dev/dm-0
(which on my system has major number 252, minor 0, which you can see by the
command ls -l /dev/dm-0).   This is probably dirty inode writeback, so that
doesn't help tell you who dirtied the file.  You can find the filename using
debugfs:

debugfs /dev/dm-0
debugfs: ncheck 4203428
Inode    Pathname
4203428    /build/e2fsprogs-maint/tests/f_eofblocks.1.log

(and since /dev/dm-0 is mounted on /u1, I know the filename is
/u1/build/e2fsprogs-maint/....)  

The second line indicates the task id was 5875, and with a name like
BrowserBlocking, it's almost certainly one of the Chrome threads.  The ps
program won't show individual threads by default, but you can also use the
inode number to find which process has the file open by using lsof:

lsof | grep 3545316

Once you're done, don't forget to disable the tracing to save a bit on CPU and
battery life:

cat /dev/null > /sys/kernel/debug/tracing/set_event

Anyway, I hope this helps.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2014-05-24 14:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-24 12:14 [Bug 76821] New: jbd2 write on disk each 5/6 seconds bugzilla-daemon
2014-05-24 12:16 ` [Bug 76821] " bugzilla-daemon
2014-05-24 12:39 ` bugzilla-daemon
2014-05-24 12:40 ` [Bug 76821] jbd2 write on disk each 2/3 seconds bugzilla-daemon
2014-05-24 13:14 ` bugzilla-daemon
2014-05-24 14:42 ` bugzilla-daemon [this message]
2014-05-25  9:06 ` bugzilla-daemon
2014-05-25  9:13 ` bugzilla-daemon
2014-05-25 12:15 ` bugzilla-daemon

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=bug-76821-13602-lKfKAY8hNb@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=linux-ext4@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;
as well as URLs for NNTP newsgroup(s).