lkml.org 
[lkml]   [2013]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2] Add per-process flag to control thp
On 08/03/2013 01:01 PM, Oleg Nesterov wrote:

>> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>> + p->thp_disabled = current->thp_disabled;
>> +#endif
>
> Unneeded. It will be copied by dup_task_struct() automagically.
>
> But I simply can't understand why this flag is per-thread. It should be
> mm flag, no?

It has to be per-mm for another reason, too.

Think about what were to happen if one process were ptracing
a process with the thp_disabled flag, and ended up causing a
new anonymous page to be faulted in.

With the thp_disabled flag in the task, get_user_pages would
end up not seeing the flag, and the task could get a transparent
huge page.

With the thp_disabled flag in the mm, it would be possible for
get_user_pages to easily find the flag, and do the right thing.

--
All rights reversed


\
 
 \ /
  Last update: 2013-08-05 17:41    [W:0.112 / U:1.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site