lkml.org 
[lkml]   [2019]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node
>
> You could have been migrated to another CPU while
> memory has been allocated.
>
That is true that we can migrate since we allow preemption
when allocate. But it does not really matter on which CPU an
allocation occurs and whether we migrate or not.

If we land on another CPU or still stay on the same, we will
check anyway one more time if it(another/same CPU) is preloaded
or not:

<snip>
preempt_disable();
if (__this_cpu_cmpxchg(ne_fit_preload_node, NULL, pva)
<snip>

if another, we can free the object allocated on previous step if
it already has it. If another CPU does not have it, save it in
ne_fit_preload_node for another current CPU to reuse later. Further
we can not migrate because of:

<snip>
spin_lock(&vmap_area_lock);
preempt_enable();
<snip>

--
Vlad Rezki

\
 
 \ /
  Last update: 2019-10-04 19:05    [W:0.080 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site