linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Mirsad Todorovac <mirsad.todorovac@alu.hr>, linux-kernel@vger.kernel.org
Cc: Zefan Li <lizefan.x@bytedance.com>, Tejun Heo <tj@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Shuah Khan <shuah@kernel.org>,
	cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [BUG] selftests: cgroup: KMEMLEAK in cgroup/test_cpuset_prs.sh
Date: Tue, 27 Feb 2024 17:10:22 -0500	[thread overview]
Message-ID: <d1af171a-49e5-4dcb-987c-c41cf166bac1@redhat.com> (raw)
In-Reply-To: <14915689-27a3-4cd8-80d2-9c30d0c768b6@alu.unizg.hr>

On 2/27/24 14:50, Mirsad Todorovac wrote:
> Hi, everybody,
>
> In the latest vanilla torvalds tree kernel v6.8-rc6-11-g45ec2f5f6ed3 
> on an Ubuntu 23.10 system, there
> KMEMLEAK detected a couple of memory leaks:
>
> Visually it appears like the same leak repeated six times, but I 
> reckoned it might be of importance to
> review them all.
>
> It happened on two boxes, and both have AMD Ryzen processors 7 and 9.
>
> Please find attached the build .config
>
> Best regards,
> Mirsad Todorovac

Yes, you are right. There is a memory leak under certain condition. Will 
post a patch to fix it.

Thanks,
Longman

>
> # cat /sys/kernel/debug/kmemleak [stack decoded]
> unreferenced object 0xffff8d49bd92a720 (size 8):
> comm "test_cpuset_prs", pid 9213, jiffies 4294953562
> hex dump (first 8 bytes):
> 00 00 00 00 00 00 00 00                          ........
> backtrace (crc 0):
> kmemleak_alloc 
> (/home/marvin/linux/kernel/linux_torvalds/mm/kmemleak.c:1045)
> __kmalloc_node 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/kmemleak.h:42 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3817 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3860 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3980 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3988)
> alloc_cpumask_var_node 
> (/home/marvin/linux/kernel/linux_torvalds/lib/cpumask.c:71)
> cpuset_write_resmask 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:643 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:2601 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:3630)
> cgroup_file_write 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cgroup.c:4092)
> kernfs_fop_write_iter 
> (/home/marvin/linux/kernel/linux_torvalds/fs/kernfs/file.c:334)
> vfs_write 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/fs.h:2087 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:497 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:590)
> ksys_write (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:643)
> __x64_sys_write 
> (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:652)
> do_syscall_64 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:52 
> /home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:83)
> entry_SYSCALL_64_after_hwframe 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/entry_64.S:129)
> unreferenced object 0xffff8d49bd92a488 (size 8):
> comm "test_cpuset_prs", pid 9213, jiffies 4294953562
> hex dump (first 8 bytes):
> 00 00 00 00 00 00 00 00                          ........
> backtrace (crc 0):
> kmemleak_alloc 
> (/home/marvin/linux/kernel/linux_torvalds/mm/kmemleak.c:1045)
> __kmalloc_node 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/kmemleak.h:42 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3817 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3860 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3980 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3988)
> alloc_cpumask_var_node 
> (/home/marvin/linux/kernel/linux_torvalds/lib/cpumask.c:71)
> cpuset_write_resmask 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:646 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:2601 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:3630)
> cgroup_file_write 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cgroup.c:4092)
> kernfs_fop_write_iter 
> (/home/marvin/linux/kernel/linux_torvalds/fs/kernfs/file.c:334)
> vfs_write 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/fs.h:2087 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:497 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:590)
> ksys_write (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:643)
> __x64_sys_write 
> (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:652)
> do_syscall_64 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:52 
> /home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:83)
> entry_SYSCALL_64_after_hwframe 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/entry_64.S:129)
> unreferenced object 0xffff8d49bd92a890 (size 8):
> comm "test_cpuset_prs", pid 9213, jiffies 4294953562
> hex dump (first 8 bytes):
> 00 00 00 00 00 00 00 00                          ........
> backtrace (crc 0):
> kmemleak_alloc 
> (/home/marvin/linux/kernel/linux_torvalds/mm/kmemleak.c:1045)
> __kmalloc_node 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/kmemleak.h:42 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3817 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3860 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3980 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3988)
> alloc_cpumask_var_node 
> (/home/marvin/linux/kernel/linux_torvalds/lib/cpumask.c:71)
> cpuset_write_resmask 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:649 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:2601 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:3630)
> cgroup_file_write 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cgroup.c:4092)
> kernfs_fop_write_iter 
> (/home/marvin/linux/kernel/linux_torvalds/fs/kernfs/file.c:334)
> vfs_write 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/fs.h:2087 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:497 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:590)
> ksys_write (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:643)
> __x64_sys_write 
> (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:652)
> do_syscall_64 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:52 
> /home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:83)
> entry_SYSCALL_64_after_hwframe 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/entry_64.S:129)
> unreferenced object 0xffff8d48c12f3720 (size 8):
> comm "test_cpuset_prs", pid 28081, jiffies 4295018483
> hex dump (first 8 bytes):
> 00 00 00 00 00 00 00 00                          ........
> backtrace (crc 0):
> kmemleak_alloc 
> (/home/marvin/linux/kernel/linux_torvalds/mm/kmemleak.c:1045)
> __kmalloc_node 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/kmemleak.h:42 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3817 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3860 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3980 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3988)
> alloc_cpumask_var_node 
> (/home/marvin/linux/kernel/linux_torvalds/lib/cpumask.c:71)
> cpuset_write_resmask 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:643 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:2601 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:3630)
> cgroup_file_write 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cgroup.c:4092)
> kernfs_fop_write_iter 
> (/home/marvin/linux/kernel/linux_torvalds/fs/kernfs/file.c:334)
> vfs_write 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/fs.h:2087 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:497 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:590)
> ksys_write (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:643)
> __x64_sys_write 
> (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:652)
> do_syscall_64 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:52 
> /home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:83)
> entry_SYSCALL_64_after_hwframe 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/entry_64.S:129)
> unreferenced object 0xffff8d48c12f3180 (size 8):
> comm "test_cpuset_prs", pid 28081, jiffies 4295018483
> hex dump (first 8 bytes):
> 00 00 00 00 00 00 00 00                          ........
> backtrace (crc 0):
> kmemleak_alloc 
> (/home/marvin/linux/kernel/linux_torvalds/mm/kmemleak.c:1045)
> __kmalloc_node 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/kmemleak.h:42 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3817 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3860 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3980 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3988)
> alloc_cpumask_var_node 
> (/home/marvin/linux/kernel/linux_torvalds/lib/cpumask.c:71)
> cpuset_write_resmask 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:646 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:2601 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:3630)
> cgroup_file_write 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cgroup.c:4092)
> kernfs_fop_write_iter 
> (/home/marvin/linux/kernel/linux_torvalds/fs/kernfs/file.c:334)
> vfs_write 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/fs.h:2087 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:497 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:590)
> ksys_write (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:643)
> __x64_sys_write 
> (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:652)
> do_syscall_64 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:52 
> /home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:83)
> entry_SYSCALL_64_after_hwframe 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/entry_64.S:129)
> unreferenced object 0xffff8d48c12f3188 (size 8):
> comm "test_cpuset_prs", pid 28081, jiffies 4295018483
> hex dump (first 8 bytes):
> 00 00 00 00 00 00 00 00                          ........
> backtrace (crc 0):
> kmemleak_alloc 
> (/home/marvin/linux/kernel/linux_torvalds/mm/kmemleak.c:1045)
> __kmalloc_node 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/kmemleak.h:42 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3817 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3860 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3980 
> /home/marvin/linux/kernel/linux_torvalds/mm/slub.c:3988)
> alloc_cpumask_var_node 
> (/home/marvin/linux/kernel/linux_torvalds/lib/cpumask.c:71)
> cpuset_write_resmask 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:649 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:2601 
> /home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cpuset.c:3630)
> cgroup_file_write 
> (/home/marvin/linux/kernel/linux_torvalds/kernel/cgroup/cgroup.c:4092)
> kernfs_fop_write_iter 
> (/home/marvin/linux/kernel/linux_torvalds/fs/kernfs/file.c:334)
> vfs_write 
> (/home/marvin/linux/kernel/linux_torvalds/./include/linux/fs.h:2087 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:497 
> /home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:590)
> ksys_write (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:643)
> __x64_sys_write 
> (/home/marvin/linux/kernel/linux_torvalds/fs/read_write.c:652)
> do_syscall_64 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:52 
> /home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/common.c:83)
> entry_SYSCALL_64_after_hwframe 
> (/home/marvin/linux/kernel/linux_torvalds/arch/x86/entry/entry_64.S:129)
>
>
>
>


      reply	other threads:[~2024-02-27 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 19:50 [BUG] selftests: cgroup: KMEMLEAK in cgroup/test_cpuset_prs.sh Mirsad Todorovac
2024-02-27 22:10 ` Waiman Long [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=d1af171a-49e5-4dcb-987c-c41cf166bac1@redhat.com \
    --to=longman@redhat.com \
    --cc=brauner@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mirsad.todorovac@alu.hr \
    --cc=shuah@kernel.org \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).