Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp882291pxk; Thu, 1 Oct 2020 16:45:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3h/7/TKb0LWHjHrs63oaFr7C0uzbdr3/nr2OHgrh2ZIN6w9GDTWSiTl44XHaDit/8GvbT X-Received: by 2002:a17:906:d159:: with SMTP id br25mr3601812ejb.155.1601595917837; Thu, 01 Oct 2020 16:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601595917; cv=none; d=google.com; s=arc-20160816; b=CESRut/UCyR1IVGz04JslXC2VFYNWPhWfrNoXEcJ98xv9YYOPLQt1ZBFrJz9XD0vNg nbwhydB7VTrAkmuY0/TtredwDYMK1RJ7FeCiw+mZxIG7121lMGuIsSsvy/dXLOh9fv5B FOrb1NyL6vZTs+67ivTJASIY8X4rKw7zHlD1FH+2939nyx8ny+RJN3B1S5u7xK7T1fsb LlI/1JDOE977ItcQESv+q+ounAGzMgJNIMR3w+DiFE6fz0r0sfnx7pb4O4vtYa9bpWBU 72BwXvhkibpDM80tLwZ/kK7BWyOT8bca2r8hyXixH5eKJ/Vmz2CJGHO+lgJvBzKjIdS/ Zpyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9YGiMYLEFWMxP44IQznAdvlL7pES8GSYhxSh3+6yo0Y=; b=gQehSpeupJ+hU6mMILC6EhLvJy3JbBkFH3iBv8tu5eOS0o0xmReK++n0CoCzPY6kT2 yFQCVvkDQlUBRaxYF3lQwSfHzDVrSjpn4e65EeyT4j9KC1V11OzBGGTGPpHHkItBausH TVF8E+F+SfHL0V+zyOeimM/aHRTtXzfLp6LQB3bNUuYNYXh70Dx2RPkXVl4aj05WLl7A mZRbJY72nqE/NufupC3nj6yZey2z64l0idfGZTr3gkBZfI8TjAnXXJ9Wg+S+edlORSmI sxqQ8eKJPOOD6YjpeWBN0PLv8oOcRk7TqHN6ssrsM9mnPGrseZuTiHpnmEM6OCGF2nD8 C5zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=ANMv3FLo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si4550358eds.577.2020.10.01.16.44.55; Thu, 01 Oct 2020 16:45:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=ANMv3FLo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733103AbgJAXla (ORCPT + 99 others); Thu, 1 Oct 2020 19:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727713AbgJAXl3 (ORCPT ); Thu, 1 Oct 2020 19:41:29 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3E79C0613D0 for ; Thu, 1 Oct 2020 16:41:29 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id cr8so379278qvb.10 for ; Thu, 01 Oct 2020 16:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9YGiMYLEFWMxP44IQznAdvlL7pES8GSYhxSh3+6yo0Y=; b=ANMv3FLowaO67DZBUhWtSpkpLjpR46ykbDH8/Vkq814cnccALRmrxF89cHd7jprMaa 1q8oMjn7iuJJs139gXQHy1YgmCy1dLk8ZuNeP5nQ03RaWgVCuY7tMRTHAO7u5fEfyGzf lI4i5S9/+ft4RN4yYrNW5TLDz60axbCncGU3MerthTO3bnV5QdW0p0lm8a7eOlxK3J3U jjqJHwrJxR9J21APERDCxitSvqeAwYgu0TphzK1puwpoaq3ozgsF+X/QjTOZv0XwjLHi r8XhOqCiZPyBcISPZ63mmMYCU8h+5UjhF1QPBWftZ+amVGEsNzlMMyXgp3MKTGv/bQlA Ch8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9YGiMYLEFWMxP44IQznAdvlL7pES8GSYhxSh3+6yo0Y=; b=EeAEt5Ir61/FlrFuMpc7bnuoQw/oP2Afi859oLfOi3Yno588vH/oI7lN2YDk/NjiNW MQgPG9lfSDCW5VXkTPOWHaNAzZlwHPaH/7hVgF+OqsgMmsItyHhOWhKL4Y3/s6H2sZwe X6fIiYyZpzYweQHNJCsxyluBLy/FDXGKCG7sZY1tsTWOd4W7lYjJf/zfRVpfUdHTtloE pTPjTYMWv1xqpIVgYDFQ+Ca4qfPfE8cLWOrDQthw4sw0zEx3JNpzJJeGYrdlNRXDgKrw nNahC7mWnYG69stV2C9kGeO97H/51sifua6gEkazcNmnOlW1zJi5Weny7Yh46+EvVFCv 3Z+Q== X-Gm-Message-State: AOAM533WKOz8pA+++oi3H5bj4aqYJWtyHsW1Y3P/LkiDZ4PBQvdZa1lf 57j0H+BiplIDs5m3S/Wx2mJgnw== X-Received: by 2002:a0c:f48e:: with SMTP id i14mr10156591qvm.5.1601595688900; Thu, 01 Oct 2020 16:41:28 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id r17sm437460qtm.66.2020.10.01.16.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 16:41:27 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kO8CV-0052fJ-8d; Thu, 01 Oct 2020 20:41:27 -0300 Date: Thu, 1 Oct 2020 20:41:27 -0300 From: Jason Gunthorpe To: Jann Horn Cc: Michel Lespinasse , Andrew Morton , Linux-MM , kernel list , "Eric W . Biederman" , Mauro Carvalho Chehab , Sakari Ailus Subject: Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet Message-ID: <20201001234127.GG9916@ziepe.ca> References: <20200930011944.19869-1-jannh@google.com> <20200930123000.GC9916@ziepe.ca> <20200930232655.GE9916@ziepe.ca> <20201001191512.GF9916@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2020 at 10:16:35PM +0200, Jann Horn wrote: > > A subclass isn't right, it has to be a _nested annotation. > > > > nested locking is a pretty good reason to not be able to do this, this > > is something lockdep does struggle to model. > > Did I get the terminology wrong? I thought they were the same. The > down_*_nested() APIs take an argument "subclass", with the default > subclass for the functions without "_nested" being 0. AFAIK a subclass at init time sticks with the lock forever, the _nested ones are temporary overrides. I think what you kind of want is to start out with lockdep_set_novalidate_class() then switch to a real class once things are finished. Not sure exactly how :) Jason