Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp919755lqt; Fri, 7 Jun 2024 02:41:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7kiIycGxM7lpMno4VNbQNjJA0Fllhj2+THgbyvHmr0gZshThT6PpDn2Mg6apKzdex/7xTzC/9OrYBn4YQDGKQJBirDsqL7tfhRVcqAA== X-Google-Smtp-Source: AGHT+IHp4mWoM0PTEZ37lKGueVx8j2gpvH+S0qLihLJ87B7brnHt8pTK2lY65N/qUSkBEXGZdSCf X-Received: by 2002:a05:620a:9369:b0:793:1bef:ce2d with SMTP id af79cd13be357-7953c321b06mr177397785a.24.1717753282169; Fri, 07 Jun 2024 02:41:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717753282; cv=pass; d=google.com; s=arc-20160816; b=z1GoWnp046OtAgKymtZX6sd5/CSJZpQNkREv6CAkQ1v4ScBSS50RFqcI5+SsbDmr3w MRToxd0GRY3Ro3OHbD4bECAh+DVauyNADufK0ZeY86fZSj7vpY2KB96lXGbNabeAkBup cJN6oSCXU0Yjz0FiqdZARw/xQTzLGZSLi2jNZxZBfgCRUctWT2TFm8jNLTz9zfn5fn3Q Cg1Q1ztdYiVx5JdtBy1wd7Dmn48j0pWHRs9nYboYXXXVfAaniSSbgDYm9fWIHl9dNYPr WI7+6vfJUjLACxC4kk8DskiUWgCrruMlL2n3mjfzKF3tmjB/im/huGkzl5eV+vytFVkF XKrw== 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=k/oSqpRfe691rKkuHYiQBq4OSn10B5HpGWWM65PH/D8=; fh=sYfP2WocieCTpELLYArc4VOLScGGJhI6O/9cKi08NIM=; b=kvePbHo10+w8Dr0v3fm0bxZIN0MKx24K4i3sgywOrMIf/Szk7s5z7Vz/F+r0TUKyo/ hZmDHbTCX+sKDL4QBrfdiWJLm9NUEcRFn3EmyNSuQbgHR6jcXMVG1UC/WeVpudbC50q5 ObDqtQPkIB7wDIZmXgxOMVomU/G1YsxJmF/4fDXILmriqFoZrKQKzpdYONgvuMCSjPrM aEaCmFDRx1Nkf5ytBmj6+QsZp3mF6QOzN3Wheen8O7cuOsvGO2oL8VXkyebUdi3MaQpc xiGhsNzzFXB6CDqpNdyR/KNBVA/P6f52UATmZ2CSh3UrvPe4XJdzPwCZJvHzzpQtBEh2 ilEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aD4Or4dx; 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-205747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-795332ee566si314544785a.416.2024.06.07.02.41.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 02:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aD4Or4dx; 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-205747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205747-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CD0111C22E09 for ; Fri, 7 Jun 2024 09:41:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80C7515B96C; Fri, 7 Jun 2024 09:41:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aD4Or4dx" Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 2AFB915B552 for ; Fri, 7 Jun 2024 09:41:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717753266; cv=none; b=k/UD0/l1j4XBMuRy3Fa03VSEA1MXSVctTwvKvJ1o1bkNcMC4rolR4WTn5NNpuEh0AGpZC3F5zwvQNk0T94ss1iR2VqfdbxabJPmqQrinG+ozBigQX8wQzfTBHLQ7jojM9ZWzYA5B3nwlr2ZqbEEKvakiGxqlWPVtTyVVJOT7NJ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717753266; c=relaxed/simple; bh=npvEOU5cyF70vE44vDzXkaPj0XAa/Rf93Ec8FtjtAEg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=J1BHtMepdFnrb3ONR3/psugABQRTyekNEtG+c3EAyGo4Mme/aP/An+kl1cvLmfI3oE60qIhcnynBoxyhObn5KfguEIwDdjlmZPeU/E2uOob2jZGlbbUoSz76cF3mBqxhoXLdyeNRG3e29WD7iPznVTfywYEA/HCgsPAOsGKluwU= 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=aD4Or4dx; arc=none smtp.client-ip=209.85.219.46 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-qv1-f46.google.com with SMTP id 6a1803df08f44-6ae1b32752aso10112526d6.0 for ; Fri, 07 Jun 2024 02:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717753264; x=1718358064; 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=k/oSqpRfe691rKkuHYiQBq4OSn10B5HpGWWM65PH/D8=; b=aD4Or4dxJEun99ib2N1e/imo03mKC9zISluKYMHoUjxHcNUxyq81pf+7z0OGIL2eFE dw+vDdkZzbVBIPFkRfx1NGPefPSYYIKETIsM2rXao6W3lkhsPhUI30QDHYqYAlwuVg76 bgOgwCjQ88VNwPzvjUcN2AkViVZO25vvjoGidItGD+GwoK8iDr5qbIGRfBsNFSn6YzFE cNcfjUcuj9YbBYVLkE9zyeqzLQdnKB4+CTZ7naehcAvEeDq18HD8yKdBS2hTIKsQp8ZR X6Gc7IheqQfsvO1D9NpF3eYYyjukv7mP0kBU86ZQGiqlX89lZcvZl21Rjvhmv0ANBS1v igaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717753264; x=1718358064; 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=k/oSqpRfe691rKkuHYiQBq4OSn10B5HpGWWM65PH/D8=; b=sW27Fy5W8uC2YyB/k2D5qZckuQ+7bw02x/YZIBz4gIJk9s33sOnyOvXzI5y3J2eMQi /3X2tjnMrYkBrVGbEcqyQ8Vd4i6jiJIAXzUxJoNCfALyg9akY2CTKZ+sY7jY+b9rILI6 n7ArSVV5+1IWHT2MSIZVBFRY+sf++pK2QLNIKumfGWGy0/p8cUgx56UQ4RFT79g4YCQ0 R6t71Tr9Ipo0V2unv72e3Tdm1tXzH3Afiy7j5ruQ6/+V7agyYbzSC57ovJfp0BxymLEN YcFmSQQfi6ctrCiYbFET9JQYQI5O0pm+waY+mhdIjtaEtRvOWEdXY/SOSXSIq5oIgg/o Ma5A== X-Forwarded-Encrypted: i=1; AJvYcCVLVXtuPqs5LvdTC8ZmmO+7j1d2x2CC3RyUUqd6XtlyIPO9ZlCvXgDjlL5TJIjZG7ZOoElzxtfRxUFAS3TGBVcp+Jd6TJ5CvxWB/+vF X-Gm-Message-State: AOJu0YweBbkK0BeeIHrGDLQJw0LKsSvPTTSy4sSC1ptPtvDCOpZEXziS dCQ7EjpVH704Zi5RHOIkeKE0f8mSLsgz7YkgQCGa4+OsROhDZzR1qTmzNJwMEecN+YJ9O9wwt3O 7wM4dv69pJHCvIe/xa+QJi3zG78M= X-Received: by 2002:a05:6214:534a:b0:6b0:5933:3a8a with SMTP id 6a1803df08f44-6b059b851a8mr20938446d6.15.1717753263959; Fri, 07 Jun 2024 02:41:03 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240604231019.18e2f373@yea> <20240606010431.2b33318c@yea> <20240606043156.GC11718@google.com> <6335c05d-9493-4b03-85a7-f2dd91db9451@linux.dev> <20240606054334.GD11718@google.com> In-Reply-To: <20240606054334.GD11718@google.com> From: Nhat Pham Date: Fri, 7 Jun 2024 10:40:52 +0100 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: Sergey Senozhatsky Cc: Chengming Zhou , Yosry Ahmed , Erhard Furtner , Yu Zhao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Johannes Weiner , Minchan Kim , "Vlastimil Babka (SUSE)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 6, 2024 at 6:43=E2=80=AFAM Sergey Senozhatsky wrote: > > On (24/06/06 12:46), Chengming Zhou wrote: > > >> Agree, I think we should try to improve locking scalability of zsmal= loc. > > >> I have some thoughts to share, no code or test data yet: > > >> > > >> 1. First, we can change the pool global lock to per-class lock, whic= h > > >> is more fine-grained. > > > > > > Commit c0547d0b6a4b6 "zsmalloc: consolidate zs_pool's migrate_lock > > > and size_class's locks" [1] claimed no significant difference > > > between class->lock and pool->lock. > > > > Ok, I haven't looked into the history much, that seems preparation of t= rying > > to introduce reclaim in the zsmalloc? Not sure. But now with the reclai= m code > > in zsmalloc has gone, should we change back to the per-class lock? Whic= h is > > Well, the point that commit made was that Nhat (and Johannes?) were > unable to detect any impact of pool->lock on a variety of cases. So > we went on with code simplification. Yeah, we benchmarked it before zsmalloc writeback was introduced (the patch to remove class lock was a prep patch of the series). We weren't able to detect any regression at the time with just using a global pool lock. > > > obviously more fine-grained than the pool lock. Actually, I have just d= one it, > > will test to get some data later. > > Thanks, we'll need data on this. I'm happy to take the patch, but > jumping back and forth between class->lock and pool->lock merely > "for obvious reasons" is not what I'm extremely excited about. FWIW, I do think it'd be nice if we can make the locking more granular - the pool lock now is essentially a global lock, and we're just getting around that by replicating the (z)pools themselves. Personally, I'm not super convinced about class locks. We're essentially relying on the post-compression size of the data to load-balance the queries - I can imagine a scenario where a workload has a concentrated distribution of post-compression data (i.e its pages are compressed to similar-ish sizes), and we're once again contending for a (few) lock(s) again. That said, I'll let the data tell the story :) We don't need a perfect solution, just a good enough solution for now.