From: Matthew Wilcox <willy@infradead.org>
To: Christoph Hellwig <hch@lst.de>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Thomas Hellström" <thomas@shipmail.org>,
"Jerome Glisse" <jglisse@redhat.com>,
"Jason Gunthorpe" <jgg@mellanox.com>,
"Steven Price" <steven.price@arm.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] pagewalk: use lockdep_assert_held for locking validation
Date: Thu, 8 Aug 2019 11:18:22 -0700 [thread overview]
Message-ID: <20190808181822.GK5482@bombadil.infradead.org> (raw)
In-Reply-To: <20190808154240.9384-4-hch@lst.de>
On Thu, Aug 08, 2019 at 06:42:40PM +0300, Christoph Hellwig wrote:
> Use lockdep to check for held locks instead of using home grown
> asserts.
>
> @@ -319,7 +319,7 @@ int walk_page_range(struct mm_struct *mm, unsigned long start,
> if (!walk.mm)
> return -EINVAL;
>
> - VM_BUG_ON_MM(!rwsem_is_locked(&walk.mm->mmap_sem), walk.mm);
> + lockdep_assert_held(&walk.mm->mmap_sem);
It occurs to me that this is exactly the pattern that lockdep_pin_lock()
was designed for. I'm pretty sure things will go badly if any callee
unlocks then relocks the lock.
next prev parent reply other threads:[~2019-08-08 18:18 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 15:42 cleanup the walk_page_range interface Christoph Hellwig
2019-08-08 15:42 ` [PATCH 1/3] mm: split out a new pagewalk.h header from mm.h Christoph Hellwig
2019-08-08 15:42 ` [PATCH 2/3] pagewalk: seperate function pointers from iterator data Christoph Hellwig
2019-08-08 20:34 ` Thomas Hellstrom
2019-08-09 8:57 ` Steven Price
2019-08-08 15:42 ` [PATCH 3/3] pagewalk: use lockdep_assert_held for locking validation Christoph Hellwig
2019-08-08 18:18 ` Matthew Wilcox [this message]
2019-08-08 17:50 ` cleanup the walk_page_range interface Linus Torvalds
2019-08-08 21:56 ` Christoph Hellwig
2019-08-08 22:21 ` Thomas Hellstrom
2019-08-09 14:36 ` Christoph Hellwig
2019-08-12 6:17 ` Mike Rapoport
2019-08-16 6:27 ` Christoph Hellwig
2019-08-16 11:57 ` Jason Gunthorpe
2019-08-16 12:32 ` Christoph Hellwig
2019-08-16 16:20 ` Linus Torvalds
2019-08-16 21:06 ` Andrew Morton
2019-08-17 6:41 ` Stephen Rothwell
2019-08-17 6:43 ` Christoph Hellwig
2019-08-17 6:58 ` Stephen Rothwell
2019-08-17 7:37 ` Linus Torvalds
2019-08-23 13:43 ` Jason Gunthorpe
2019-08-23 15:36 ` Steven Price
2019-08-24 22:26 ` Christoph Hellwig
2019-08-27 1:34 ` Jason Gunthorpe
2019-08-27 23:34 ` Andrew Morton
2019-08-27 23:36 ` Jason Gunthorpe
2019-08-28 6:20 ` Christoph Hellwig
2019-08-28 13:23 ` Steven Price
2019-08-28 14:19 cleanup the walk_page_range interface v2 Christoph Hellwig
2019-08-28 14:19 ` [PATCH 3/3] pagewalk: use lockdep_assert_held for locking validation Christoph Hellwig
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=20190808181822.GK5482@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=hch@lst.de \
--cc=jgg@mellanox.com \
--cc=jglisse@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=steven.price@arm.com \
--cc=thomas@shipmail.org \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).