lkml.org 
[lkml]   [2023]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr()
On Tue, 17 Oct 2023 at 14:06, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> But adding the attached patch on top of both patches boots OK.

Funky.

Mind adding a

WARN_ON_ONCE(!active_mm);

to there to give a nice backtrace for the odd NULL case.

That code *is* related to 'current', in how we do

tsk = current;
...
local_irq_disable();
active_mm = tsk->active_mm;
tsk->active_mm = mm;
tsk->mm = mm;
...
activate_mm(active_mm, mm);
...
mmdrop_lazy_tlb(active_mm);

but I don't see how 'active_mm' could *poossibly* be validly NULL
here, and why caching 'current' would matter and change it.

Strange.

Hmm. We do set

tsk->active_mm = NULL;

in copy_mm(), and then we have that odd kernel thread case:

/*
* Are we cloning a kernel thread?
*
* We need to steal a active VM for that..
*/
oldmm = current->mm;
if (!oldmm)
return 0;

but none of this should even matter, because by the time we actually
*schedule* that thread, we'll set active_mm to the right thing.

Can anybody see what's up?

Linus

\
 
 \ /
  Last update: 2023-10-17 23:54    [W:0.213 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site