From: Andi Kleen <ak@suse.de>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@osdl.org>,
ebiederm@xmission.com, pj@sgi.com,
saito.tadashi@soft.fujitsu.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] ps command race fix take2 [4/4] proc_pid_readdir
Date: 22 Aug 2006 13:11:30 +0200 [thread overview]
Message-ID: <p733bbp81p9.fsf@verdi.suse.de> (raw)
In-Reply-To: <20060822174302.e97f23d1.kamezawa.hiroyu@jp.fujitsu.com>
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> writes:
> proc_pid_readdir() by list_token.
>
> Remember 'where we are reading' by inserting a token in the list.
> It seems a bit complicated because of RCU but what we do is very simple.
>
What happens when you have multiple readers at the same time? Can't
the tokens then be mixed up?
>+ /* this small kmalloc() can fail in rare case, but readdir()
>+ * is not allowed to return ENOMEM. retrying is reasonable. */
Who disallows this? Such retry loops are normally discouraged
because they can lead to deadlocks in OOM situations.
I think it would be better to just return ENOMEM.
-Andi
next prev parent reply other threads:[~2006-08-22 11:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-22 8:43 [RFC][PATCH] ps command race fix take2 [4/4] proc_pid_readdir KAMEZAWA Hiroyuki
2006-08-22 9:38 ` KAMEZAWA Hiroyuki
2006-08-22 11:11 ` Andi Kleen [this message]
2006-08-22 11:39 ` KAMEZAWA Hiroyuki
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=p733bbp81p9.fsf@verdi.suse.de \
--to=ak@suse.de \
--cc=akpm@osdl.org \
--cc=ebiederm@xmission.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pj@sgi.com \
--cc=saito.tadashi@soft.fujitsu.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.