Re: [PATCH 5/5] oom: dump_tasks() use find_lock_task_mm() too

From: Minchan Kim
Date: Wed Jun 02 2010 - 20:46:32 EST


On Thu, Jun 3, 2010 at 9:41 AM, KOSAKI Motohiro
<kosaki.motohiro@xxxxxxxxxxxxxx> wrote:
>> On Thu, Jun 3, 2010 at 9:06 AM, KOSAKI Motohiro
>> <kosaki.motohiro@xxxxxxxxxxxxxx> wrote:
>> >> > - Â Â Â Â Â mm = p->mm;
>> >> > - Â Â Â Â Â if (!mm) {
>> >> > - Â Â Â Â Â Â Â Â Â /*
>> >> > - Â Â Â Â Â Â Â Â Â Â* total_vm and rss sizes do not exist for tasks with no
>> >> > - Â Â Â Â Â Â Â Â Â Â* mm so there's no need to report them; they can't be
>> >> > - Â Â Â Â Â Â Â Â Â Â* oom killed anyway.
>> >> > - Â Â Â Â Â Â Â Â Â Â*/
>> >>
>> >> Please, do not remove the comment for mm newbies unless you think it's useless.
>> >
>> > How is this?
>> >
>> > Â Â Â Â Â Â Â task = find_lock_task_mm(p);
>> > Â Â Â Â Â Â Â if (!task)
>> > Â Â Â Â Â Â Â Â Â Â Â Â/*
>> > Â Â Â Â Â Â Â Â Â Â Â Â * Probably oom vs task-exiting race was happen and ->mm
>> > Â Â Â Â Â Â Â Â Â Â Â Â * have been detached. thus there's no need to report them;
>> > Â Â Â Â Â Â Â Â Â Â Â Â * they can't be oom killed anyway.
>> > Â Â Â Â Â Â Â Â Â Â Â Â */
>> > Â Â Â Â Â Â Â Â Â Â Â Âcontinue;
>> >
>>
>> Looks good to adding story about racing. but my point was "total_vm
>> and rss sizes do not exist for tasks with no mm". But I don't want to
>> bother you due to trivial.
>> It depends on you. :)
>
>
> old ->mm check have two intention.
>
> Â a) the task is kernel thread?
> Â b) the task have alredy detached ->mm
> but a) is not strictly correct check because we should think use_mm().
> therefore we appended PF_KTHREAD check. then, here find_lock_task_mm()
> focus exiting race, I think.
>

No objection.

--
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/