tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Critical section



Masao Uebayashi <uebayasi%gmail.com@localhost> wrote:
> The problem of kpreempt_*() API is that its meaning is overriden by kernel
> internal (scheduler, sync primitives, ...).  This change separates the
> internal use (scheduler disables preeemption) and others (kernel
> subsystem code executes critical section).  Detect sleep from within
> critical section in mi_switch().
> 
> The only problem I've seen is, cprng_fast.c calling percpu_getref() in
> KASSERT(); it's kind of re-entrance.

Why create another interface which is almost the same as the existing one?

What problem are you trying to solve?  Catching the potential bugs when
context switch may happen while the kernel preemption is enabled and the
code path does not check for the CPU change?

I think we should modify kpreempt(9) to assert by default and then this
interface can be extended for any legitimate cases (if there are any?).

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index