Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp255681lqb; Tue, 4 Jun 2024 10:19:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9G1m8AMpjO+z1JwPT6GzixkdEN17fuNLI6qVyDU8k2OgFNAQRpyXvlXsUDwY1PuEaLWBbsycrjpaa2KZbSWRkWZ28w91PschcRFVXSw== X-Google-Smtp-Source: AGHT+IEipnwL1mClvGyZAYtSdurHkKiGSky6V2VaMpK4qJM4cKoZa/VX6s3Ijn3dZKD8frQE7+8u X-Received: by 2002:a05:6358:e823:b0:199:3458:47d1 with SMTP id e5c5f4694b2df-19c6c6af02amr7759355d.11.1717521554602; Tue, 04 Jun 2024 10:19:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717521554; cv=pass; d=google.com; s=arc-20160816; b=R2YbLvzlogB8GorVRqFY5TI0J1hPJIcZ5Kyqx1gCVNL2ItEhsBHIxIycG1pmbadPcd b/1SeIII7+MxW59v8ov4l8J0QD9ba/7WveVNRz9BNmnmlwevKizcAdfGP4tmKG3RjonR Lq1f6uYcVDfYQ1lVqEurrGnaN7SiwpKIMSt7UrVEnr0NheCxP1QTeZYBtLa2VngFbhxW UgvamLwc2SUBJ+vuVAL+IL2O87H2ifMsIM4u76ocPTb09KZqPTDkRHHgWTqfhWDvWiAx vl+8rEygKp9c3sjiA5ooq3FEwag7g+BEMpYX9Rdz+gupceQfXra1u7f2mzg8zoWOWLaG LQeQ== 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=ogohNARcfHl3s69mR1boc+24tgTnFa1tIMowF9fUlWI=; fh=eZzk1oDBSAbJM7Cp8eXEhBvc2wJB/vb33lQCNoOj/t8=; b=o5q54Wjk2978LMymWgakESVd7iKb53+nPdh2EGdkFXI4hCiV+FpfMoTcWx+zy8lQzv 4MHcsxVSrZ6Ip+tj8Rjj2meGlwGHitoriVAlgGTHnYqKf2laf7uv6R2cJFN4v6GorMzV iStt5aQyQhhfm32uabgzvvqFdSlDFlUp7U9ahoj0LPRPoAFxSNh14nPPUR2LIjLpZcDb D10wNCkeI0KjN3LWR3c+9EfRGOrhFaXgUpW2M1rhTVKEa8sudelhSJudQ3/A+hJcjay1 C5kAAfrvjH6b5ZodlLMV0RebgDh2F/KhAEydplbd4jFwf6R2AHxhHY7ChbpMUKfKZeI+ H2Ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=lbs8xtxs; 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-201146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6d78bbf2bacsi417257a12.799.2024.06.04.10.19.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 10:19:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=lbs8xtxs; 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-201146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201146-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1451D2851B9 for ; Tue, 4 Jun 2024 17:19:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AA18148820; Tue, 4 Jun 2024 17:19:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="lbs8xtxs" Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 DD43B13DDAA for ; Tue, 4 Jun 2024 17:19:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717521547; cv=none; b=kj9MCPrP1DklLu30K+xjpiNqyPcFgWZwj+NiSbgbO/ywoOkg7QCCwV6a4O+BlrX95I0H5790vXXQ6joOH4SndwbOQTdkBcrfns9fr8hYhcafYxQmvR5hGfUciTR7/PU/goK+ZqPOPvyFBbon8IdVBDQvnoAEj20HXibo5v/D5I8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717521547; c=relaxed/simple; bh=ogohNARcfHl3s69mR1boc+24tgTnFa1tIMowF9fUlWI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Eyi6DuCxjlfxvx67krAjyuzGHV4QU3WspzP5Q+CXRyaQ3rxFIf0KIqeMMC/zJt4cTvJvVLYOIJeZjuC9Mm3pSUJ1v/u5qkWiio8SW5HTWGN/0ZjVWJmqHYVqc32k12gWPYFOOK+1JKPOEvev1enizOuld5Pjj7A173b0nexby9w= 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=lbs8xtxs; arc=none smtp.client-ip=209.85.128.41 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-f41.google.com with SMTP id 5b1f17b1804b1-42152bb7b81so7885e9.0 for ; Tue, 04 Jun 2024 10:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717521544; x=1718126344; 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=ogohNARcfHl3s69mR1boc+24tgTnFa1tIMowF9fUlWI=; b=lbs8xtxsLup/g9OKsgBuDQ3dDMpyPdOLhBhXLI8ZYPsb7RU1x4VBBX16AzXtleFZJs FWSRlBG24DR730uFHHfgLH1ZH+G/FCJq2tFQkwCYvjAq/BX7slklA5qCJq894WyDP9Lq VgzqlKAOX61cGk9P6bg5qElWWl/8S1Ipa3dd+IHdUzPvQUS/aYQ+/lss0zktYp0w6qxr ltIs/ysc2SrryhRVgqQsa/7dGbVF0CKC99XjiYRaOvo0h5EGsBgiQvYcTjqRBLGhHm17 FCfWxUKS9fWx8ncoe/Z+zj4H3ylzsaFb/lHrlwaFFQj8+NBs+5601e0T9kgqhv+0fHP9 w+4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717521544; x=1718126344; 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=ogohNARcfHl3s69mR1boc+24tgTnFa1tIMowF9fUlWI=; b=OK1SsT6XVLRegtyOMpo1rDid/GIi8dk/en1EjUhzdypPSsIBFMI96oVnja9HxTYlCO Rog6kXsQ6bxujJZ6DgA+UEzmrm+orncNBcD385Z4VO98NEi5h2FsPAQWp7gR5PjCVHnG +xdbWhNoKiTwyvU2gKRPIRLNXiABZCmcE1SgGG1NuOVRbDTb9FfqLCBbOn+kjnoQ4FnV 0im5ilN9sFmhd4voSTz2a34hkxiLd8PWKjbHuWLjdLV0eT3dmOLdi7klf9T8yheaQfI2 98Gz3RKbt/eCFWQjXoMfzxzDZqZemDeSyk2aOFm83sdP9xK3ujqaI0Zyym3AXLntQlvY ISeQ== X-Forwarded-Encrypted: i=1; AJvYcCW3ptCoAnd4sIh7XgtcYFQOuHKSNQQd4njvEjRt2YkROjUONQeWT9eP1Qdp28sVN/9W1v6G+WFVPH+r/WrhquXP5dHKFkrvK+F/imNu X-Gm-Message-State: AOJu0YzwpLTiEpluff45zZAk3JvWJHHtStQjYKdDT+Mi3i6ePOMpACsN A3sRT7+tSiZK7NEYMqcR788HGzXWB4dVPS6GW2yEKTA8zCeom98boC15fQmytQfwCIx9vYlFKYb hfHONS9UkdqSS1RknWs5qTMt3RS7JePQhdXkd X-Received: by 2002:a7b:c8d7:0:b0:41b:4c6a:de6d with SMTP id 5b1f17b1804b1-4214b21954cmr2630725e9.5.1717521543952; Tue, 04 Jun 2024 10:19:03 -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> <20240604001304.5420284f@yea> <20240604134458.3ae4396a@yea> In-Reply-To: From: Yu Zhao Date: Tue, 4 Jun 2024 11:18:25 -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, Johannes Weiner , Nhat Pham , Chengming Zhou , Sergey Senozhatsky , Minchan Kim , Yosry Ahmed Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 4, 2024 at 10:12=E2=80=AFAM Yosry Ahmed = wrote: > > On Tue, Jun 4, 2024 at 4:45=E2=80=AFAM Erhard Furtner wrote: > > > > On Mon, 3 Jun 2024 16:24:02 -0700 > > Yosry Ahmed wrote: > > > > > Thanks for bisecting. Taking a look at the thread, it seems like you > > > have a very limited area of memory to allocate kernel memory from. On= e > > > possible reason why that commit can cause an issue is because we will > > > have multiple instances of the zsmalloc slab caches 'zspage' and > > > 'zs_handle', which may contribute to fragmentation in slab memory. > > > > > > Do you have /proc/slabinfo from a good and a bad run by any chance? > > > > > > Also, could you check if the attached patch helps? It makes sure that > > > even when we use multiple zsmalloc zpools, we will use a single slab > > > cache of each type. > > > > Thanks for looking into this! I got you 'cat /proc/slabinfo' from a goo= d HEAD, from a bad HEAD and from the bad HEAD + your patch applied. > > > > Good was 6be3601517d90b728095d70c14f3a04b9adcb166, bad was b8cf32dc6e8c= 75b712cbf638e0fd210101c22f17 which I got both from my bisect.log. I got the= slabinfo shortly after boot and a 2nd time shortly before the OOM or the k= swapd0: page allocation failure happens. I terminated the workload (stress-= ng --vm 2 --vm-bytes 1930M --verify -v) manually shortly before the 2 GiB R= AM exhausted and got the slabinfo then. > > > > The patch applied to git b8cf32dc6e8c75b712cbf638e0fd210101c22f17 unfor= tunately didn't make a difference, I got the kswapd0: page allocation failu= re nevertheless. > > Thanks for trying this out. The patch reduces the amount of wasted > memory due to the 'zs_handle' and 'zspage' caches by an order of > magnitude, but it was a small number to begin with (~250K). > > I cannot think of other reasons why having multiple zsmalloc pools > will end up using more memory in the 0.25GB zone that the kernel > allocations can be made from. > > The number of zpools can be made configurable or determined at runtime > by the size of the machine, but I don't want to do this without > understanding the problem here first. Adding other zswap and zsmalloc > folks in case they have any ideas. Hi Erhard, If it's not too much trouble, could you "grep nr_zspages /proc/vmstat" on kernels before and after the bad commit? It'd be great if you could run the grep command right before the OOM kills. The overall internal fragmentation of multiple zsmalloc pools might be higher than a single one. I suspect this might be the cause. Thank you.