From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39796C4727E for ; Thu, 1 Oct 2020 23:41:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 975F720739 for ; Thu, 1 Oct 2020 23:41:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ANMv3FLo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 975F720739 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E6B516B0095; Thu, 1 Oct 2020 19:41:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E1BA36B0098; Thu, 1 Oct 2020 19:41:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE51D6B0099; Thu, 1 Oct 2020 19:41:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0238.hostedemail.com [216.40.44.238]) by kanga.kvack.org (Postfix) with ESMTP id 9E90B6B0095 for ; Thu, 1 Oct 2020 19:41:30 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 44CAB1E1F for ; Thu, 1 Oct 2020 23:41:30 +0000 (UTC) X-FDA: 77324980740.12.pigs24_24024b92719f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 1E4241800F077 for ; Thu, 1 Oct 2020 23:41:30 +0000 (UTC) X-HE-Tag: pigs24_24024b92719f X-Filterd-Recvd-Size: 4502 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Thu, 1 Oct 2020 23:41:29 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id q10so420330qvs.1 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=h0vNhm/bpuwaoOl/hyIBS/tAFxcpLbgu4QDnMzQjZ0JFSM+7L82JYxIIiTNSxrbOnF j12mEyUsznlejzsBMZhhZlqQXUfD28yQkGh6R56SOFDVumpzv/XcWSASD2dKM/VMrB0U 3+NvRwXZqLOq5mvXi0Dzsi1/lAIXhNj3rJ+CoLWnirT3OlU6ZxEVGOm3fek5iFH8vK8t rsihHS17pshIU2HSF0A/aU3C5wLnwz8AZZJi32GLD+6DZnmUdHw58GoCLEX/W6OQrukn tLEfJUTjbGioTdj2+0N4gVahpa3PgV9iB3H6kVH0sG6VYj4+KMgxK2fV/tArjtkW9s4b stEA== X-Gm-Message-State: AOAM530syZYkBLRWziSDwHpYDw3p4SVvTrFlR9/XMT+TgL+ECqaqkTck CPeduJbEperHocVaQHTev0+GRw== X-Google-Smtp-Source: ABdhPJxd2AyZtByeV7o2/IShOr8SdCiXS1oQbmwMZZV5I2AhHQOl2gIId8kORue5lUAX6bRGB26+Lg== 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: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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