From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0100EC25B75 for ; Thu, 6 Jun 2024 12:08:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 899B86B00A4; Thu, 6 Jun 2024 08:08:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 848936B00A9; Thu, 6 Jun 2024 08:08:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E9EC6B00AA; Thu, 6 Jun 2024 08:08:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 51A5A6B00A4 for ; Thu, 6 Jun 2024 08:08:47 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 04D23160238 for ; Thu, 6 Jun 2024 12:08:46 +0000 (UTC) X-FDA: 82200342294.14.CBFBEFB Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by imf03.hostedemail.com (Postfix) with ESMTP id 44E2D20006 for ; Thu, 6 Jun 2024 12:08:43 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=ellerman.id.au header.s=201909 header.b="gXitfN/C"; spf=pass (imf03.hostedemail.com: domain of mpe@ellerman.id.au designates 150.107.74.76 as permitted sender) smtp.mailfrom=mpe@ellerman.id.au; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717675725; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jf6I6xPOoFmyPi+Dvj7dyL+auQmhBkfhs3JRM5ezBbA=; b=h8Kl+g0fDRZ9yjah+iPR10qGWHZxjY2Qa/qHaH2LhObqWuQyt4M+jq3ir3VA3D3LUnSiIN BlTpFsAWHuVeLxPXKu7i+vWS3qZ2HIlStM15tJ/r/8gHkiugcyvQwmJCgIYJqsPeP8diPh zKdsHrgdVVLVgGhkV4pUb9ypOVtAMM0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717675725; a=rsa-sha256; cv=none; b=CcmgzUyBeQfPmsCSn6MRHJ6ht4ujZVpk2EuSu6IlktReCSb8AjqPmkgbne+m0eH6TMtJ6i nYvPIb8JAS7Rpji03OfNMd2mse4q7P6pfR3yz2QkKpZDPUPfIRrsLMIztfwy1zfCDh4Cul TWB9ZB/Bh3cZblvk8WGvN+2SdFE/9Zk= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=ellerman.id.au header.s=201909 header.b="gXitfN/C"; spf=pass (imf03.hostedemail.com: domain of mpe@ellerman.id.au designates 150.107.74.76 as permitted sender) smtp.mailfrom=mpe@ellerman.id.au; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1717675720; bh=jf6I6xPOoFmyPi+Dvj7dyL+auQmhBkfhs3JRM5ezBbA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=gXitfN/C4e3dhal6n8P5VnzgZuvle7giCi3LvyFeLxuJfpTDRTz35noIN9yVgbDES 48B4/WeESE4DDuEoUIrRpen03CwtCvBPwfmTFYAJQq+jZATeF7YMMr+DA2IIOr5sh/ O1Hws05lhjiKo4w9wlcz0qwuUnEPJA0k7hgZaOHJ5+lz9E0L3y6s/+bPcdTFMZdjPG uTjRg1iD8qkEJYoOMb68QdTXan46rc3gSybL/dYKghoxHFrnKo90g5DTmEw81Q0nlb 202ipDiC1fov69efOflXwHU5B1S++26LAkTzl1tLsWy+APhsI6QWZKTzV9vpyFuTNQ XOVsss868Z6yQ== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Vw35N4Rfbz4wc5; Thu, 6 Jun 2024 22:08:40 +1000 (AEST) From: Michael Ellerman To: Yu Zhao , Erhard Furtner Cc: David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: kswapd0: page allocation failure: order:0, mode:0x820(GFP_ATOMIC), nodemask=(null),cpuset=/,mems_allowed=0 (Kernel v6.5.9, 32bit ppc) In-Reply-To: References: <20240508202111.768b7a4d@yea> <20240515224524.1c8befbe@yea> <45fc081c-ee8d-4774-a597-708d2924f812@redhat.com> <87tti6pxxc.fsf@mail.lhotse> Date: Thu, 06 Jun 2024 22:08:40 +1000 Message-ID: <87r0dap92v.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Stat-Signature: 1t6ywgk19sttexk7efwm971xe4ms68cy X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 44E2D20006 X-HE-Tag: 1717675723-950841 X-HE-Meta: U2FsdGVkX19nBONGL9jyZ9FrjQPjaQdYc3GmfwBwmEAQ4JGNDHIgbhEBlDVDQCiDWFN7gvXnyv4Hi0nMMrq0D9eG3SiiwxoWlzUFAWim3cxINwUAJO27006MA+dB7wabhfUvTOFD+W5qgD6szLLbCcehy8OIAXiTGRuCmH79RML46bR+Y1ufXJIgaRfmPxn4vl0Wfmo1nM0zFePKq7TDpGEbNw2aQzc0UkpkKCPMrY0VGR5RP8+896fx5bM1NacLpqvXPz72uMffwhPzud5aF/t9JmSN0yFIJtse4m9TWd1qoGFb6Jwb881NI+591ZGbZ62vxiiyeBIjErgarsBxr3Rh2t5Q/YOhF6FTQgLK4xtNDeMKHfjsXNFnsyjyFjhMMMNdOeC72f6ele4QJPbezisI/akKmufyHwtDVkQ5hDW47Z4xjg5nDyVAk4qA074V3eU1DoE9qt9usGKYNxkOvlQ8yCgKDLVCxivXGhbz20y05a7CyPEQOP2X+hIEAIwIMnIWuKR0YYnqGPFNTzJzJso9sWokd/zh71dXqoA8yUIadHlr22hhGsxPPxtZGapV+wIZjFxqq5lsOz9+ZRs6SdlQwoAljWVcoLd5OOaQZx31RLWLK38BymxBEspAbwRKNmK1H2PzMur5e4aqlpRFhz+nURwyqibKiKfEPQMF8hExWAm7aBsgIKv0Fe5UIAutBq/9X2qUY8B0D48Urfwg0tCp41xeNWRexORgnQFb7YVafeWJ1TJaQyfmReO+LjDh2YPjvUPcXBV3Tfpw6tNTGbFyR4UJW1MztsSeDYXYR2Xp+xw5J9UgLdmlT7fL7d1dsxA1vNwC7yWAySV9EWaevGcyRetelydrMyYW442U4gBIQnUGqoXCSA5iAb6lD3Xb3kbHVpc0ayj0oEueL6CvdqxmtPMP9LPnj0RQ8mbNoz2fCJ71gHnl7ntWVTQ0Tkx7ng4PLCxalOD6asrWgq1 1HbMhWYk bWQFxSo6F/heZ0GHeQK4swgNLd1JSQZQ010wjW66lmMtnqPL6XzQz9k9fKjS+L7v2Qo8+/DPf8zzKoQ5Opwthaq8ueAq2skS7FRFF9P2MZ9FfA5nkfTrLqBpTITJ4CYzvTodYn0Vi164lMaH/Qlb2h17WzHa5e3jVVIMusQKcsBArAiPf8fiCtMH/Omd2U1frP6r47+wX2nuOV5h3IDBvrcoTop5p/OrpeSfj X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Yu Zhao writes: > On Wed, Jun 5, 2024 at 9:12=E2=80=AFPM Michael Ellerman wrote: >> >> David Hildenbrand writes: >> > On 01.06.24 08:01, Yu Zhao wrote: >> >> On Wed, May 15, 2024 at 4:06=E2=80=AFPM Yu Zhao w= rote: >> ... >> >> >> >> 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] >> > >> > That's really odd. But we are messing with "PowerMac3,6", so I don't >> > really know what's right or wrong ... >> >> The DMA zone exists because 9739ab7eda45 ("powerpc: enable a 30-bit >> ZONE_DMA for 32-bit pmac") selects it. >> >> It's 768MB (not 0.25GB) because it's clamped at max_low_pfn: > > Right. (I meant 0.75GB.) > >> #ifdef CONFIG_ZONE_DMA >> max_zone_pfns[ZONE_DMA] =3D min(max_low_pfn, >> 1UL << (zone_dma_bits - PAGE_SHIFT= )); >> #endif >> >> Which comes eventually from CONFIG_LOWMEM_SIZE, which defaults to 768MB. > > I see. I grep'ed VMSPLIT which is used on x86 and arm but apparently > not on powerpc. Those VMSPLIT configs are nice, on powerpc it's all done manually :} >> I think it's 768MB because the user:kernel split is 3G:1G, and then the >> kernel needs some of that 1G virtual space for vmalloc/ioremap/highmem, >> so it splits it 768M:256M. >> >> Then ZONE_NORMAL is empty because it is also limited to max_low_pfn: >> >> max_zone_pfns[ZONE_NORMAL] =3D max_low_pfn; >> >> The rest of RAM is highmem. >> >> So I think that's all behaving as expected, but I don't know 32-bit / >> highmem stuff that well so I could be wrong. > > Yes, the three zones work as intended. > > Erhard, > > Since your system only has 2GB memory, I'd try the 2G:2G split, which > would in theory allow both the kernel and userspace to all memory. > > CONFIG_LOWMEM_SIZE_BOOL=3Dy > CONFIG_LOWMEM_SIZE=3D0x7000000 > > (Michael, please correct me if the above wouldn't work.) It's a bit more complicated, in order to increase LOWMEM_SIZE you need to adjust all the other variables to make space. To get 2G of user virtual space I think you need: CONFIG_ADVANCED_OPTIONS=3Dy CONFIG_LOWMEM_SIZE_BOOL=3Dy CONFIG_LOWMEM_SIZE=3D0x60000000 CONFIG_PAGE_OFFSET_BOOL=3Dy CONFIG_PAGE_OFFSET=3D0x90000000 CONFIG_KERNEL_START_BOOL=3Dy CONFIG_KERNEL_START=3D0x90000000 CONFIG_PHYSICAL_START=3D0x00000000 CONFIG_TASK_SIZE_BOOL=3Dy CONFIG_TASK_SIZE=3D0x80000000 Which results in 1.5GB of lowmem. Or if you want to map all 2G of RAM directly in the kernel without highmem, but limit user virtual space to 1.5G: CONFIG_ADVANCED_OPTIONS=3Dy CONFIG_LOWMEM_SIZE_BOOL=3Dy CONFIG_LOWMEM_SIZE=3D0x80000000 CONFIG_PAGE_OFFSET_BOOL=3Dy CONFIG_PAGE_OFFSET=3D0x70000000 CONFIG_KERNEL_START_BOOL=3Dy CONFIG_KERNEL_START=3D0x70000000 CONFIG_PHYSICAL_START=3D0x00000000 CONFIG_TASK_SIZE_BOOL=3Dy CONFIG_TASK_SIZE=3D0x60000000 You can also reclaim another 256MB of virtual space if you disable CONFIG_MODULES. Those configs do boot on qemu. But I don't have easy access to my 32-bit machine to test if they boot on actual hardware. cheers