From: Jann Horn <jannh@google.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Michel Lespinasse <walken@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux-MM <linux-mm@kvack.org>,
kernel list <linux-kernel@vger.kernel.org>,
"Eric W . Biederman" <ebiederm@xmission.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet
Date: Fri, 2 Oct 2020 01:55:51 +0200 [thread overview]
Message-ID: <CAG48ez3pvgEYiGziw=_3wVQ5mDrWWyLD_DidoB+L4Zu=bb=KqQ@mail.gmail.com> (raw)
In-Reply-To: <20201001234127.GG9916@ziepe.ca>
On Fri, Oct 2, 2020 at 1:41 AM Jason Gunthorpe <jgg@ziepe.ca> wrote:
> 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 :)
Huh, is there an API that sets a *subclass* (not a class) at init
time? I don't think there is.
Anyway, I'm pretty sure I just need to use the normal _nested()
locking API. I'm still cleaning up and testing a little bit, but I'll
send it out in a short while, unless I run into unexpected trouble.
Let's continue this if necessary once there's a concrete patch to talk
about. :)
next prev parent reply other threads:[~2020-10-01 23:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200930011944.19869-1-jannh@google.com>
2020-09-30 1:20 ` [PATCH 2/4] binfmt_elf: Take the mmap lock around find_extend_vma() Jann Horn
2020-09-30 23:22 ` Michel Lespinasse
2020-09-30 1:20 ` [PATCH 3/4] mmap locking API: Don't check locking if the mm isn't live yet Jann Horn
2020-09-30 12:30 ` Jason Gunthorpe
2020-09-30 12:50 ` Jann Horn
2020-09-30 20:14 ` Jann Horn
2020-09-30 23:26 ` Jason Gunthorpe
2020-09-30 23:51 ` Jann Horn
2020-10-01 19:15 ` Jason Gunthorpe
2020-10-01 20:16 ` Jann Horn
2020-10-01 23:41 ` Jason Gunthorpe
2020-10-01 23:55 ` Jann Horn [this message]
2020-09-30 23:42 ` Michel Lespinasse
2020-09-30 1:20 ` [PATCH 4/4] mm/gup: Assert that the mmap lock is held in __get_user_pages() Jann Horn
2020-09-30 12:32 ` Jason Gunthorpe
2020-09-30 23:24 ` Michel Lespinasse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAG48ez3pvgEYiGziw=_3wVQ5mDrWWyLD_DidoB+L4Zu=bb=KqQ@mail.gmail.com' \
--to=jannh@google.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=jgg@ziepe.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=walken@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox