lkml.org 
[lkml]   [2012]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 26/31] sched, numa, mm: Add fault driven placement and migration policy

* Ingo Molnar <mingo@kernel.org> wrote:

> [
> task_numa_work() performance side note:
>
> We are also *very* close to be able to use down_read() instead
> of down_write() in the sampling-unmap code in
> task_numa_work(), as it should be safe in theory to call
> change_protection(PROT_NONE) in parallel - but there's one
> regression that disagrees with this theory so we use
> down_write() at the moment.
>
> Maybe you could help us there: can you see a reason why the
> change_prot_none()->change_protection() call in
> task_numa_work() can not occur in parallel to a page fault in
> another thread on another CPU? It should be safe - yet if we
> change it I can see occasional corruption of user-space state:
> segfaults and register corruption.
> ]

Oh, just found the reason:

the ptep_modify_prot_start()/modify()/commit() sequence is
SMP-unsafe - it has to be done under the mmap_sem write-locked.

It is safe against *hardware* updates to the PTE, but not safe
against itself.

This is apparently a hidden cost of paravirt, it is forcing that
weird sequence and thus the down_write() ...

Thanks,

Ingo


\
 
 \ /
  Last update: 2012-10-26 16:41    [W:0.244 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site