From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [Patch v2 1/2] mm/ksm: get mm_slot by mm_slot_entry() when slot is !NULL
Date: Mon, 22 Sep 2025 04:02:28 +0800 [thread overview]
Message-ID: <202509220348.96Aa4hMs-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250919071244.17020-2-richard.weiyang@gmail.com>
References: <20250919071244.17020-2-richard.weiyang@gmail.com>
TO: Wei Yang <richard.weiyang@gmail.com>
Hi Wei,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.17-rc6 next-20250919]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Wei-Yang/mm-ksm-get-mm_slot-by-mm_slot_entry-when-slot-is-NULL/20250919-151547
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20250919071244.17020-2-richard.weiyang%40gmail.com
patch subject: [Patch v2 1/2] mm/ksm: get mm_slot by mm_slot_entry() when slot is !NULL
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: microblaze-randconfig-r073-20250921 (https://download.01.org/0day-ci/archive/20250922/202509220348.96Aa4hMs-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 12.5.0
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202509220348.96Aa4hMs-lkp@intel.com/
New smatch warnings:
mm/ksm.c:2959 __ksm_exit() error: uninitialized symbol 'mm_slot'.
Old smatch warnings:
arch/microblaze/include/asm/thread_info.h:85 current_thread_info() error: uninitialized symbol 'sp'.
vim +/mm_slot +2959 mm/ksm.c
f8af4da3b4c14e Hugh Dickins 2009-09-21 2921
1c2fb7a4c2ca7a Andrea Arcangeli 2009-09-21 2922 void __ksm_exit(struct mm_struct *mm)
f8af4da3b4c14e Hugh Dickins 2009-09-21 2923 {
21fbd59136e077 Qi Zheng 2022-08-31 2924 struct ksm_mm_slot *mm_slot;
58730ab6c7cab4 Qi Zheng 2022-08-31 2925 struct mm_slot *slot;
9ba6929480088a Hugh Dickins 2009-09-21 2926 int easy_to_free = 0;
cd551f97519d35 Hugh Dickins 2009-09-21 2927
31dbd01f314364 Izik Eidus 2009-09-21 2928 /*
9ba6929480088a Hugh Dickins 2009-09-21 2929 * This process is exiting: if it's straightforward (as is the
9ba6929480088a Hugh Dickins 2009-09-21 2930 * case when ksmd was never running), free mm_slot immediately.
9ba6929480088a Hugh Dickins 2009-09-21 2931 * But if it's at the cursor or has rmap_items linked to it, use
c1e8d7c6a7a682 Michel Lespinasse 2020-06-08 2932 * mmap_lock to synchronize with any break_cows before pagetables
9ba6929480088a Hugh Dickins 2009-09-21 2933 * are freed, and leave the mm_slot on the list for ksmd to free.
9ba6929480088a Hugh Dickins 2009-09-21 2934 * Beware: ksm may already have noticed it exiting and freed the slot.
31dbd01f314364 Izik Eidus 2009-09-21 2935 */
9ba6929480088a Hugh Dickins 2009-09-21 2936
cd551f97519d35 Hugh Dickins 2009-09-21 2937 spin_lock(&ksm_mmlist_lock);
58730ab6c7cab4 Qi Zheng 2022-08-31 2938 slot = mm_slot_lookup(mm_slots_hash, mm);
de4014f857d062 Wei Yang 2025-09-19 2939 if (slot) {
58730ab6c7cab4 Qi Zheng 2022-08-31 2940 mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot);
de4014f857d062 Wei Yang 2025-09-19 2941 if (ksm_scan.mm_slot != mm_slot) {
6514d511dbe5a7 Hugh Dickins 2009-12-14 2942 if (!mm_slot->rmap_list) {
58730ab6c7cab4 Qi Zheng 2022-08-31 2943 hash_del(&slot->hash);
58730ab6c7cab4 Qi Zheng 2022-08-31 2944 list_del(&slot->mm_node);
9ba6929480088a Hugh Dickins 2009-09-21 2945 easy_to_free = 1;
9ba6929480088a Hugh Dickins 2009-09-21 2946 } else {
58730ab6c7cab4 Qi Zheng 2022-08-31 2947 list_move(&slot->mm_node,
58730ab6c7cab4 Qi Zheng 2022-08-31 2948 &ksm_scan.mm_slot->slot.mm_node);
9ba6929480088a Hugh Dickins 2009-09-21 2949 }
9ba6929480088a Hugh Dickins 2009-09-21 2950 }
de4014f857d062 Wei Yang 2025-09-19 2951 }
cd551f97519d35 Hugh Dickins 2009-09-21 2952 spin_unlock(&ksm_mmlist_lock);
cd551f97519d35 Hugh Dickins 2009-09-21 2953
9ba6929480088a Hugh Dickins 2009-09-21 2954 if (easy_to_free) {
58730ab6c7cab4 Qi Zheng 2022-08-31 2955 mm_slot_free(mm_slot_cache, mm_slot);
12e423ba4eaed7 Lorenzo Stoakes 2025-08-12 2956 mm_flags_clear(MMF_VM_MERGE_ANY, mm);
12e423ba4eaed7 Lorenzo Stoakes 2025-08-12 2957 mm_flags_clear(MMF_VM_MERGEABLE, mm);
9ba6929480088a Hugh Dickins 2009-09-21 2958 mmdrop(mm);
9ba6929480088a Hugh Dickins 2009-09-21 @2959 } else if (mm_slot) {
d8ed45c5dcd455 Michel Lespinasse 2020-06-08 2960 mmap_write_lock(mm);
d8ed45c5dcd455 Michel Lespinasse 2020-06-08 2961 mmap_write_unlock(mm);
9ba6929480088a Hugh Dickins 2009-09-21 2962 }
739100c88f49a6 Stefan Roesch 2023-02-10 2963
739100c88f49a6 Stefan Roesch 2023-02-10 2964 trace_ksm_exit(mm);
31dbd01f314364 Izik Eidus 2009-09-21 2965 }
31dbd01f314364 Izik Eidus 2009-09-21 2966
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Wei Yang <richard.weiyang@gmail.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev
Subject: Re: [Patch v2 1/2] mm/ksm: get mm_slot by mm_slot_entry() when slot is !NULL
Date: Mon, 22 Sep 2025 08:58:19 +0300 [thread overview]
Message-ID: <202509220348.96Aa4hMs-lkp@intel.com> (raw)
Message-ID: <20250922055819.YKuBxvmiP1yrmSgpZ0Wd7A9WoX38a7C4qiV70THcmCI@z> (raw)
In-Reply-To: <20250919071244.17020-2-richard.weiyang@gmail.com>
Hi Wei,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Wei-Yang/mm-ksm-get-mm_slot-by-mm_slot_entry-when-slot-is-NULL/20250919-151547
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20250919071244.17020-2-richard.weiyang%40gmail.com
patch subject: [Patch v2 1/2] mm/ksm: get mm_slot by mm_slot_entry() when slot is !NULL
config: microblaze-randconfig-r073-20250921 (https://download.01.org/0day-ci/archive/20250922/202509220348.96Aa4hMs-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 12.5.0
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>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202509220348.96Aa4hMs-lkp@intel.com/
New smatch warnings:
mm/ksm.c:2959 __ksm_exit() error: uninitialized symbol 'mm_slot'.
vim +/mm_slot +2959 mm/ksm.c
1c2fb7a4c2ca7a Andrea Arcangeli 2009-09-21 2922 void __ksm_exit(struct mm_struct *mm)
f8af4da3b4c14e Hugh Dickins 2009-09-21 2923 {
21fbd59136e077 Qi Zheng 2022-08-31 2924 struct ksm_mm_slot *mm_slot;
58730ab6c7cab4 Qi Zheng 2022-08-31 2925 struct mm_slot *slot;
9ba6929480088a Hugh Dickins 2009-09-21 2926 int easy_to_free = 0;
cd551f97519d35 Hugh Dickins 2009-09-21 2927
31dbd01f314364 Izik Eidus 2009-09-21 2928 /*
9ba6929480088a Hugh Dickins 2009-09-21 2929 * This process is exiting: if it's straightforward (as is the
9ba6929480088a Hugh Dickins 2009-09-21 2930 * case when ksmd was never running), free mm_slot immediately.
9ba6929480088a Hugh Dickins 2009-09-21 2931 * But if it's at the cursor or has rmap_items linked to it, use
c1e8d7c6a7a682 Michel Lespinasse 2020-06-08 2932 * mmap_lock to synchronize with any break_cows before pagetables
9ba6929480088a Hugh Dickins 2009-09-21 2933 * are freed, and leave the mm_slot on the list for ksmd to free.
9ba6929480088a Hugh Dickins 2009-09-21 2934 * Beware: ksm may already have noticed it exiting and freed the slot.
31dbd01f314364 Izik Eidus 2009-09-21 2935 */
9ba6929480088a Hugh Dickins 2009-09-21 2936
cd551f97519d35 Hugh Dickins 2009-09-21 2937 spin_lock(&ksm_mmlist_lock);
58730ab6c7cab4 Qi Zheng 2022-08-31 2938 slot = mm_slot_lookup(mm_slots_hash, mm);
de4014f857d062 Wei Yang 2025-09-19 2939 if (slot) {
58730ab6c7cab4 Qi Zheng 2022-08-31 2940 mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot);
de4014f857d062 Wei Yang 2025-09-19 2941 if (ksm_scan.mm_slot != mm_slot) {
6514d511dbe5a7 Hugh Dickins 2009-12-14 2942 if (!mm_slot->rmap_list) {
58730ab6c7cab4 Qi Zheng 2022-08-31 2943 hash_del(&slot->hash);
58730ab6c7cab4 Qi Zheng 2022-08-31 2944 list_del(&slot->mm_node);
9ba6929480088a Hugh Dickins 2009-09-21 2945 easy_to_free = 1;
9ba6929480088a Hugh Dickins 2009-09-21 2946 } else {
58730ab6c7cab4 Qi Zheng 2022-08-31 2947 list_move(&slot->mm_node,
58730ab6c7cab4 Qi Zheng 2022-08-31 2948 &ksm_scan.mm_slot->slot.mm_node);
9ba6929480088a Hugh Dickins 2009-09-21 2949 }
9ba6929480088a Hugh Dickins 2009-09-21 2950 }
de4014f857d062 Wei Yang 2025-09-19 2951 }
mm_slot isn't initialized on the else path
cd551f97519d35 Hugh Dickins 2009-09-21 2952 spin_unlock(&ksm_mmlist_lock);
cd551f97519d35 Hugh Dickins 2009-09-21 2953
9ba6929480088a Hugh Dickins 2009-09-21 2954 if (easy_to_free) {
58730ab6c7cab4 Qi Zheng 2022-08-31 2955 mm_slot_free(mm_slot_cache, mm_slot);
12e423ba4eaed7 Lorenzo Stoakes 2025-08-12 2956 mm_flags_clear(MMF_VM_MERGE_ANY, mm);
12e423ba4eaed7 Lorenzo Stoakes 2025-08-12 2957 mm_flags_clear(MMF_VM_MERGEABLE, mm);
9ba6929480088a Hugh Dickins 2009-09-21 2958 mmdrop(mm);
9ba6929480088a Hugh Dickins 2009-09-21 @2959 } else if (mm_slot) {
^^^^^^^
uninitialized
d8ed45c5dcd455 Michel Lespinasse 2020-06-08 2960 mmap_write_lock(mm);
d8ed45c5dcd455 Michel Lespinasse 2020-06-08 2961 mmap_write_unlock(mm);
9ba6929480088a Hugh Dickins 2009-09-21 2962 }
739100c88f49a6 Stefan Roesch 2023-02-10 2963
739100c88f49a6 Stefan Roesch 2023-02-10 2964 trace_ksm_exit(mm);
31dbd01f314364 Izik Eidus 2009-09-21 2965 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev reply other threads:[~2025-09-21 20:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 7:12 [Patch v2 0/2] mm_slot: fix the usage of mm_slot_entry Wei Yang
2025-09-19 7:12 ` [Patch v2 1/2] mm/ksm: get mm_slot by mm_slot_entry() when slot is !NULL Wei Yang
2025-09-19 7:24 ` David Hildenbrand
2025-09-19 7:38 ` Dev Jain
2025-09-19 7:44 ` Lance Yang
2025-09-21 20:02 ` kernel test robot [this message]
2025-09-22 5:58 ` Dan Carpenter
2025-09-22 8:03 ` Wei Yang
2025-09-19 7:12 ` [Patch v2 2/2] mm/khugepaged: remove definition of struct khugepaged_mm_slot Wei Yang
2025-09-19 7:36 ` David Hildenbrand
2025-09-22 13:17 ` Nico Pache
2025-09-20 11:52 ` SeongJae Park
2025-09-20 12:29 ` Wei Yang
2025-09-20 13:41 ` SeongJae Park
2025-09-21 15:08 ` Wei Yang
2025-09-22 9:33 ` SeongJae Park
2025-09-21 16:07 ` Lance Yang
2025-09-22 0:28 ` Wei Yang
2025-09-22 9:37 ` SeongJae Park
-- strict thread matches above, loose matches on Subject: below --
2025-09-23 1:47 [Patch v2 1/2] mm/ksm: get mm_slot by mm_slot_entry() when slot is !NULL kernel test robot
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=202509220348.96Aa4hMs-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@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.