[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ac2a03bf-b3e0-a25a-d7bb-99fb55287387@suse.cz>
Date: Mon, 4 Jan 2021 12:34:29 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Arnd Bergmann <arnd@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Nathan Chancellor <natechancellor@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Wei Yang <richard.weiyang@...ux.alibaba.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Dmitry Safonov <0x7f454c46@...il.com>,
Brian Geffon <bgeffon@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com
Subject: Re: [PATCH] mm/mremap: fix BUILD_BUG_ON() error in get_extent
The subject should say BUILD_BUG()
On 12/30/20 4:40 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> clang cannt evaluate this function argument at compile time
> when the function is not inlined, which leads to a link
> time failure:
>
> ld.lld: error: undefined symbol: __compiletime_assert_414
>>>> referenced by mremap.c
>>>> mremap.o:(get_extent) in archive mm/built-in.a
>
> Mark the function as __always_inline to avoid it.
Not sure if it's the ideal fix, maybe just convert it to BUG() instead?
Functions shouldn't really have BUILD_BUG depending on parameters and rely on
inlining to make it work...
> Fixes: 9ad9718bfa41 ("mm/mremap: calculate extent in one place")
I think it's rather this one that introduces the BUILD_BUG() ?
c49dd3401802 ("mm: speedup mremap on 1GB or larger regions")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> mm/mremap.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/mm/mremap.c b/mm/mremap.c
> index c5590afe7165..1cb464a07184 100644
> --- a/mm/mremap.c
> +++ b/mm/mremap.c
> @@ -336,8 +336,9 @@ enum pgt_entry {
> * valid. Else returns a smaller extent bounded by the end of the source and
> * destination pgt_entry.
> */
> -static unsigned long get_extent(enum pgt_entry entry, unsigned long old_addr,
> - unsigned long old_end, unsigned long new_addr)
> +static __always_inline unsigned long get_extent(enum pgt_entry entry,
> + unsigned long old_addr, unsigned long old_end,
> + unsigned long new_addr)
> {
> unsigned long next, extent, mask, size;
>
>
Powered by blists - more mailing lists