[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dd288f1a-e7b0-48ae-9b11-d882f42bab36@linux.dev>
Date: Mon, 19 Jan 2026 11:44:09 +0800
From: Qi Zheng <qi.zheng@...ux.dev>
To: Shakeel Butt <shakeel.butt@...ux.dev>
Cc: Muchun Song <muchun.song@...ux.dev>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
Muchun Song <songmuchun@...edance.com>, hannes@...xchg.org,
hughd@...gle.com, mhocko@...e.com, roman.gushchin@...ux.dev,
david@...nel.org, lorenzo.stoakes@...cle.com, ziy@...dia.com,
harry.yoo@...cle.com, yosry.ahmed@...ux.dev, imran.f.khan@...cle.com,
kamalesh.babulal@...cle.com, axelrasmussen@...gle.com, yuanchu@...gle.com,
weixugc@...gle.com, chenridong@...weicloud.com, mkoutny@...e.com,
akpm@...ux-foundation.org, hamzamahfooz@...ux.microsoft.com,
apais@...ux.microsoft.com, lance.yang@...ux.dev
Subject: Re: [PATCH v3 24/30] mm: memcontrol: prepare for reparenting LRU
pages for lruvec lock
On 1/18/26 8:44 AM, Shakeel Butt wrote:
> On Fri, Jan 16, 2026 at 05:50:22PM +0800, Qi Zheng wrote:
>>
>>
>> On 1/16/26 5:43 PM, Muchun Song wrote:
>>>
>>>
>>> On 2026/1/14 19:32, Qi Zheng wrote:
>>>> From: Muchun Song <songmuchun@...edance.com>
>>>>
[...]
>>>
>>> It seems that functions marked as `inline` cannot be decorated with
>>> `__acquires`? We’ve had to move these little helpers into `memcontrol.c`
>>> and declare them as extern, but they’re so short that it hardly feels
>>
>> Right, I received a compilation error reported LKP:
>>
>> All errors (new ones prefixed by >>):
>>
>> In file included from crypto/ahash.c:26:
>> In file included from include/net/netlink.h:6:
>> In file included from include/linux/netlink.h:9:
>> In file included from include/net/scm.h:9:
>> In file included from include/linux/security.h:35:
>> In file included from include/linux/bpf.h:32:
>>>> include/linux/memcontrol.h:772:14: error: use of undeclared identifier
>> 'lruvec'
>> 772 | __acquires(&lruvec->lru_lock)
>> | ^~~~~~
>> include/linux/memcontrol.h:773:13: error: use of undeclared identifier
>> 'rcu'
>> 773 | __acquires(rcu)
>> | ^~~
>> include/linux/memcontrol.h:775:14: error: use of undeclared identifier
>> 'lruvec'
>> 775 | __acquires(&lruvec->lru_lock)
>> | ^~~~~~
>> include/linux/memcontrol.h:776:13: error: use of undeclared identifier
>> 'rcu'
>> 776 | __acquires(rcu)
>> | ^~~
>> include/linux/memcontrol.h:779:14: error: use of undeclared identifier
>> 'lruvec'
>> 779 | __acquires(&lruvec->lru_lock)
>> | ^~~~~~
>> include/linux/memcontrol.h:780:13: error: use of undeclared identifier
>> 'rcu'
>> 780 | __acquires(rcu)
>> | ^~~
>> include/linux/memcontrol.h:1507:13: error: use of undeclared identifier
>> 'rcu'
>> 1507 | __acquires(rcu)
>> | ^~~
>> include/linux/memcontrol.h:1515:13: error: use of undeclared identifier
>> 'rcu'
>> 1515 | __releases(rcu)
>> | ^~~
>> include/linux/memcontrol.h:1523:13: error: use of undeclared identifier
>> 'rcu'
>> 1523 | __releases(rcu)
>> | ^~~
>> include/linux/memcontrol.h:1532:13: error: use of undeclared identifier
>> 'rcu'
>> 1532 | __releases(rcu)
>>
>> And I reproduced this error with the following configuration:
>>
>> 1. enable CONFIG_WARN_CONTEXT_ANALYSIS_ALL
>> 2. make CC=clang bzImage (clang version >= 22)
>>
>>> worth the trouble. My own inclination is to drop the `__acquires`
>>> annotations—mainly for performance reasons.
>>
>> If no one else objects, I will drop __acquires/__releases in the next
>> version.
>>
>
> If you drop these annotations from header file and keep in the C file,
> do you still get the compilation error?
I did test it this way, and it does fix the compilation error, but
Muchun thinks these functions are very simple and there's no need to put
them in a C file.
>
Powered by blists - more mailing lists