Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1105588ybm; Tue, 21 May 2019 08:42:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPxA6c6vLBim86NXLTuT79vsAGR1pEYI0NP8aF+sbrzwgzK48bG1C7UNmdXxME4nSq0fR/ X-Received: by 2002:aa7:90ca:: with SMTP id k10mr88158952pfk.20.1558453369380; Tue, 21 May 2019 08:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558453369; cv=none; d=google.com; s=arc-20160816; b=cno0WscdnIembU6ye6d9LN80dN+aH+pKnD9JiU1v6aqHiHqBh9jKUeh/5k2IaXOB/0 DhX2tObz+Td1Km4DLP1n6vz2dBm5guzdTV0dmivYxX4MkCVb56kbbLIWvma+JJ3gehgB cV+wL2606XW9IW3Pgc4n0Y8VPN2D6nabYVdPGzSyL28BC2umqL4jGVwvR7/d9/PEWxPn ASMuRKdUes8wtlE8bVS2TMIojop22f1wuK5bUpiju1Wjvx3q/aU0hu8ae8sGsgAqdJ40 pZFvSkHLYoi0asfoqaC7XswPhZ2btb6cEviW3iyOXArMGcYEPWyd2SES1sfhkZwAra1O +Rbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=pvB+ipTmtcum6vNe8cy+MZiFmsCSVnxehggQ2f18MqY=; b=YLvxzylynwlhFfO9Aou+ptK27aFkBTD6hMTiYD/muBUER3CEPDFIpymWV7WMbLqfFd 4pSfR4Wv5HQxrH3kDbYRxpL6r3wcZsPgDxrBE4QvH9I6gVGQ35wRa+52B4dHbiotXCf4 Y4dCKZHMbIdgB3hLiaUj4OJNZeBFKFX8lWgX7s7C+3naT2gIk9zJuAOEw6AuGkeRZ4aR 638T4gnnpEXRpT6tWHKSuG0kraeQ9z77hyPX3ZGWY4FhGK/EtisED3np5hVRKknT6Vog PEdmTtn6ra+xBashgBJ8Q5sg4keqIVuMKCtoh0kUYyKS+STeOiyfaUDcZgIG2k9/Hy1P oXVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si15564086plq.94.2019.05.21.08.42.33; Tue, 21 May 2019 08:42:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728724AbfEUPlL (ORCPT + 99 others); Tue, 21 May 2019 11:41:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51982 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728289AbfEUPlL (ORCPT ); Tue, 21 May 2019 11:41:11 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7524F30BB532; Tue, 21 May 2019 15:41:05 +0000 (UTC) Received: from redhat.com (unknown [10.20.6.178]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE28453786; Tue, 21 May 2019 15:41:00 +0000 (UTC) Date: Tue, 21 May 2019 11:40:59 -0400 From: Jerome Glisse 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 Subject: Re: [PATCH 4/4] mm, notifier: Add a lockdep map for invalidate_range_start 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190520213945.17046-4-daniel.vetter@ffwll.ch> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 21 May 2019 15:41:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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