Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp328765lqt; Thu, 6 Jun 2024 05:08:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHcaCwoANBn+HTyUmJ+Z4okW43ZXVVMGIVP0vKtqJxV+8dJpr4GDxLtNA0FWeKCyeAB4YklBc3DIEJf3Kx0+ZGf/KlatU8X0B2Lp+mQQ== X-Google-Smtp-Source: AGHT+IFLsjv307CALpPakhaMyCuJHwO2PpctZd0IRC777wRn4bTSpuDlWc9DK5CkFnIMFHA9fiaX X-Received: by 2002:a17:906:774e:b0:a69:b5:def2 with SMTP id a640c23a62f3a-a699faa9004mr354063766b.6.1717675732225; Thu, 06 Jun 2024 05:08:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717675732; cv=pass; d=google.com; s=arc-20160816; b=Du/rW7934chxbDAdJHOXjQR9+lRN0S+6MPfgot77tNowtaDG/MYzELZo8Dt5VFNz1L mbH89jr8Ag7L6g0zKLyAcOwU3NZWe4f2v9QSqvh83V67KJSPa1cbHAxQ+VyTlRExLluh 9sMQ7utQFKiCeb7LYdu5gu/JpndzGCdjEpGyts4/xf5ss2Ue9Ho7mo8tvPXeOYqqlR2B 3D84N/JgBBFO4fI7CdegnhlZCJa/ajkzoi8lIagnfA3UgvDvx1TLx20aenalW/o/uTvx bsULgKeZ+1ySD6sU2VENjIBhDbFmqDJERTr+IX4kjeyE3T1Ww/phzeTTBwwLIUrGiwmO dydA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=jf6I6xPOoFmyPi+Dvj7dyL+auQmhBkfhs3JRM5ezBbA=; fh=ODRduAO7OBKlCh6inQC7MB78T/EdJgAcOx43G0/RDF8=; b=GJhQfR4usrO+EKtQhFUJvNRk3NUklyyZB4W2bNJ49/91a1qB7EiPd3J95efN0NP06r hVN2DXFkWHywF3yyUTiUDXZDu1IO5xm8aDZq6nQ41EHjnQWZq0a2C7BpVsrcPSDELejx I6uazn5BXQ7UTxbx4gcHhcXDBYNdWlnsI6xsR8/YbdPW+Ggg/8jDJzTaWvjyG2cNhOwL ghkNuPEdOYQ9WlGiJkv58PTavfK5ZhjjXrNZKZr6EeyuCqyt3NLednrB0OPSr+aAeuFw M3Vg6UkhxLR5Zy9ShI4v/t3yfs9QuK4tht4LZUd+Ye6FF9PAgAJz3y5++5XLfw1lwo60 daMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="gXitfN/C"; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-204229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204229-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c80708667si62824966b.543.2024.06.06.05.08.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 05:08:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="gXitfN/C"; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-204229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204229-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id E8A031F25657 for ; Thu, 6 Jun 2024 12:08:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EEB2195967; Thu, 6 Jun 2024 12:08:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="gXitfN/C" Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 764631667E3 for ; Thu, 6 Jun 2024 12:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717675725; cv=none; b=f/Xg2ZWNkdHcbSxH2xozzMI4GlOjUvRRmPao9a/I1CbZWqYgD96KONpyaHlpNEiXsuhtw3jpHUrilFaEPg4GlId9Hk/bRuG5iPFUhsJzvOPp1qu+NeZigdB1zNTGP8KMKJ6DDE//y2ViV0tzMZuk8zlUK8z1TR8YKkKZbTB5KXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717675725; c=relaxed/simple; bh=Fu+AEkUcVMyHLVaTWPQDbBVIk1ekDPgN5l1iSOVyZiI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=psbi/bf8NnKd5zGyT6HIaK3+1hUgff/cpS2vS9kSTmKzc/6SWeoniuoBcGV8+hgxPMWbQYQmk29YfInrvcA4LPWlTiu8brqGvlkm6CcVbDXZRQt35HorsGM7k+T+nyfkNQ1KK1e+WudNqfJPFMoF1Hx2Oji+i5UF+T8g7UsmrbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=gXitfN/C; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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