From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4D93612D215 for ; Tue, 4 Jun 2024 21:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717534831; cv=none; b=JwY+/9l9Yis04e9v+zrTbSZGgId6kqIxbhqrr80XFHqscVkI5kuEsUUKqzt+Txs6fxrIwJLcUxdig0adPXkys40HRLJYco/rLQ0KHUGF11kKVECbcxMa/PDkpVAAvIp2ihrUJLZFsk7PcybmNA7b+S7FLjBT4U2DDnp/muXBI+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717534831; c=relaxed/simple; bh=y2QXvMKu+toawTwirI1umsvW2EK6ZKNHpsp7PVAKxNs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=O0NKH0jyBlssEIhQDHsHpX+h6Ch/yQZlOw/ct1RwZJSdKVkY7w3OXpW8ChVz2PBFfbxTEGSLtjwCmhXOkE7SY3LeMl/xtYXuruJiwxq/3gPDUiJHGuFf/6xogVuSfpJtAc7xUAd5c5aidfLDW+G0dh9iyiyehmb7KTrUbn8Ml2g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X6SZkmnf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X6SZkmnf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02085C2BBFC; Tue, 4 Jun 2024 21:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717534831; bh=y2QXvMKu+toawTwirI1umsvW2EK6ZKNHpsp7PVAKxNs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=X6SZkmnfZNgOG3Y3weWs3ETi/VO+/8FSLGaEoUwWuqLXTY+QWWASCFl7GDG8ZuDYY WUGo/nq/1yyD6/1E9RZwQ0gQNaw7wvYTOxdctLnUUvGc8e8UBk70GAHvtAtllUogFZ 8w8QyXtLYb6/U3wSGLRWhHL6h6bXtvRpsKtHn6uAZTsmwIBmjp3dJqYF0ntVRjq5OP Q0PXMqPXX4Bm3KwVcHMW9SIf4aL+HFzr/sMZIy0N4mn43ZTCOpKn8j3qdcbmOH25eJ QfIKgwYun7772uIhfxPV5HsYtwifcSZ6P8JqKO8hMiS6sGhhFnQkOGCJ0uDa0U8ZJJ UdLaDsEIykCJg== Message-ID: Date: Tue, 4 Jun 2024 23:00:27 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: kswapd0: page allocation failure: order:0, mode:0x820(GFP_ATOMIC), nodemask=(null),cpuset=/,mems_allowed=0 (Kernel v6.5.9, 32bit ppc) Content-Language: en-US To: Yosry Ahmed , Yu Zhao Cc: Erhard Furtner , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Johannes Weiner , Nhat Pham , Chengming Zhou , Sergey Senozhatsky , Minchan Kim References: <20240508202111.768b7a4d@yea> <20240515224524.1c8befbe@yea> <20240602200332.3e531ff1@yea> <20240604001304.5420284f@yea> <20240604134458.3ae4396a@yea> From: "Vlastimil Babka (SUSE)" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 6/4/24 8:01 PM, Yosry Ahmed wrote: > On Tue, Jun 4, 2024 at 10:54 AM Yu Zhao wrote: >> There was a lot of user memory in the DMA zone. So at a point the >> highmem zone was full and allocation fallback happened. >> >> The problem with zone fallback is that recent allocations go into >> lower zones, meaning they are further back on the LRU list. This >> applies to both user memory and zsmalloc memory -- the latter has a >> writeback LRU. On top of this, neither the zswap shrinker nor the >> zsmalloc shrinker (compaction) is zone aware. So page reclaim might >> have trouble hitting the right target zone. > > I see what you mean. In this case, yeah I think the internal > fragmentation in the zsmalloc pools may be the reason behind the > problem. > > How many CPUs does this machine have? I am wondering if 32 can be an > overkill for small machines, perhaps the number of pools should be > max(nr_cpus, 32)? > > Alternatively, the number of pools should scale with the memory size > in some way, such that we only increase fragmentation when it's > tolerable. Sounds like a good idea to me, maybe a combination of both. No point in trying to scale if there's no benefit and only downside of more memory consumption.