From: Andrea Arcangeli <andrea@suse.de>
To: Nuno Monteiro <nuno@itsari.org>
Cc: linux-kernel@vger.kernel.org, jmarcet@pobox.com,
andrew@sol-1.demon.co.uk, jamagallon@able.es,
khromy@lnuxlab.ath.cx, conman@kolivas.net
Subject: Re: Exaggerated swap usage
Date: Mon, 2 Dec 2002 01:21:08 +0100 [thread overview]
Message-ID: <20021202002108.GQ28164@dualathlon.random> (raw)
In-Reply-To: <20021201143713.GA871@hobbes.itsari.int>
On Sun, Dec 01, 2002 at 02:37:13PM +0000, Nuno Monteiro wrote:
> Pid: 2, comm: keventd
> EIP: 0010:[<c0142ae3>] CPU: 0 EFLAGS: 00000206 Not tainted
> EAX: c10ec45c EBX: 00000033 ECX: c11f8838 EDX: 40000000
> ESI: c2fed680 EDI: c10ec400 EBP: 00000033 DS: 0018 ES: 0018
[..]
> >>EIP; c0142ae3 <try_to_sync_unused_inodes+1f/1f8> <=====
>
> >>EAX; c10ec45c <_end+e521e4/13c9de8>
> >>ECX; c11f8838 <_end+f5e5c0/13c9de8>
> >>ESI; c2fed680 <[sb].data.end+a7ffd/25a9dd>
> >>EDI; c10ec400 <_end+e52188/13c9de8>
>
> Trace; c0117114 <__run_task_queue+4c/60>
> Trace; c011e0e9 <context_thread+11d/19c>
> Trace; c010588c <kernel_thread+28/38>
ok, now it's clear what the problem is. there are inuse-dirty inodes
that triggers a deadlock in the schedule-capable
try_to_sync_unused_inodes of 2.4.20rc2aa1 (that avoided me to backout an
otherwise corrupt lowlatency fix). It can trigger only in UP,
in SMP the other cpu can always run kupdate that will flush all dirty
inodes, so it would lockup one cpu as worse for 2.5 sec, this is
probably why I couldn't reproduce it, I assume all of you reproducing
the deadlock were running on an UP machine (doesn't matter if the kernel
was compiled for SMP or not).
Can you give a spin to this untested incremental fix?
--- 2.4.20rc2aa1/fs/inode.c.~1~ 2002-11-27 10:04:43.000000000 +0100
+++ 2.4.20rc2aa1/fs/inode.c 2002-12-02 01:09:05.000000000 +0100
@@ -459,13 +459,16 @@ static void try_to_sync_unused_inodes(vo
{
struct super_block * sb;
int nr_inodes = inodes_stat.nr_unused;
+ int global_pass = 0, local_pass;
restart:
spin_lock(&sb_lock);
+ local_pass = 0;
sb = sb_entry(super_blocks.next);
while (nr_inodes && sb != sb_entry(&super_blocks)) {
- if (list_empty(&sb->s_dirty)) {
+ if (local_pass < global_pass || list_empty(&sb->s_dirty)) {
sb = sb_entry(sb->s_list.next);
+ local_pass++;
continue;
}
sb->s_count++;
@@ -474,6 +477,7 @@ static void try_to_sync_unused_inodes(vo
if (sb->s_root)
nr_inodes = try_to_sync_unused_list(&sb->s_dirty, nr_inodes);
drop_super(sb);
+ global_pass = local_pass + 1;
goto restart;
}
spin_unlock(&sb_lock);
thanks,
Andrea
next prev parent reply other threads:[~2002-12-02 0:14 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-29 11:54 Exaggerated swap usage Javier Marcet
2002-11-29 12:20 ` Christer Nilsson
2002-11-29 16:31 ` Rik van Riel
2002-11-30 1:38 ` Javier Marcet
2002-11-30 1:55 ` Rik van Riel
2002-11-30 2:47 ` Zwane Mwaikambo
2002-11-30 5:17 ` Javier Marcet
2002-11-30 14:02 ` Exaggerated swap usage && -aa lockup Javier Marcet
2002-11-30 2:42 ` Exaggerated swap usage Zwane Mwaikambo
2002-11-30 3:02 ` Andrew Morton
2002-11-30 4:12 ` Zwane Mwaikambo
2002-11-30 6:48 ` khromy
2002-11-30 6:49 ` Javier Marcet
2002-11-30 7:08 ` Dmitri
2002-11-30 14:05 ` Javier Marcet
2002-11-30 18:23 ` khromy
2002-11-30 18:43 ` Andrea Arcangeli
2002-12-01 7:39 ` Javier Marcet
2002-12-01 7:53 ` Javier Marcet
2002-12-01 10:34 ` Andrea Arcangeli
2002-12-01 7:59 ` Javier Marcet
2002-12-01 10:36 ` Andrea Arcangeli
2002-12-01 14:37 ` Nuno Monteiro
2002-12-02 0:21 ` Andrea Arcangeli [this message]
2002-12-02 1:01 ` Nuno Monteiro
2002-12-02 4:55 ` Javier Marcet
2002-12-02 21:24 ` Andrew Clayton
2002-11-30 14:05 ` Steffen Moser
2002-11-30 18:22 ` Rik van Riel
2002-12-01 7:57 ` Javier Marcet
2002-12-01 19:27 ` Rik van Riel
-- strict thread matches above, loose matches on Subject: below --
2002-11-29 15:28 Randal, Phil
2002-11-29 16:28 ` Rik van Riel
2002-12-02 23:59 Marc-Christian Petersen
2002-12-03 0:59 ` Andrea Arcangeli
2002-12-03 10:13 ` Marc-Christian Petersen
2002-12-03 13:59 ` Andrea Arcangeli
2002-12-03 18:43 ` Marc-Christian Petersen
2002-12-05 23:14 ` Marc-Christian Petersen
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=20021202002108.GQ28164@dualathlon.random \
--to=andrea@suse.de \
--cc=andrew@sol-1.demon.co.uk \
--cc=conman@kolivas.net \
--cc=jamagallon@able.es \
--cc=jmarcet@pobox.com \
--cc=khromy@lnuxlab.ath.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno@itsari.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