From: kernel test robot <lkp@intel.com>
To: David Hildenbrand <david@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [davidhildenbrand:migration 22/22] include/linux/mm.h:2161:47: error: use of undeclared identifier 'PAGE_MAPPING_FLAGS'
Date: Wed, 14 May 2025 07:21:35 +0800 [thread overview]
Message-ID: <202505140705.prYAlYt7-lkp@intel.com> (raw)
tree: https://github.com/davidhildenbrand/linux migration
head: e21c02eb687873041b47954e3fc7b47e9d3d3675
commit: e21c02eb687873041b47954e3fc7b47e9d3d3675 [22/22] mm: rename PAGE_MAPPING_* to FOLIO_MAPPING_*
config: arm-randconfig-002-20250514 (https://download.01.org/0day-ci/archive/20250514/202505140705.prYAlYt7-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250514/202505140705.prYAlYt7-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505140705.prYAlYt7-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from arch/arm/kernel/asm-offsets.c:12:
>> include/linux/mm.h:2161:47: error: use of undeclared identifier 'PAGE_MAPPING_FLAGS'
2161 | } else if (!((unsigned long)folio->mapping & PAGE_MAPPING_FLAGS)) {
| ^
1 error generated.
make[3]: *** [scripts/Makefile.build:98: arch/arm/kernel/asm-offsets.s] Error 1 shuffle=2209529806
make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1275: prepare0] Error 2 shuffle=2209529806
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:248: __sub-make] Error 2 shuffle=2209529806
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:248: __sub-make] Error 2 shuffle=2209529806
make: Target 'prepare' not remade because of errors.
vim +/PAGE_MAPPING_FLAGS +2161 include/linux/mm.h
fa4e3f5ffa5e6e Vishal Moola (Oracle 2023-01-30 2116)
e6f83630b79ed4 Shivank Garg 2025-04-30 2117 /**
e6f83630b79ed4 Shivank Garg 2025-04-30 2118 * folio_expected_ref_count - calculate the expected folio refcount
e6f83630b79ed4 Shivank Garg 2025-04-30 2119 * @folio: the folio
e6f83630b79ed4 Shivank Garg 2025-04-30 2120 *
e6f83630b79ed4 Shivank Garg 2025-04-30 2121 * Calculate the expected folio refcount, taking references from the pagecache,
e6f83630b79ed4 Shivank Garg 2025-04-30 2122 * swapcache, PG_private and page table mappings into account. Useful in
e6f83630b79ed4 Shivank Garg 2025-04-30 2123 * combination with folio_ref_count() to detect unexpected references (e.g.,
e6f83630b79ed4 Shivank Garg 2025-04-30 2124 * GUP or other temporary references).
e6f83630b79ed4 Shivank Garg 2025-04-30 2125 *
e6f83630b79ed4 Shivank Garg 2025-04-30 2126 * Does currently not consider references from the LRU cache. If the folio
e6f83630b79ed4 Shivank Garg 2025-04-30 2127 * was isolated from the LRU (which is the case during migration or split),
e6f83630b79ed4 Shivank Garg 2025-04-30 2128 * the LRU cache does not apply.
e6f83630b79ed4 Shivank Garg 2025-04-30 2129 *
e6f83630b79ed4 Shivank Garg 2025-04-30 2130 * Calling this function on an unmapped folio -- !folio_mapped() -- that is
e6f83630b79ed4 Shivank Garg 2025-04-30 2131 * locked will return a stable result.
e6f83630b79ed4 Shivank Garg 2025-04-30 2132 *
e6f83630b79ed4 Shivank Garg 2025-04-30 2133 * Calling this function on a mapped folio will not result in a stable result,
e6f83630b79ed4 Shivank Garg 2025-04-30 2134 * because nothing stops additional page table mappings from coming (e.g.,
e6f83630b79ed4 Shivank Garg 2025-04-30 2135 * fork()) or going (e.g., munmap()).
e6f83630b79ed4 Shivank Garg 2025-04-30 2136 *
e6f83630b79ed4 Shivank Garg 2025-04-30 2137 * Calling this function without the folio lock will also not result in a
e6f83630b79ed4 Shivank Garg 2025-04-30 2138 * stable result: for example, the folio might get dropped from the swapcache
e6f83630b79ed4 Shivank Garg 2025-04-30 2139 * concurrently.
e6f83630b79ed4 Shivank Garg 2025-04-30 2140 *
e6f83630b79ed4 Shivank Garg 2025-04-30 2141 * However, even when called without the folio lock or on a mapped folio,
e6f83630b79ed4 Shivank Garg 2025-04-30 2142 * this function can be used to detect unexpected references early (for example,
e6f83630b79ed4 Shivank Garg 2025-04-30 2143 * if it makes sense to even lock the folio and unmap it).
e6f83630b79ed4 Shivank Garg 2025-04-30 2144 *
e6f83630b79ed4 Shivank Garg 2025-04-30 2145 * The caller must add any reference (e.g., from folio_try_get()) it might be
e6f83630b79ed4 Shivank Garg 2025-04-30 2146 * holding itself to the result.
e6f83630b79ed4 Shivank Garg 2025-04-30 2147 *
e6f83630b79ed4 Shivank Garg 2025-04-30 2148 * Returns the expected folio refcount.
e6f83630b79ed4 Shivank Garg 2025-04-30 2149 */
e6f83630b79ed4 Shivank Garg 2025-04-30 2150 static inline int folio_expected_ref_count(const struct folio *folio)
e6f83630b79ed4 Shivank Garg 2025-04-30 2151 {
e6f83630b79ed4 Shivank Garg 2025-04-30 2152 const int order = folio_order(folio);
e6f83630b79ed4 Shivank Garg 2025-04-30 2153 int ref_count = 0;
e6f83630b79ed4 Shivank Garg 2025-04-30 2154
e6f83630b79ed4 Shivank Garg 2025-04-30 2155 if (WARN_ON_ONCE(folio_test_slab(folio)))
e6f83630b79ed4 Shivank Garg 2025-04-30 2156 return 0;
e6f83630b79ed4 Shivank Garg 2025-04-30 2157
e6f83630b79ed4 Shivank Garg 2025-04-30 2158 if (folio_test_anon(folio)) {
e6f83630b79ed4 Shivank Garg 2025-04-30 2159 /* One reference per page from the swapcache. */
e6f83630b79ed4 Shivank Garg 2025-04-30 2160 ref_count += folio_test_swapcache(folio) << order;
e6f83630b79ed4 Shivank Garg 2025-04-30 @2161 } else if (!((unsigned long)folio->mapping & PAGE_MAPPING_FLAGS)) {
e6f83630b79ed4 Shivank Garg 2025-04-30 2162 /* One reference per page from the pagecache. */
e6f83630b79ed4 Shivank Garg 2025-04-30 2163 ref_count += !!folio->mapping << order;
e6f83630b79ed4 Shivank Garg 2025-04-30 2164 /* One reference from PG_private. */
e6f83630b79ed4 Shivank Garg 2025-04-30 2165 ref_count += folio_test_private(folio);
e6f83630b79ed4 Shivank Garg 2025-04-30 2166 }
e6f83630b79ed4 Shivank Garg 2025-04-30 2167
e6f83630b79ed4 Shivank Garg 2025-04-30 2168 /* One reference per page table mapping. */
e6f83630b79ed4 Shivank Garg 2025-04-30 2169 return ref_count + folio_mapcount(folio);
e6f83630b79ed4 Shivank Garg 2025-04-30 2170 }
e6f83630b79ed4 Shivank Garg 2025-04-30 2171
:::::: The code at line 2161 was first introduced by commit
:::::: e6f83630b79ed43763cd19a20f80885f568b8991 mm: add folio_expected_ref_count() for reference count calculation
:::::: TO: Shivank Garg <shivankg@amd.com>
:::::: CC: Andrew Morton <akpm@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-05-13 23:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202505140705.prYAlYt7-lkp@intel.com \
--to=lkp@intel.com \
--cc=david@redhat.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.