lkml.org 
[lkml]   [2017]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: use in_atomic() in print_vma_addr()
On Sun, Nov 05, 2017 at 09:19:46AM +0100, Michal Hocko wrote:
> [CC Peter]
>
> On Fri 03-11-17 20:09:49, Bart Van Assche wrote:
> > On Fri, 2017-11-03 at 11:02 -0700, Andrew Morton wrote:
> > > Also, checkpatch says
> > >
> > > WARNING: use of in_atomic() is incorrect outside core kernel code
> > > #43: FILE: mm/memory.c:4491:
> > > + if (in_atomic())
> > >
> > > I don't recall why we did that, but perhaps this should be revisited?
> >
> > Is the comment above in_atomic() still up-to-date? From <linux/preempt.h>:
> >
> > /*
> > * Are we running in atomic context? WARNING: this macro cannot
> > * always detect atomic context; in particular, it cannot know about
> > * held spinlocks in non-preemptible kernels. Thus it should not be
> > * used in the general case to determine whether sleeping is possible.
> > * Do not use in_atomic() in driver code.
> > */
> > #define in_atomic() (preempt_count() != 0)
>
> I can still see preempt_disable NOOP for !CONFIG_PREEMPT_COUNT kernels
> which makes me think this is still a valid comment.

Yes the comment is very much accurate.

\
 
 \ /
  Last update: 2017-11-06 11:06    [W:0.108 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site