From: Michal Hocko <mhocko@suse.com>
To: Haifeng Xu <haifeng.xu@shopee.com>
Cc: roman.gushchin@linux.dev, hannes@cmpxchg.org,
shakeelb@google.com, akpm@linux-foundation.org,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mm/memcontrol: do not tweak node in mem_cgroup_init()
Date: Fri, 16 Jun 2023 10:42:46 +0200 [thread overview]
Message-ID: <ZIwghl18d45vPNpd@dhcp22.suse.cz> (raw)
In-Reply-To: <47119364-30ac-cb57-7fd8-d9aa4b230478@shopee.com>
On Fri 16-06-23 16:28:38, Haifeng Xu wrote:
>
>
> On 2023/6/15 16:14, Michal Hocko wrote:
> > On Thu 15-06-23 07:32:25, Haifeng Xu wrote:
> >> mem_cgroup_init() request for allocations from each possible node, and
> >> it's used to be a problem because NODE_DATA is not allocated for offline
> >> node. Things have already changed since commit 09f49dca570a9 ("mm: handle
> >> uninitialized numa nodes gracefully"), so it's unnecessary to check for
> >> !node_online nodes here.
> >
> > How have you tested this patch?
>
> Start with one empty node:
>
> qemu-system-x86_64 \
> -kernel vmlinux \
> -initrd full.rootfs.cpio.gz \
> -append "console=ttyS0,115200 root=/dev/ram0 nokaslr earlyprintk=serial oops=panic panic_on_warn" \
> -drive format=qcow2,file=vm_disk.qcow2,media=disk,if=ide \
> -enable-kvm \
> -cpu host \
> -m 8G,slots=2,maxmem=16G \
> -smp cores=4,threads=1,sockets=2 \
> -object memory-backend-ram,id=mem0,size=4G \
> -object memory-backend-ram,id=mem1,size=4G \
> -numa node,memdev=mem0,cpus=0-3,nodeid=0 \
> -numa node,memdev=mem1,cpus=4-7,nodeid=1 \
> -numa node,nodeid=2 \
> -net nic,model=virtio,macaddr=52:54:00:12:34:58 \
> -net user \
> -nographic \
> -rtc base=localtime \
> -gdb tcp::6000
>
> Guest state when booting:
> [ 0.048881] NUMA: Node 0 [mem 0x00000000-0x0009ffff] + [mem 0x00100000-0xbfffffff] -> [mem 0x00000000-0xbfffffff]
> [ 0.050489] NUMA: Node 0 [mem 0x00000000-0xbfffffff] + [mem 0x100000000-0x13fffffff] -> [mem 0x00000000-0x13fffffff]
> [ 0.052173] NODE_DATA(0) allocated [mem 0x13fffc000-0x13fffffff]
> [ 0.053164] NODE_DATA(1) allocated [mem 0x23fffa000-0x23fffdfff]
> [ 0.054187] Zone ranges:
> [ 0.054587] DMA [mem 0x0000000000001000-0x0000000000ffffff]
> [ 0.055551] DMA32 [mem 0x0000000001000000-0x00000000ffffffff]
> [ 0.056515] Normal [mem 0x0000000100000000-0x000000023fffffff]
> [ 0.057484] Movable zone start for each node
> [ 0.058149] Early memory node ranges
> [ 0.058705] node 0: [mem 0x0000000000001000-0x000000000009efff]
> [ 0.059679] node 0: [mem 0x0000000000100000-0x00000000bffdffff]
> [ 0.060659] node 0: [mem 0x0000000100000000-0x000000013fffffff]
> [ 0.061649] node 1: [mem 0x0000000140000000-0x000000023fffffff]
> [ 0.062638] Initmem setup node 0 [mem 0x0000000000001000-0x000000013fffffff]
> [ 0.063745] Initmem setup node 1 [mem 0x0000000140000000-0x000000023fffffff]
> [ 0.064855] DMA zone: 158 reserved pages exceeds freesize 0
> [ 0.065746] Initializing node 2 as memoryless
> [ 0.066437] Initmem setup node 2 as memoryless
> [ 0.067132] DMA zone: 158 reserved pages exceeds freesize 0
> [ 0.068037] On node 0, zone DMA: 1 pages in unavailable ranges
> [ 0.068265] On node 0, zone DMA: 97 pages in unavailable ranges
> [ 0.124755] On node 0, zone Normal: 32 pages in unavailable ranges
>
>
> cat /sys/devices/system/node/online
> 0-1
> cat /sys/devices/system/node/possible
> 0-2
Excellent! Please extend the changelog by this information. Feel free to
add
Acked-by: Michal Hocko <mhocko@suse.com>
Thanks!
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2023-06-16 8:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 7:32 Haifeng Xu
2023-06-15 8:14 ` Michal Hocko
2023-06-16 8:28 ` Haifeng Xu
2023-06-16 8:42 ` Michal Hocko [this message]
2023-06-19 13:04 ` [PATCH v2] " Haifeng Xu
2023-06-19 13:12 ` Michal Hocko
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=ZIwghl18d45vPNpd@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=haifeng.xu@shopee.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=roman.gushchin@linux.dev \
--cc=shakeelb@google.com \
/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