From: Grzegorz Nosek <grzegorz.nosek@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, vserver@list.linux-vserver.org
Subject: Re: [PATCH] race condition in procfs
Date: Tue, 29 Nov 2005 14:25:12 +0100 [thread overview]
Message-ID: <121a28810511290525m1bdf12e0n@mail.gmail.com> (raw)
In-Reply-To: <121a28810511290038h37067fecx@mail.gmail.com>
> >
> > Do you know what the race is?
>
> Apparently it's a race between deleting a process and accessing its
> /proc/pid entries. It came out in pidof while it was accessing
> /proc/pid/stat (fs/proc/array.c:do_task_stat crashed on first
> instruction - it was an inline function accessing task->state,
> get_task_state IIRC). oops (with vserver history data - I'm using a
> patch mentioned below) is attached.
>
> >
> > How does one reproduce it?
>
> I managed to reproduce it (although not reliably) during high CPU load
> and I/O (parallel kernel compiles) on SMP systems with the vserver
> patch (http://linux-vserver.org, the exact patch is
> http://vserver.13thfloor.at/Experimental/patch-2.6.14.2-vs2.1.0-rc8.diff),
> but the vserver maintainer pointed out that it probably is a mainline
> issue. We're not using 2.6 systems too much except for the vserver
> test beds so I cannot tell if it happens on vanilla kernels.
>
> >
> > > The following micro-patch seems to fix it.
> >
> > It might be right, or it might be a workaround..
> >
>
> I'm not a kernel guru so it's just my proposal. Can it break anything?
> An alternative _might_ be somewhat coarser task_struct locking
> (do_task_stat grabs a spinlock but then it's already too late).
> However, if no "right" solution appears, I'll keep using my two-liner
> because it seems to help, at least in my setup.
>
Oh well, I got another oops in the very same place with the patch
applied. So now I surrounded the check with
read_[un]lock(&tasklist_lock) and added a check to do_task_stat (both
now have a printk). If it builds, boots and doesn't crash, I'll post
the patch.
Best regards,
Grzegorz Nosek
next prev parent reply other threads:[~2005-11-29 13:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-29 7:17 [PATCH] race condition in procfs Grzegorz Nosek
2005-11-29 8:09 ` Andrew Morton
2005-11-29 8:38 ` Grzegorz Nosek
2005-11-29 13:25 ` Grzegorz Nosek [this message]
2005-11-29 14:04 ` Grzegorz Nosek
2005-11-29 14:28 ` Steven Rostedt
2005-11-29 14:39 ` Grzegorz Nosek
2005-11-29 14:49 ` Steven Rostedt
2005-11-30 14:41 ` Grzegorz Nosek
2005-11-30 15:14 ` Steven Rostedt
2005-11-30 15:29 ` Grzegorz Nosek
2005-11-30 16:25 ` Steven Rostedt
2005-11-30 17:23 ` Grzegorz Nosek
2005-12-01 20:38 ` Grzegorz Nosek
2005-11-29 15:22 ` [PATCH] shrinks dentry struct Eric Dumazet
2005-11-30 2:06 ` Paul Jackson
2005-11-30 2:14 ` Andrew Morton
2005-11-30 2:43 ` Paul Jackson
2005-11-30 6:56 ` Hugh Dickins
2005-12-03 1:15 ` [PATCH] remove unused blkp field in percpu_data Eric Dumazet
2005-12-13 18:03 ` [PATCH] shrinks dentry struct Paul E. McKenney
2005-12-13 18:24 ` Eric Dumazet
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=121a28810511290525m1bdf12e0n@mail.gmail.com \
--to=grzegorz.nosek@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vserver@list.linux-vserver.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