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

2017-11-06 Thread Michal Hocko
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

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-06 Thread Michal Hocko
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 comp

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-06 Thread Peter Zijlstra
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

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-06 Thread Michal Hocko
On Mon 06-11-17 11:43:54, Michal Hocko wrote: > On Mon 06-11-17 11:05:58, Peter Zijlstra wrote: > > 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 w

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-06 Thread Michal Hocko
On Mon 06-11-17 11:05:58, Peter Zijlstra wrote: > 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 > > > > > > > > WARNI

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-06 Thread Peter Zijlstra
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 > >

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-05 Thread Michal Hocko
[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

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-03 Thread Bart Van Assche
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

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-03 Thread Yang Shi
On 11/3/17 11:02 AM, Andrew Morton wrote: On Fri, 03 Nov 2017 01:44:44 +0800 "Yang Shi" wrote: I may not articulate it in the commit log You should have done so ;) Yes, definitely. I could done it much better. Here's the changelog I ended up with: : From: "Yang Shi" : Subject: mm: u

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-03 Thread Andrew Morton
On Fri, 03 Nov 2017 01:44:44 +0800 "Yang Shi" wrote: > I may not articulate it in the commit log You should have done so ;) Here's the changelog I ended up with: : From: "Yang Shi" : Subject: mm: use in_atomic() in print_vma_addr() : : 3e51f3c4004c9b ("sched/preempt: Remove PREEMPT_ACTIVE un

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-03 Thread Michal Hocko
On Fri 03-11-17 01:44:44, Yang Shi wrote: > > > On 11/2/17 12:57 AM, Michal Hocko wrote: > > On Thu 02-11-17 05:38:33, Yang Shi wrote: > > > commit 3e51f3c4004c9b01f66da03214a3e206f5ed627b > > > ("sched/preempt: Remove PREEMPT_ACTIVE unmasking off in_atomic()") makes > > > in_atomic() just check

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-02 Thread Yang Shi
On 11/2/17 12:57 AM, Michal Hocko wrote: On Thu 02-11-17 05:38:33, Yang Shi wrote: commit 3e51f3c4004c9b01f66da03214a3e206f5ed627b ("sched/preempt: Remove PREEMPT_ACTIVE unmasking off in_atomic()") makes in_atomic() just check the preempt count, so it is not necessary to use preempt_count() in

Re: [PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-02 Thread Michal Hocko
On Thu 02-11-17 05:38:33, Yang Shi wrote: > commit 3e51f3c4004c9b01f66da03214a3e206f5ed627b > ("sched/preempt: Remove PREEMPT_ACTIVE unmasking off in_atomic()") makes > in_atomic() just check the preempt count, so it is not necessary to use > preempt_count() in print_vma_addr() any more. Replace pr

[PATCH] mm: use in_atomic() in print_vma_addr()

2017-11-01 Thread Yang Shi
commit 3e51f3c4004c9b01f66da03214a3e206f5ed627b ("sched/preempt: Remove PREEMPT_ACTIVE unmasking off in_atomic()") makes in_atomic() just check the preempt count, so it is not necessary to use preempt_count() in print_vma_addr() any more. Replace preempt_count() to in_atomic() which is a generic AP