From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerome Glisse Subject: Re: [PATCH 4/4] mm, notifier: Add a lockdep map for invalidate_range_start Date: Tue, 21 May 2019 11:40:59 -0400 Message-ID: <20190521154059.GC3836@redhat.com> References: <20190520213945.17046-1-daniel.vetter@ffwll.ch> <20190520213945.17046-4-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20190520213945.17046-4-daniel.vetter@ffwll.ch> Sender: linux-kernel-owner@vger.kernel.org To: Daniel Vetter Cc: DRI Development , Intel Graphics Development , LKML , Linux MM , Chris Wilson , Andrew Morton , David Rientjes , Michal Hocko , Christian =?iso-8859-1?Q?K=F6nig?= , Greg Kroah-Hartman , Mike Rapoport , Daniel Vetter List-Id: dri-devel@lists.freedesktop.org On Mon, May 20, 2019 at 11:39:45PM +0200, Daniel Vetter wrote: > This is a similar idea to the fs_reclaim fake lockdep lock. It's > fairly easy to provoke a specific notifier to be run on a specific > range: Just prep it, and then munmap() it. > > A bit harder, but still doable, is to provoke the mmu notifiers for > all the various callchains that might lead to them. But both at the > same time is really hard to reliable hit, especially when you want to > exercise paths like direct reclaim or compaction, where it's not > easy to control what exactly will be unmapped. > > By introducing a lockdep map to tie them all together we allow lockdep > to see a lot more dependencies, without having to actually hit them > in a single challchain while testing. > > Aside: Since I typed this to test i915 mmu notifiers I've only rolled > this out for the invaliate_range_start callback. If there's > interest, we should probably roll this out to all of them. But my > undestanding of core mm is seriously lacking, and I'm not clear on > whether we need a lockdep map for each callback, or whether some can > be shared. I need to read more on lockdep but it is legal to have mmu notifier invalidation within each other. For instance when you munmap you might split a huge pmd and it will trigger a second invalidate range while the munmap one is not done yet. Would that trigger the lockdep here ? Worst case i can think of is 2 invalidate_range_start chain one after the other. I don't think you can triggers a 3 levels nesting but maybe. Cheers, Jérôme