linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Randy Dunlap <rdunlap@infradead.org>,
	broonie@kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-next@vger.kernel.org, mhocko@suse.cz,
	mm-commits@vger.kernel.org, sfr@canb.auug.org.au
Subject: Re: mmotm 2021-05-12-21-46 uploaded (arch/x86/mm/pgtable.c)
Date: Thu, 13 May 2021 13:47:54 -0700	[thread overview]
Message-ID: <20210513134754.ab3f1a864b0156ef99248401@linux-foundation.org> (raw)
In-Reply-To: <54055e72-34b8-d43d-2ad3-87e8c8fa547b@csgroup.eu>

On Thu, 13 May 2021 19:09:23 +0200 Christophe Leroy <christophe.leroy@csgroup.eu> wrote:

> 
> 
> > on i386:
> > 
> > ../arch/x86/mm/pgtable.c:703:5: error: redefinition of ‘pud_set_huge’
> >   int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
> >       ^~~~~~~~~~~~
> > In file included from ../include/linux/mm.h:33:0,
> >                   from ../arch/x86/mm/pgtable.c:2:
> > ../include/linux/pgtable.h:1387:19: note: previous definition of ‘pud_set_huge’ was here
> >   static inline int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
> >                     ^~~~~~~~~~~~
> > ../arch/x86/mm/pgtable.c:758:5: error: redefinition of ‘pud_clear_huge’
> >   int pud_clear_huge(pud_t *pud)
> >       ^~~~~~~~~~~~~~
> > In file included from ../include/linux/mm.h:33:0,
> >                   from ../arch/x86/mm/pgtable.c:2:
> > ../include/linux/pgtable.h:1391:19: note: previous definition of ‘pud_clear_huge’ was here
> >   static inline int pud_clear_huge(pud_t *pud)
> >                     ^~~~~~~~~~~~~~
> 
> Hum ...
> 
> Comes from my patch 
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/5ac5976419350e8e048d463a64cae449eb3ba4b0.1620795204.git.christophe.leroy@csgroup.eu/
> 
> But, that happens only if x86 defines __PAGETABLE_PUD_FOLDED. And if PUD is folded, then I can't 
> understand my it has pud_set_huge() and pud_clear_huge() functions.

Probably because someone messed something up ;)

Let's try this.

--- a/arch/x86/mm/pgtable.c~mm-pgtable-add-stubs-for-pmd-pub_set-clear_huge-fix
+++ a/arch/x86/mm/pgtable.c
@@ -682,6 +682,7 @@ int p4d_clear_huge(p4d_t *p4d)
 }
 #endif
 
+#ifndef __PAGETABLE_PUD_FOLDED
 /**
  * pud_set_huge - setup kernel PUD mapping
  *
@@ -721,6 +722,22 @@ int pud_set_huge(pud_t *pud, phys_addr_t
 }
 
 /**
+ * pud_clear_huge - clear kernel PUD mapping when it is set
+ *
+ * Returns 1 on success and 0 on failure (no PUD map is found).
+ */
+int pud_clear_huge(pud_t *pud)
+{
+	if (pud_large(*pud)) {
+		pud_clear(pud);
+		return 1;
+	}
+
+	return 0;
+}
+#endif
+
+/**
  * pmd_set_huge - setup kernel PMD mapping
  *
  * See text over pud_set_huge() above.
@@ -751,21 +768,6 @@ int pmd_set_huge(pmd_t *pmd, phys_addr_t
 }
 
 /**
- * pud_clear_huge - clear kernel PUD mapping when it is set
- *
- * Returns 1 on success and 0 on failure (no PUD map is found).
- */
-int pud_clear_huge(pud_t *pud)
-{
-	if (pud_large(*pud)) {
-		pud_clear(pud);
-		return 1;
-	}
-
-	return 0;
-}
-
-/**
  * pmd_clear_huge - clear kernel PMD mapping when it is set
  *
  * Returns 1 on success and 0 on failure (no PMD map is found).
_


  reply	other threads:[~2021-05-13 20:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13  4:47 mmotm 2021-05-12-21-46 uploaded akpm
2021-05-13  5:28 ` mmotm 2021-05-12-21-46 uploaded (mm/memory_failure.c) Randy Dunlap
2021-05-13  5:36   ` HORIGUCHI NAOYA(堀口 直也)
2021-05-13 15:54 ` mmotm 2021-05-12-21-46 uploaded (arch/x86/mm/pgtable.c) Randy Dunlap
2021-05-13 17:09   ` Christophe Leroy
2021-05-13 20:47     ` Andrew Morton [this message]
2021-05-13 21:08       ` Randy Dunlap
2021-05-14  9:45         ` Naresh Kamboju
2021-05-14 21:40           ` Andrew Morton

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=20210513134754.ab3f1a864b0156ef99248401@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=broonie@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=mm-commits@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=sfr@canb.auug.org.au \
    /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).