lkml.org 
[lkml]   [2012]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] procfs: Export next_tgid(), move it to kernel/pid.c
On Mon, Jan 30, 2012 at 02:43:12PM +0100, Oleg Nesterov wrote:
> On 01/30, Anton Vorontsov wrote:
> >
> > We'd like to use this function in the android low memory killer driver, so
> > let's export it.
>
> I guess you mean 3/3.
>
> If lowmem_shrink() can use next_tid() which is not really accurate,
> then why tou can't simply change it to use rcu_read_lock ?

Yes, in LMK driver we don't need to be accurate. I probably could use
rcu_read_lock, but the plan was in not holding any global locks (in
this case the rcu) at all, instead I'd like to hold just a reference
of the task, which the driver is analyzing at this time. Once we decide
(to kill or not to kill the task), we either send a signal (and drop
the reference) or just drop the reference.

Thanks,

--
Anton Vorontsov
Email: cbouatmailru@gmail.com


\
 
 \ /
  Last update: 2012-01-30 21:51    [W:0.084 / U:7.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site