Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp533021lqt; Thu, 6 Jun 2024 10:21:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKftiaCgGBSNkpHJgSAGwiNiABmPXXveCafsaweTPQihBdMrNb4BmfpdmelZlVUdyONdII7ZTVqT3lj+eQWdkBZfjq6iOduPPZzJOWYQ== X-Google-Smtp-Source: AGHT+IE3/1TuJ3QyKJSfIHCItnTadrs6Yeh2oTjOv0vt3yT1Ut6G15+sx3CfqnmKo6RWx/t1s7rK X-Received: by 2002:a17:90a:5312:b0:2c2:3762:2c18 with SMTP id 98e67ed59e1d1-2c2bcaeeef2mr179850a91.22.1717694494030; Thu, 06 Jun 2024 10:21:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717694494; cv=pass; d=google.com; s=arc-20160816; b=vq1O884a52l/JsvSCW6LckA6AK0lr5UcEfEy5FVnBNnKEdB93LOm8w+b/kt672m0bV XxDFC2dvaUAAtngjx762ONaOAMgEsgj6HcTNUw803p7SQcwalKBFxwgn3R6EL215Yc3T 7DS80eyLAdV+tIlRjVh2Oa+EoTZjubRTGq148pxps+ejEvWJdzYgxL13AUzkD63GiVlo QMs1LA+ekUrqccRfYcD9uqbqvRRqTMYrlCAH+SoKObb9R8QSvdEK31MiOsJplp2SoT+m yo30aWAaTQeyIcGNiWB5KWpKfrvdkdanFMg5/zK9XLZhHC4YHXzzYk99IJpIbg7fEtnx ztBw== 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=+/1l2hgdu4GOtQ+Ob2oTmSMpsc9q1e6vX4IAFQSksuY=; fh=yW0/aMKI32XTa/OpcXm0PNKNn3AmoghZn6xRhWeDOD4=; b=nNsE/x6qmbyIaajxlNWQh67izRhR1TESV/0Mw127XYHAd/yXY30Q/mfwdZoxnt6JcN pOx0aQBILS0kA+cK6p3V+agLdAqWyan8jSFWVlmeidBYErYmhXvBFm3uYy8KtpN1ag1u a/iUScPPl9YB3aijJpnawHCCUFXL2R84EFbT2TsPMwkGpGoppHXZFvB0oKFP8wl3MwVv q+fF9jNmCgfJuNoTwus704HoURNHRSf1fbaomu1rWU4pcfE4MQAXd8ywUWhEur9dP9/a SyfO6uMpK9mOEkgMAMtgYkSjVG35rqQHPXVprApinB7WzhgJ40U/sMoW8m2glgAxMzeD lKAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=E99QoOUo; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-204779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 98e67ed59e1d1-2c284a8484asi2088555a91.32.2024.06.06.10.21.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 10:21:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204779-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=@gmail.com header.s=20230601 header.b=E99QoOUo; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-204779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 CF0C2287C61 for ; Thu, 6 Jun 2024 17:14:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC5961990A5; Thu, 6 Jun 2024 17:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E99QoOUo" Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (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 916D6198E86 for ; Thu, 6 Jun 2024 17:14:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717694062; cv=none; b=Y5a0RJkEHDijawD6oEfwMJL6Rhhaul1HznQQiCxHl9prKKj4T5zBy10OsAwL92i5OLR04eFHqmZ22l8kMGEsVcA8Xe2OZiT/k/TwqIWWcOrmBbxxmU8Z4GUq93Qw+QrIWy4VoaT8ctLQzNyLJGSuTMOJfrEFsDBjCdhmt/1C9c8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717694062; c=relaxed/simple; bh=+/1l2hgdu4GOtQ+Ob2oTmSMpsc9q1e6vX4IAFQSksuY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=OXG9dyCwmry3UXp0/yq3h68IV0n74CeQEtyrgMbGbXmogDVzUjPxB8KlXEnR4LtNRcBEb0qE4f/9e5CvGrEDicwCv9FqQXAdxSHFhjaOgn16R4XkDK2Ie0yUNTazQQ/LHDVO9YI35jZte87eRQpTwZJ5kRHNKteHMq+idwxXiGw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E99QoOUo; arc=none smtp.client-ip=209.85.167.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3d208a05f97so728094b6e.1 for ; Thu, 06 Jun 2024 10:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717694059; x=1718298859; 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=+/1l2hgdu4GOtQ+Ob2oTmSMpsc9q1e6vX4IAFQSksuY=; b=E99QoOUofKUzp//EMJk4mjJew1LALIfQ4uPwYM+Z8yUmKdjR7Usp+fjIRtAohTOX2N MvpkyDeBgfoTwcCt2y13Ct+RWoiLhwrjv/HsC1vx/SZbW7VP1dX5nwrFvD3vjgL2AQ8Z 7gUIJrztOU/fA15oVsHuezvxA/ePprT+8yOdCem338+LVV+ZX/H9ntrIio+x8FvBw9A1 9BFiNT8acXhFwaUr/pfLNWrOlsJpm5Ew7C3+fWHzJpoiXajaSltMn/z19O9IcIOuVgbd +Vc7MkD+SOHaL6eCcWumfKcTV2mZaVlsbHFrrTvUVMh826YnYT/tQ47NLLpzY21gTplJ nYZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717694059; x=1718298859; 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=+/1l2hgdu4GOtQ+Ob2oTmSMpsc9q1e6vX4IAFQSksuY=; b=Hf7IHoWChZOSDb4dhcWhHltUxynJXNiek6Q0p2mbkkx6VBtl+vR6FBUeoJ2d5QXvc8 2XR9LkX/gUjHsWdDUbYmVPAZSBrI2abUeceOulwrLn1pYnDsVKVJL9V5swFwHYbrd3yK ktigkmbUPjg+GPvo1LkEXIrpoJm1bVtTw950vJY3FkuQiR/8Ferer0tDAnkdjldoF0ks 316n8XK8TC1CHEaK3hfZnPRhQReCUjFmR/BG7AwZmmk65vnpVnpsUzz4dctBZA9jR0aj gNqKPfL2AQ/tb+Y74aAMtIa0KitcnQ6FgQDR1K792KQwQaTlKTE4F2zGESRAy/oUyg8w anTw== X-Forwarded-Encrypted: i=1; AJvYcCX7jj4bbVnpdiqUV1Q7++9NmV91+ZRfaikqjSvzOglSCYBwqvKdhe+jdjQRIeAHLKq6q8rdd5CQT/YKGHHItJd+EJ6COryzcjA2fIbc X-Gm-Message-State: AOJu0Yy+Ku3+gymX7spi+ZQgXbJlZRSNi0eIKOvdFv+H7UHi5VEU6rRG 74OSgA7xMVJekeBllX49klaUMsS5zANXw0yrgtkND5t6cqaP7eERZ62Ffbo57hLw2/BbO1118S0 R14j5iP+ELe1M+pi6W+cMKXdYpJW3OLlpCifDMqQG X-Received: by 2002:a05:6808:618:b0:3d1:e059:fec6 with SMTP id 5614622812f47-3d210d2b29emr63262b6e.3.1717694059455; Thu, 06 Jun 2024 10:14:19 -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> <20240604231019.18e2f373@yea> <20240606010431.2b33318c@yea> In-Reply-To: From: Takero Funaki Date: Fri, 7 Jun 2024 02:14:07 +0900 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: Yosry Ahmed Cc: Erhard Furtner , Yu Zhao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Johannes Weiner , Nhat Pham , Chengming Zhou , Sergey Senozhatsky , Minchan Kim , "Vlastimil Babka (SUSE)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2024=E5=B9=B46=E6=9C=886=E6=97=A5(=E6=9C=A8) 8:42 Yosry Ahmed : > I think there are multiple ways to go forward here: > (a) Make the number of zpools a config option, leave the default as > 32, but allow special use cases to set it to 1 or similar. This is > probably not preferable because it is not clear to users how to set > it, but the idea is that no one will have to set it except special use > cases such as Erhard's (who will want to set it to 1 in this case). > > (b) Make the number of zpools scale linearly with the number of CPUs. > Maybe something like nr_cpus/4 or nr_cpus/8. The problem with this > approach is that with a large number of CPUs, too many zpools will > start having diminishing returns. Fragmentation will keep increasing, > while the scalability/concurrency gains will diminish. > > (c) Make the number of zpools scale logarithmically with the number of > CPUs. Maybe something like 4log2(nr_cpus). This will keep the number > of zpools from increasing too much and close to the status quo. The > problem is that at a small number of CPUs (e.g. 2), 4log2(nr_cpus) > will actually give a nr_zpools > nr_cpus. So we will need to come up > with a more fancy magic equation (e.g. 4log2(nr_cpus/4)). > I just posted a patch to limit the number of zpools, with some theoretical background explained in the code comments. I believe that 2 * CPU linearly is sufficient to reduce contention, but the scale can be reduced further. All CPUs are trying to allocate/free zswap is unlikely to happen. How many concurrent accesses were the original 32 zpools supposed to handle? I think it was for 16 cpu or more. or nr_cpus/4 would be enough? --=20