From: kernel test robot <lkp@intel.com>
To: Alexei Starovoitov <ast@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [ast-bpf:trylock 23/29] mm/page_alloc.c:7079:53: error: 'zone' undeclared
Date: Tue, 14 Jan 2025 08:28:53 +0800 [thread overview]
Message-ID: <202501140820.eaqK0nPJ-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf.git trylock
head: 1b2329dd88553224f4ef9a26e1b22cea83b071a5
commit: da4b036e3dc46bc8ab5add0a7d4944de54182afe [23/29] mm, bpf: Introduce try_alloc_pages() for opportunistic page allocation
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20250114/202501140820.eaqK0nPJ-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250114/202501140820.eaqK0nPJ-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/202501140820.eaqK0nPJ-lkp@intel.com/
All errors (new ones prefixed by >>):
mm/page_alloc.c: In function 'try_alloc_pages_noprof':
>> mm/page_alloc.c:7079:53: error: 'zone' undeclared (first use in this function)
7079 | if (has_unaccepted_memory() && !list_empty(&zone->unaccepted_pages))
| ^~~~
mm/page_alloc.c:7079:53: note: each undeclared identifier is reported only once for each function it appears in
vim +/zone +7079 mm/page_alloc.c
7035
7036 struct page *try_alloc_pages_noprof(int nid, unsigned int order)
7037 {
7038 /*
7039 * Do not specify __GFP_DIRECT_RECLAIM, since direct claim is not allowed.
7040 * Do not specify __GFP_KSWAPD_RECLAIM either, since wake up of kswapd
7041 * is not safe in arbitrary context.
7042 *
7043 * These two are the conditions for gfpflags_allow_spinning() being true.
7044 *
7045 * Specify __GFP_NOWARN since failing try_alloc_pages() is not a reason
7046 * to warn. Also warn would trigger printk() which is unsafe from
7047 * various contexts. We cannot use printk_deferred_enter() to mitigate,
7048 * since the running context is unknown.
7049 *
7050 * Specify __GFP_ZERO to make sure that call to kmsan_alloc_page() below
7051 * is safe in any context. Also zeroing the page is mandatory for
7052 * BPF use cases.
7053 *
7054 * Though __GFP_NOMEMALLOC is not checked in the code path below,
7055 * specify it here to highlight that try_alloc_pages()
7056 * doesn't want to deplete reserves.
7057 */
7058 gfp_t alloc_gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC;
7059 unsigned int alloc_flags = ALLOC_TRYLOCK;
7060 struct alloc_context ac = { };
7061 struct page *page;
7062
7063 /*
7064 * In RT spin_trylock() may call raw_spin_lock() which is unsafe in NMI.
7065 * If spin_trylock() is called from hard IRQ the current task may be
7066 * waiting for one rt_spin_lock, but rt_spin_trylock() will mark the
7067 * task as the owner of another rt_spin_lock which will confuse PI
7068 * logic, so return immediately if called form hard IRQ or NMI.
7069 *
7070 * Note, irqs_disabled() case is ok. This function can be called
7071 * from raw_spin_lock_irqsave region.
7072 */
7073 if (IS_ENABLED(CONFIG_PREEMPT_RT) && (in_nmi() || in_hardirq()))
7074 return NULL;
7075 if (!pcp_allowed_order(order))
7076 return NULL;
7077
7078 #ifdef CONFIG_UNACCEPTED_MEMORY
> 7079 if (has_unaccepted_memory() && !list_empty(&zone->unaccepted_pages))
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-01-14 0:29 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=202501140820.eaqK0nPJ-lkp@intel.com \
--to=lkp@intel.com \
--cc=ast@kernel.org \
--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.