Messages in this thread | | | Date | Mon, 05 Aug 2013 11:09:20 -0400 | From | Rik van Riel <> | Subject | Re: [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
| |