Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp610854lqj; Sun, 2 Jun 2024 13:39:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWC1x4eXl9z7fAB8B2pSwZ+JNgd5OmPVO0p7Bf3MxITAkZEFjo+8PocXg0xzt+CFCcHHBZBPQU3G4a/eSNMwUJLN77/jqX9H40jd1IdQQ== X-Google-Smtp-Source: AGHT+IE3jTelXkG/a8HxOcmcY9WfNEHNCsZx9IWED05WfEwSc2oBKNMQaRYXacA81GtbLMlQQjAD X-Received: by 2002:a05:620a:47dd:b0:792:8d34:a9ba with SMTP id af79cd13be357-794f4fd4b04mr1192223785a.24.1717360748091; Sun, 02 Jun 2024 13:39:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717360748; cv=pass; d=google.com; s=arc-20160816; b=c+P91Qoio+146uVIceFB+k9E1jFHt8diu93BQ2RKxq1eFy5XU+3RbADn2zXI94ReZB f71WMt0Urv/7egeolZ7yYuiWOclFpIVWJcIxSZ+KsTZ6PbyLkqRxY/sYNwg9FLZBxOfc 2ABUkgGu2g5iinr4jQlMCK3Jv2C3LxAHa616LCh4TtuYCuNd9YYCZ+a39yJf0hcSHIUl 2jLGDBgEGvsHUVCkOCn/KIxQtiISaTQ2HCth33GEc+UdSVOK5auVgtHZH3cDOgdtk87u 2v7Edn55+gjbRrjxqD36tOsgTPjRBJyF26vA6ecDw8YYWAUezY5VMIqGW870FQo1AVbO dNGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=AfldORuTjlVpAnJ3Ucw4knFWPlGKfdDgSo69+8PCJyE=; fh=oERTZVGVoB+eJHqQWeAs8tqyg3MtobatzZKPUT+PdEo=; b=Q7zaLzRN4XOFtqGnoi/GUGkqJ4qcaoGcCfzxruorZFWbbcHSJhzwQm26M/rJ48SwzG PYURj0Qa2gV4UXxx00djd3Ljnyp/Hu3MrF55/oH82F0U2zKSXP8B8XqQvfncin50Sj3E GCijljSDWNIMl6Hy+cXLjeQwOJP6WUeQXr3tyOAcY77WQJn65cbuKtEeLH4ThO3ZtYkw NoyNJHcXzdYVq2DdwNjgeJ8j+urVPK/5howbR67eLG8jtl5uAiQnLVsEdLhq9G05lews /6Z4u/hDG/vY+6cI3nxQQ+pthYEP5MDYizQ0+t6NrAK7PWUd1yLky4I73kZZO22nw/K+ q/ZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nIE1Ikuw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-198430-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198430-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff23ac09bsi72024591cf.28.2024.06.02.13.39.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 13:39:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198430-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nIE1Ikuw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-198430-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198430-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BF2461C208BF for ; Sun, 2 Jun 2024 20:39:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD1DC770E6; Sun, 2 Jun 2024 20:38:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nIE1Ikuw" Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 653131F60A for ; Sun, 2 Jun 2024 20:38:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717360739; cv=none; b=blTzlYidR20ts5C9osNJgmeZG7L2uWaEQXYoEFYwbw9SvSCtWWn2YcH4ZoZXPUEWMfSe4+DPhra3t9jvzmQRYH7mZKc9Fz+eIusjBbAGc08pcTsa5M1VZvRoDc3UCZVqQrapUMX+y2uKwb+/AXRLEJHthf0ATrPeY70wb/64HsY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717360739; c=relaxed/simple; bh=w7XyO3jj/A8PkJsMTyeQc63HNZlDPGHvtED/1g3cN0U=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=iLdgdxAg4e6rnUb3EeL4pEOPmFGqzwSKFs21vdpw65plFgsO32udaLtNC7QDJRYcO+gyHQlL9GI0L1yCcoENhnA8XiQVixpvs3ZLf7OC05ng6PCFvnDzun3r4B9w5skgudoLyR5gpHlRHQYP5AmmXGqLwbfwa2ZMNflpdi9folY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=nIE1Ikuw; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4213a2acc59so16385e9.1 for ; Sun, 02 Jun 2024 13:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717360736; x=1717965536; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=AfldORuTjlVpAnJ3Ucw4knFWPlGKfdDgSo69+8PCJyE=; b=nIE1IkuwnO+9f5vj75oTJchav2sH0xcWBR8N4DeC5VEaXOARDnRp+K8vnY6Q6n9zI1 U0+p5bKvevcIUpM0SCUOFcKKesJcoXYKSdyGP6aO0KpR3lhYhDmGttiOsAz6FNKvjYt1 UULP5b9leFOriIGH/I7SkX48bYrlCUs7LI2h2ENc6gOkuNhcWwkLZfUT5vAAGNNFckEg iOoJMEb17hKJN1k5B0D308uXDcuWfIGjAU4RsLO9UgwiKZqCCUEg34ojwmLm9dpFO0xy onl7y/T91SzGYc9mIhwXz2NTx3iYlvZuGnC+2LfZe6/HMwM3x+yKFSYIzPihljaMWnTL 7opQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717360736; x=1717965536; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AfldORuTjlVpAnJ3Ucw4knFWPlGKfdDgSo69+8PCJyE=; b=tkSrdIyRAuwTDXlR498SDlHctRkpXRdJb/F2Emky3+PkBn+I8nVY/HDCh2GjsXvi20 FCapU4R94YrUJf+qR5yzlf9RXzuA9vnoTjxCNyxi2/FJPmRpzj6E2tnel5VdNecJfETa mQ6/WmIHxh+TxJnH7KXBJtLzUADu5KigkdGUZxSzesBWKIW5NukgNglKWbXIuewLRv0z bQQfWb2OEOWANErOUcohg5cSPJXO88CpVm2naCWMGTfva9QqWYTAy7NR4XIgh7Ok8hgV 1UEiUmhbkKTaiBlIr8+bE/tltsaXVx+YJ+btrUPwTl/QKlWYUKKIfvaN05hW8DPFPV28 4HJA== X-Forwarded-Encrypted: i=1; AJvYcCUNVJi47or37CxG+5ubbY06jYJOa4CuPv3R9nBdLnAZYZD8F3i2CObvbolslF+vUJE5eGlMEiXQjhxkUsCV6+ngSt9JxKTpgeSnjypq X-Gm-Message-State: AOJu0YyHCqMFRWLPVKOxNeS5gr7xyNy9pC5Ldo6s9cfvwuqAl8ZFzvIj DRWCpBWrAyhZv1dHZs/L0BaaQXkP8HGRJR29VsN8i0p0wx4tFFGgpdg82hSy04kb/2uHr/iT+25 T8l0Bn2pAwtlarp5r0m7lqWcDFo14RsPWGcR7 X-Received: by 2002:a05:600c:1d27:b0:421:328e:99db with SMTP id 5b1f17b1804b1-421358b2ea5mr2182435e9.1.1717360735443; Sun, 02 Jun 2024 13:38:55 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240508202111.768b7a4d@yea> <20240515224524.1c8befbe@yea> <20240602200332.3e531ff1@yea> In-Reply-To: <20240602200332.3e531ff1@yea> From: Yu Zhao Date: Sun, 2 Jun 2024 14:38:18 -0600 Message-ID: Subject: Re: kswapd0: page allocation failure: order:0, mode:0x820(GFP_ATOMIC), nodemask=(null),cpuset=/,mems_allowed=0 (Kernel v6.5.9, 32bit ppc) To: Erhard Furtner Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jun 2, 2024 at 12:03=E2=80=AFPM Erhard Furtner wrote: > > On Sat, 1 Jun 2024 00:01:48 -0600 > Yu Zhao wrote: > > > Hi Erhard, > > > > The OOM kills on both kernel versions seem to be reasonable to me. > > > > Your system has 2GB memory and it uses zswap with zsmalloc (which is > > good since it can allocate from the highmem zone) and zstd/lzo (which > > doesn't matter much). Somehow -- I couldn't figure out why -- it > > splits the 2GB into a 0.25GB DMA zone and a 1.75GB highmem zone: > > > > [ 0.000000] Zone ranges: > > [ 0.000000] DMA [mem 0x0000000000000000-0x000000002fffffff] > > [ 0.000000] Normal empty > > [ 0.000000] HighMem [mem 0x0000000030000000-0x000000007fffffff] > > > > The kernel can't allocate from the highmem zone -- only userspace and > > zsmalloc can. OOM kills were due to the low memory conditions in the > > DMA zone where the kernel itself failed to allocate from. > > > > Do you know a kernel version that doesn't have OOM kills while running > > the same workload? If so, could you send that .config to me? If not, > > could you try disabling CONFIG_HIGHMEM? (It might not help but I'm out > > of ideas at the moment.) > > > > Thanks! > > Hi Yu! > > Thanks for looking into this. > > The reason for this 0.25GB DMA / 1.75GB highmem split is beyond my knowle= dge. I can only tell this much that it's like this at least since kernel v4= .14.x (dmesg of an old bugreport of mine at https://bugzilla.kernel.org/sho= w_bug.cgi?id=3D201723), I guess earlier kernel versions too. > > Without CONFIG_HIGHMEM the memory layout looks like this: > > Total memory =3D 768MB; using 2048kB for hash table > [...] > Top of RAM: 0x30000000, Total RAM: 0x30000000 > Memory hole size: 0MB > Zone ranges: > DMA [mem 0x0000000000000000-0x000000002fffffff] > Normal empty > Movable zone start for each node > Early memory node ranges > node 0: [mem 0x0000000000000000-0x000000002fffffff] > Initmem setup node 0 [mem 0x0000000000000000-0x000000002fffffff] > percpu: Embedded 29 pages/cpu s28448 r8192 d82144 u118784 > pcpu-alloc: s28448 r8192 d82144 u118784 alloc=3D29*4096 > pcpu-alloc: [0] 0 [0] 1 > Kernel command line: ro root=3D/dev/sda5 slub_debug=3DFZP page_poison=3D1= netconsole=3D6666@192.168.2.8/eth0,6666@192.168.2.3/A8:A1:59:16:4F:EA debu= g > Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear) > Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear) > Built 1 zonelists, mobility grouping on. Total pages: 194880 > mem auto-init: stack:all(pattern), heap alloc:off, heap free:off > Kernel virtual memory layout: > * 0xffbdf000..0xfffff000 : fixmap > * 0xff8f4000..0xffbdf000 : early ioremap > * 0xf1000000..0xff8f4000 : vmalloc & ioremap > * 0xb0000000..0xc0000000 : modules > Memory: 761868K/786432K available (7760K kernel code, 524K rwdata, 4528K = rodata, 1100K init, 253K bss, 24564K reserved, 0K cma-reserved) > [...] > > With only 768 MB RAM and 2048K hashtable I get pretty much the same "kswa= pd0: page allocation failure: order:0, mode:0xcc0(GFP_KERNEL),nodemask=3D(n= ull),cpuset=3D/,mems_allowed=3D0" as with the HIGHMEM enabled kernel at > running "stress-ng --vm 2 --vm-bytes 1930M --verify -v". > > I tried the workload on v6.6.32 LTS where the issue shows up too. But v6.= 1.92 LTS seems ok! Triple checked v6.1.92 to be sure. > > Attached please find kernel v6.9.3 dmesg (without HIGHMEM) and kernel v6.= 1.92 .config. Thanks. I compared the .config between v6.8.9 (you attached previously) and v6.1.92 -- I didn't see any major differences (both have ZONE_DMA, HIGHMEM, MGLRU and zswap/zsmalloc). Either there is something broken between v6.1.92 and v6.6.32 (as you mentioned above), or it's just a kernel allocation bloat which puts the DMA zone (0.25GB) under too heavy pressure. The latter isn't uncommon when upgrading to a newer version of the kernel. Could you please attach the dmesg from v6.1.92? I want to compare the dmegs between the two kernel versions as well -- that might provide some hints.