linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: akpm@linux-foundation.org, linux-mm@kvack.org,
	mm-commits@vger.kernel.org, thomas_os@shipmail.org,
	torvalds@linux-foundation.org, zackr@vmware.com
Subject: [patch 09/12] mm/mapping_dirty_helpers: guard hugepage pud's usage
Date: Fri, 16 Apr 2021 15:46:18 -0700	[thread overview]
Message-ID: <20210416224618.i95n9fHXs%akpm@linux-foundation.org> (raw)
In-Reply-To: <20210416154523.3f9794326e8e1db549873cf8@linux-foundation.org>

From: Zack Rusin <zackr@vmware.com>
Subject: mm/mapping_dirty_helpers: guard hugepage pud's usage

Mapping dirty helpers have, so far, been only used on X86, but a port of
vmwgfx to ARM64 exposed a problem which results in a compilation error on
ARM64 systems:

mm/mapping_dirty_helpers.c: In function `wp_clean_pud_entry':
mm/mapping_dirty_helpers.c:172:32: error: implicit declaration of function `pud_dirty'; did you mean `pmd_dirty'? [-Werror=implicit-function-declaration]

This is due to the fact that mapping_dirty_helpers code assumes that
pud_dirty is always defined, which is not the case for architectures that
don't define CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD.

ARM64 arch is a little inconsistent when it comes to PUD hugepage helpers,
e.g.  it defines pud_young but not pud_dirty but regardless of that the
core kernel code shouldn't assume that any of the PUD hugepage helpers are
available unless CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD is defined. 
This prevents compilation errors whenever one of the drivers is ported to
new architectures.

Link: https://lkml.kernel.org/r/20210409165151.694574-1-zackr@vmware.com
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Thomas Hellstrm (Intel) <thomas_os@shipmail.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/mapping_dirty_helpers.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/mm/mapping_dirty_helpers.c~mm-mapping_dirty_helpers-guard-hugepage-puds-usage
+++ a/mm/mapping_dirty_helpers.c
@@ -165,10 +165,12 @@ static int wp_clean_pud_entry(pud_t *pud
 		return 0;
 	}
 
+#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
 	/* Huge pud */
 	walk->action = ACTION_CONTINUE;
 	if (pud_trans_huge(pudval) || pud_devmap(pudval))
 		WARN_ON(pud_write(pudval) || pud_dirty(pudval));
+#endif
 
 	return 0;
 }
_


  parent reply	other threads:[~2021-04-16 22:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 22:45 incoming Andrew Morton
2021-04-16 22:45 ` [patch 01/12] mm: eliminate "expecting prototype" kernel-doc warnings Andrew Morton
2021-04-16 22:45 ` [patch 02/12] kasan: fix hwasan build for gcc Andrew Morton
2021-04-16 22:46 ` [patch 03/12] kasan: remove redundant config option Andrew Morton
2021-04-16 22:46 ` [patch 04/12] csky: change a Kconfig symbol name to fix e1000 build error Andrew Morton
2021-04-17  0:45   ` Guo Ren
2021-04-16 22:46 ` [patch 05/12] ia64: remove duplicate entries in generic_defconfig Andrew Morton
2021-04-16 22:46 ` [patch 06/12] ia64: fix discontig.c section mismatches Andrew Morton
2021-04-16 22:46 ` [patch 07/12] ia64: tools: remove inclusion of ia64-specific version of errno.h header Andrew Morton
2021-04-16 22:46 ` [patch 08/12] ia64: tools: remove duplicate definition of ia64_mf() on ia64 Andrew Morton
2021-04-16 22:46 ` Andrew Morton [this message]
2021-04-16 22:46 ` [patch 10/12] mm: ptdump: fix build failure Andrew Morton
2021-04-16 22:46 ` [patch 11/12] gcov: clang: fix clang-11+ build Andrew Morton
2021-04-19 21:36   ` Nathan Chancellor
2021-04-19 22:12     ` Linus Torvalds
2021-04-20 14:12       ` Sasha Levin
2021-04-16 22:46 ` [patch 12/12] lib: remove "expecting prototype" kernel-doc warnings 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=20210416224618.i95n9fHXs%akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=thomas_os@shipmail.org \
    --cc=torvalds@linux-foundation.org \
    --cc=zackr@vmware.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;
as well as URLs for NNTP newsgroup(s).