[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190820133135.GF29246@ziepe.ca>
Date: Tue, 20 Aug 2019 10:31:35 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: LKML <linux-kernel@...r.kernel.org>, Linux MM <linux-mm@...ck.org>,
DRI Development <dri-devel@...ts.freedesktop.org>,
Intel Graphics Development <intel-gfx@...ts.freedesktop.org>,
Chris Wilson <chris@...is-wilson.co.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
David Rientjes <rientjes@...gle.com>,
Jérôme Glisse <jglisse@...hat.com>,
Michal Hocko <mhocko@...e.com>,
Christian König <christian.koenig@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Daniel Vetter <daniel.vetter@...el.com>
Subject: Re: [PATCH 2/4] mm, notifier: Prime lockdep
On Tue, Aug 20, 2019 at 10:19:00AM +0200, Daniel Vetter wrote:
> We want to teach lockdep that mmu notifiers can be called from direct
> reclaim paths, since on many CI systems load might never reach that
> level (e.g. when just running fuzzer or small functional tests).
>
> Motivated by a discussion with Jason.
>
> I've put the annotation into mmu_notifier_register since only when we
> have mmu notifiers registered is there any point in teaching lockdep
> about them. Also, we already have a kmalloc(, GFP_KERNEL), so this is
> safe.
>
> Cc: Jason Gunthorpe <jgg@...pe.ca>
> Cc: Chris Wilson <chris@...is-wilson.co.uk>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: David Rientjes <rientjes@...gle.com>
> Cc: "Jérôme Glisse" <jglisse@...hat.com>
> Cc: Michal Hocko <mhocko@...e.com>
> Cc: "Christian König" <christian.koenig@....com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: Daniel Vetter <daniel.vetter@...ll.ch>
> Cc: Mike Rapoport <rppt@...ux.vnet.ibm.com>
> Cc: linux-mm@...ck.org
> Signed-off-by: Daniel Vetter <daniel.vetter@...el.com>
> mm/mmu_notifier.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
> index d12e3079e7a4..538d3bb87f9b 100644
> +++ b/mm/mmu_notifier.c
> @@ -256,6 +256,13 @@ static int do_mmu_notifier_register(struct mmu_notifier *mn,
>
> BUG_ON(atomic_read(&mm->mm_users) <= 0);
>
> + if (IS_ENABLED(CONFIG_LOCKDEP)) {
> + fs_reclaim_acquire(GFP_KERNEL);
> + lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
> + lock_map_release(&__mmu_notifier_invalidate_range_start_map);
> + fs_reclaim_release(GFP_KERNEL);
> + }
Lets try it out at least
Reviewed-by: Jason Gunthorpe <jgg@...lanox.com>
Jason
Powered by blists - more mailing lists