[PATCH] mm: do not rely on preempt_count in print_vma_addr (was: Re: [PATCH] mm: use in_atomic() in print_vma_addr())

From: Michal Hocko
Date: Mon Nov 06 2017 - 08:40:39 EST


On Mon 06-11-17 13:12:22, Michal Hocko wrote:
> On Mon 06-11-17 13:00:25, Peter Zijlstra wrote:
> > On Mon, Nov 06, 2017 at 11:43:54AM +0100, Michal Hocko wrote:
> > > > Yes the comment is very much accurate.
> > >
> > > Which suggests that print_vma_addr might be problematic, right?
> > > Shouldn't we do trylock on mmap_sem instead?
> >
> > Yes that's complete rubbish. trylock will get spurious failures to print
> > when the lock is contended.
>
> Yes, but I guess that it is acceptable to to not print the state under
> that condition.

So what do you think about this? I think this is more robust than
playing tricks with the explicit preempt count checks and less tedious
than checking to make it conditional on the context. This is on top of
Linus tree and if accepted it should replace the patch discussed here.
---