lkml.org 
[lkml]   [2021]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] hugetlb: select PREEMPT_COUNT if HUGETLB_PAGE for in_atomic use
On Thu 11-03-21 09:46:30, Peter Zijlstra wrote:
> On Wed, Mar 10, 2021 at 06:13:21PM -0800, Mike Kravetz wrote:
> > from irq context. Changing the check in the code from !in_task to
> > in_atomic would handle the situations when called with irqs disabled.
>
> It does not. local_irq_disable() does not change preempt_count().

You are right. Earlier I was suggesting to check of irq_disabled() as
well http://lkml.kernel.org/r/YD4I+VPr3UNt063H@dhcp22.suse.cz

back then it was not really clear to me that in fact we do care about
spin locks more than irq disabled code. I am not even sure whether we
need to care about irq disabled regions without any locks held that
wouldn't be covered by in_atomic. But it would be safer to add
irq_disabled check as well.

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2021-03-11 10:03    [W:0.077 / U:1.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site