linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Balbir Singh <balbirs@nvidia.com>
To: kernel test robot <lkp@intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [akpm-mm:mm-unstable 169/175] ld.lld: error: undefined symbol: shmem_uncharge
Date: Thu, 20 Nov 2025 12:14:16 +1100	[thread overview]
Message-ID: <90b9f17d-3b5e-4304-96be-8372928bdced@nvidia.com> (raw)
In-Reply-To: <aac99648-4db5-411a-95da-f8d5daaae17e@nvidia.com>

On 11/20/25 09:35, Balbir Singh wrote:
> On 11/20/25 08:26, kernel test robot wrote:
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
>> head:   102494e6776f316b6cf2924976681d790f278cf1
>> commit: 9a655bd0773b41af6d8515502de102544f3ec4c1 [169/175] mm-huge_memoryc-introduce-folio_split_unmapped-v2
>> config: i386-buildonly-randconfig-002-20251119 (https://download.01.org/0day-ci/archive/20251120/202511200534.o4hsMNEt-lkp@intel.com/config)
>> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251120/202511200534.o4hsMNEt-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/202511200534.o4hsMNEt-lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>>>> ld.lld: error: undefined symbol: shmem_uncharge
>>    >>> referenced by huge_memory.c:4053 (mm/huge_memory.c:4053)
>>    >>>               mm/huge_memory.o:(__folio_split) in archive vmlinux.a
>>
> 
> On first glance it seems a bit strange since I did not change the use of shmem_uncharge, the
> computation of nr_shmem_dropped did change. I see the config has CONFIG_SHMEM not set, I wonder
> why this triggers with my changes only.
> 
> I've tried reproducing with clang-21 and the provided configuration without any success.
> My command line was CC=clang-21 and LD=ld.lld-21, but I am going to try with the script mentioned
> 

I've done more testing and followed the instructions provided to reproduce the problem
with the provided config (CONFIG_SHMEM=n)

1. I cannot reproduce the issue with COMPILER=clang-21
2. I can reproduce the issue with COMPILER=clang-20

Turns out the compiler does not like my change because it can no longer predict if nr_shmem_dropped
is 0 and thus optimize out the call to shmem_uncharge(), which it did prior to the change

Looks like I need to use

       if (shmem_mapping(mapping) && nr_shmem_dropped)
                shmem_uncharge(mapping->host, nr_shmem_dropped);


Fun times :)
Balbir





      reply	other threads:[~2025-11-20  1:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 21:26 kernel test robot
2025-11-19 22:35 ` Balbir Singh
2025-11-20  1:14   ` Balbir Singh [this message]

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=90b9f17d-3b5e-4304-96be-8372928bdced@nvidia.com \
    --to=balbirs@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox