From: Dave Hansen <haveblue@us.ibm.com>
To: Alexander Viro <viro@math.psu.edu>
Cc: Andrew Morton <akpm@zip.com.au>,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@transmeta.com>,
"Martin J. Bligh" <Martin.Bligh@us.ibm.com>
Subject: locking in sync_old_buffers
Date: Mon, 22 Apr 2002 14:01:27 -0700 [thread overview]
Message-ID: <3CC47A27.4000803@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]
BKL hold times in sync_old_buffers aren't good. This is one of the last
places that we see millisecond-scale BKL hold times.
0.09% 8.1% 4598us(9648us) 105us( 231us)(0.00%) 37 91.9% 8.1%
0% sync_old_buffers+0x1c
So, I'll ask the eternal question that plagues us all, why is the BKL
held here? I saw some discussions referring to races prevented by BKL here:
http://groups.google.com/groups?selm=linux.kernel.Pine.GSO.4.21.0103212354420.2632-100000%40weyl.math.psu.edu&output=gplain
From Al:
> Ehh... Linus, the main problem is in get_super(). Want a nice race?
> sys_ustat() vs. sys_umount(). The former does get_super(), finds
> struct super_block and does nothing to guarantee that it will stay.
> Then it calls ->statfs(). In the meanwhile, you umount the thing
> and do rmmod. Oops..
With the addition of sb_lock and refcounting on the sb, are these races
still there? sync_supers() and sync_unlocked_inodes() both hold sb_lock.
If we just remove the BKL from sync_old_buffers() the long hold time
goes from BKL to sb_lock. But, sb_lock is dropped and reacquired a few
times in that code, so latency should be better than BKL. BKL wouldn't
have been released except in those places where it had to drop the locks
and sleep.
Patch to do it is attached, but I'm not holding my breath.
--
Dave Hansen
haveblue@us.ibm.com
[-- Attachment #2: sync_old_buffers-remove_bkl-2.5.8.patch --]
[-- Type: text/plain, Size: 306 bytes --]
--- linux-2.5.8-clean/fs/buffer.c Mon Apr 22 13:45:34 2002
+++ linux/fs/buffer.c Mon Apr 22 13:45:49 2002
@@ -2612,10 +2612,8 @@
static void sync_old_buffers(unsigned long dummy)
{
- lock_kernel();
sync_unlocked_inodes();
sync_supers();
- unlock_kernel();
for (;;) {
struct buffer_head *bh;
next reply other threads:[~2002-04-22 21:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-22 21:01 Dave Hansen [this message]
2002-04-22 22:08 ` locking in sync_old_buffers Andrew Morton
2002-04-22 22:23 ` Dave Hansen
2002-04-22 22:28 ` Linus Torvalds
2002-04-22 22:50 ` Andrew Morton
2002-04-23 1:31 ` Alexander Viro
2002-04-23 18:29 ` Dave Hansen
2002-04-22 22:25 ` Martin J. Bligh
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=3CC47A27.4000803@us.ibm.com \
--to=haveblue@us.ibm.com \
--cc=Martin.Bligh@us.ibm.com \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
--cc=viro@math.psu.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