2019-07-01 12:24:22

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the hmm tree

Hi all,

After merging the hmm tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

mm/hmm.c: In function 'hmm_get_or_create':
mm/hmm.c:50:2: error: implicit declaration of function 'lockdep_assert_held_exclusive'; did you mean 'lockdep_assert_held_once'? [-Werror=implicit-function-declaration]
lockdep_assert_held_exclusive(&mm->mmap_sem);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lockdep_assert_held_once

Caused by commit

8a9320b7ec5d ("mm/hmm: Simplify hmm_get_or_create and make it reliable")

interacting with commit

9ffbe8ac05db ("locking/lockdep: Rename lockdep_assert_held_exclusive() -> lockdep_assert_held_write()")

from the tip tree.

I have added the following merge fix.

From: Stephen Rothwell <[email protected]>
Date: Mon, 1 Jul 2019 21:05:59 +1000
Subject: [PATCH] mm/hmm: fixup for "locking/lockdep: Rename
lockdep_assert_held_exclusive() -> lockdep_assert_held_write()"

Signed-off-by: Stephen Rothwell <[email protected]>
---
mm/hmm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/hmm.c b/mm/hmm.c
index c1bdcef403ee..2ddbd589b207 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -47,7 +47,7 @@ static struct hmm *hmm_get_or_create(struct mm_struct *mm)
{
struct hmm *hmm;

- lockdep_assert_held_exclusive(&mm->mmap_sem);
+ lockdep_assert_held_write(&mm->mmap_sem);

/* Abuse the page_table_lock to also protect mm->hmm. */
spin_lock(&mm->page_table_lock);
@@ -248,7 +248,7 @@ static const struct mmu_notifier_ops hmm_mmu_notifier_ops = {
*/
int hmm_mirror_register(struct hmm_mirror *mirror, struct mm_struct *mm)
{
- lockdep_assert_held_exclusive(&mm->mmap_sem);
+ lockdep_assert_held_write(&mm->mmap_sem);

/* Sanity check */
if (!mm || !mirror || !mirror->ops)
--
2.20.1

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2019-07-09 00:22:41

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the hmm tree

Hi all,

On Mon, 1 Jul 2019 21:08:53 +1000 Stephen Rothwell <[email protected]> wrote:
>
> After merging the hmm tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
>
> mm/hmm.c: In function 'hmm_get_or_create':
> mm/hmm.c:50:2: error: implicit declaration of function 'lockdep_assert_held_exclusive'; did you mean 'lockdep_assert_held_once'? [-Werror=implicit-function-declaration]
> lockdep_assert_held_exclusive(&mm->mmap_sem);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> lockdep_assert_held_once
>
> Caused by commit
>
> 8a9320b7ec5d ("mm/hmm: Simplify hmm_get_or_create and make it reliable")
>
> interacting with commit
>
> 9ffbe8ac05db ("locking/lockdep: Rename lockdep_assert_held_exclusive() -> lockdep_assert_held_write()")
>
> from the tip tree.
>
> I have added the following merge fix.
>
> From: Stephen Rothwell <[email protected]>
> Date: Mon, 1 Jul 2019 21:05:59 +1000
> Subject: [PATCH] mm/hmm: fixup for "locking/lockdep: Rename
> lockdep_assert_held_exclusive() -> lockdep_assert_held_write()"
>
> Signed-off-by: Stephen Rothwell <[email protected]>
> ---
> mm/hmm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/hmm.c b/mm/hmm.c
> index c1bdcef403ee..2ddbd589b207 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -47,7 +47,7 @@ static struct hmm *hmm_get_or_create(struct mm_struct *mm)
> {
> struct hmm *hmm;
>
> - lockdep_assert_held_exclusive(&mm->mmap_sem);
> + lockdep_assert_held_write(&mm->mmap_sem);
>
> /* Abuse the page_table_lock to also protect mm->hmm. */
> spin_lock(&mm->page_table_lock);
> @@ -248,7 +248,7 @@ static const struct mmu_notifier_ops hmm_mmu_notifier_ops = {
> */
> int hmm_mirror_register(struct hmm_mirror *mirror, struct mm_struct *mm)
> {
> - lockdep_assert_held_exclusive(&mm->mmap_sem);
> + lockdep_assert_held_write(&mm->mmap_sem);
>
> /* Sanity check */
> if (!mm || !mirror || !mirror->ops)

I am still getting this conflict (the commit ids may have changed).
Just a reminder in case you think Linus may need to know.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2019-07-09 12:33:44

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the hmm tree

On Tue, Jul 09, 2019 at 10:21:37AM +1000, Stephen Rothwell wrote:
> Hi all,
>
> On Mon, 1 Jul 2019 21:08:53 +1000 Stephen Rothwell <[email protected]> wrote:
> >
> > After merging the hmm tree, today's linux-next build (x86_64 allmodconfig)
> > failed like this:
> >
> > mm/hmm.c: In function 'hmm_get_or_create':
> > mm/hmm.c:50:2: error: implicit declaration of function 'lockdep_assert_held_exclusive'; did you mean 'lockdep_assert_held_once'? [-Werror=implicit-function-declaration]
> > lockdep_assert_held_exclusive(&mm->mmap_sem);
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > lockdep_assert_held_once
> >
> > Caused by commit
> >
> > 8a9320b7ec5d ("mm/hmm: Simplify hmm_get_or_create and make it reliable")
> >
> > interacting with commit
> >
> > 9ffbe8ac05db ("locking/lockdep: Rename lockdep_assert_held_exclusive() -> lockdep_assert_held_write()")
> >
> > from the tip tree.
> >
> > I have added the following merge fix.
> >
> > From: Stephen Rothwell <[email protected]>
> > Date: Mon, 1 Jul 2019 21:05:59 +1000
> > Subject: [PATCH] mm/hmm: fixup for "locking/lockdep: Rename
> > lockdep_assert_held_exclusive() -> lockdep_assert_held_write()"
> >
> > Signed-off-by: Stephen Rothwell <[email protected]>
> > mm/hmm.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/mm/hmm.c b/mm/hmm.c
> > index c1bdcef403ee..2ddbd589b207 100644
> > +++ b/mm/hmm.c
> > @@ -47,7 +47,7 @@ static struct hmm *hmm_get_or_create(struct mm_struct *mm)
> > {
> > struct hmm *hmm;
> >
> > - lockdep_assert_held_exclusive(&mm->mmap_sem);
> > + lockdep_assert_held_write(&mm->mmap_sem);
> >
> > /* Abuse the page_table_lock to also protect mm->hmm. */
> > spin_lock(&mm->page_table_lock);
> > @@ -248,7 +248,7 @@ static const struct mmu_notifier_ops hmm_mmu_notifier_ops = {
> > */
> > int hmm_mirror_register(struct hmm_mirror *mirror, struct mm_struct *mm)
> > {
> > - lockdep_assert_held_exclusive(&mm->mmap_sem);
> > + lockdep_assert_held_write(&mm->mmap_sem);
> >
> > /* Sanity check */
> > if (!mm || !mirror || !mirror->ops)
>
> I am still getting this conflict (the commit ids may have changed).
> Just a reminder in case you think Linus may need to know.

Ingo already sent the PR to Linus with the function rename, so I will
take care of it.

Thanks,
Jason