From: "Lukáš Czerner" <lczerner@redhat.com>
To: Mason <mpeg.blue@free.fr>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
Andreas Dilger <adilger@dilger.ca>,
Ext4 Developers List <linux-ext4@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: After unlinking a large file on ext4, the process stalls for a long time
Date: Fri, 18 Jul 2014 11:29:34 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.1407181127440.12453@localhost.localdomain> (raw)
In-Reply-To: <53C7F4C2.6070804@free.fr>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2556 bytes --]
On Thu, 17 Jul 2014, Mason wrote:
> Date: Thu, 17 Jul 2014 18:07:30 +0200
> From: Mason <mpeg.blue@free.fr>
> To: Theodore Ts'o <tytso@mit.edu>
> Cc: Lukáš Czerner <lczerner@redhat.com>, Andreas Dilger <adilger@dilger.ca>,
> Ext4 Developers List <linux-ext4@vger.kernel.org>,
> linux-fsdevel <linux-fsdevel@vger.kernel.org>
> Subject: Re: After unlinking a large file on ext4,
> the process stalls for a long time
>
> Theodore Ts'o wrote:
>
> > Mason wrote:
> >
> >> unlink("/mnt/hdd/xxx") = 0 <111.479283>
> >>
> >> 0.01user 111.48system 1:51.99elapsed 99%CPU (0avgtext+0avgdata 772maxresident)k
> >> 0inputs+0outputs (0major+434minor)pagefaults 0swaps
> >
> > ... and we're CPU bound inside the kernel.
> >
> > Can you run perf so we can see exactly where we're spending the CPU?
> > You're not using a journal, so I'm pretty sure what you will find is
> > that we're spending all of our time in mb_free_blocks(), when it is
> > updating the internal mballoc buddy bitmaps.
> >
> > With a journal, this work done by mb_free_blocks() is hidden in the
> > kjournal thread, and happens after the commit is completed, so it
> > won't block other file system operations (other than burning some
> > extra CPU on one of the multiple cores available on a typical x86
> > CPU).
> >
> > Also, I suspect the CPU overhead is *much* less on an x86 CPU, which
> > has native bit test/set/clear instructions, whereas the MIPS
> > architecture was designed by Prof. Hennessy at Stanford, who was a
> > doctrinaire RISC fanatic, so there would be no bitop instructions.
> >
> > Even though I'm pretty sure what we'll find, knowing exactly *where*
> > in mb_free_blocks() or the function it calls would be helpful in
> > knowing what we need to optimize. So if you could try using perf
> > (assuming that the perf is supported MIPS; not sure if it does) that
> > would be really helpful.
>
> Is perf "better" than oprofile? (For some metric)
>
> I have enabled:
>
> CONFIG_PERF_EVENTS=y
> CONFIG_PROFILING=y
> CONFIG_TRACEPOINTS=y
> CONFIG_OPROFILE=y
> CONFIG_HAVE_OPROFILE=y
> CONFIG_KPROBES=y
> CONFIG_KRETPROBES=y
>
> What command-line do you suggest I run to get the output you expect?
> (I'll try to get it done, but I might have to wait two weeks before
> I can run these tests.)
If perf works on your system you can record data with
perf record -g ./test file <size>
and then report with
perf report --stdio
That should yield some interesting information about where we spend
the most time in kernel.
Thanks!
-Lukas
next prev parent reply other threads:[~2014-07-18 9:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <53C687B1.30809@free.fr>
[not found] ` <21446.38705.190786.631403@quad.stoffel.home>
[not found] ` <53C6B38A.3000100@free.fr>
2014-07-17 3:37 ` After unlinking a large file on ext4, the process stalls for a long time Andreas Dilger
2014-07-17 10:30 ` Mason
2014-07-17 10:40 ` Lukáš Czerner
2014-07-17 11:17 ` Mason
2014-07-17 13:37 ` Theodore Ts'o
2014-07-17 16:07 ` Mason
2014-07-17 16:32 ` Mason
2014-07-18 9:29 ` Lukáš Czerner [this message]
[not found] ` <53DF9918.3010206@free.fr>
2014-08-04 22:55 ` Andreas Dilger
2014-08-05 2:33 ` Theodore Ts'o
2014-08-05 21:54 ` Andreas Dilger
2014-08-05 12:06 ` Mason
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=alpine.LFD.2.00.1407181127440.12453@localhost.localdomain \
--to=lczerner@redhat.com \
--cc=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mpeg.blue@free.fr \
--cc=tytso@mit.edu \
/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