archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <>
To: "Eric W. Biederman" <>
Cc: "Arve Hjønnevåg" <>,
	"KOSAKI Motohiro" <>,
	"Greg Kroah-Hartman" <>,
	"San Mehat" <>, "Colin Cross" <>,
	"Oleg Nesterov" <>,,,
Subject: Re: [PATCH 1/3] procfs: Export next_tgid(), move it to kernel/pid.c
Date: Mon, 30 Jan 2012 23:51:06 +0400	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Sun, Jan 29, 2012 at 07:26:55PM -0800, Eric W. Biederman wrote:
> Anton Vorontsov <> writes:
> > We'd like to use this function in the android low memory killer driver, so
> > let's export it.
> >
> > Also, move next_tgid() to kernel/pid.c, so now it lives with the rest of
> > pid library functions and does not depend on procfs. Plus, we may now hide
> > find_ge_pid() from the global namespace.
> >
> > While at it, also turn next_tgid()'s comments into kerneldoc format.
> >
> > There should be no functional changes.
> Ouch no.
> There is find_ge_pid that is general purpose, and there are a lot of
> things with the task list.  But this iterator is specific to the
> implementation of proc especially in how it grabs and drops locks.

Exactly, the way procfs grabs and drops locks is very attractive for
us to reuse in lowmemorykiller driver. :-) Proc is efficient in a
way that it does not need to hold the tacklist lock (otherwise, I guess,
it could be prone to attacks, e.g. by constantly readdiring /proc/ ?).

> Using this code outside of /proc will make /proc harder to maintain than
> it already is.
> Why in the world would you want to traverse processes by pids when
> there are well defined iterators for looping over tasks already.

We just did not want to hold the global tasklist lock, if we could
avoid it. Low memory killer is a low priority stuff, and grabbing
tasklist lock seemed inefficient.


Anton Vorontsov

  reply	other threads:[~2012-01-30 19:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30  1:13 [PATCH 1/3] procfs: Export next_tgid(), move it to kernel/pid.c Anton Vorontsov
2012-01-30  2:22 ` Greg KH
2012-01-30 19:50   ` Anton Vorontsov
2012-01-30  3:26 ` Eric W. Biederman
2012-01-30 19:51   ` Anton Vorontsov [this message]
2012-01-30 13:43 ` Oleg Nesterov
2012-01-30 20:49   ` Anton Vorontsov
2012-01-31  1:51     ` Eric W. Biederman
2012-02-01  4:19       ` Anton Vorontsov
2012-02-01  4:37         ` Eric W. Biederman

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).