Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1098894rdb; Fri, 2 Feb 2024 13:43:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwqBpVKhD01QMuwSaxjVyfaJrLKDwD1X5S5hsKZjB0ORhuwnkJHRPK136O63I+84BEZQRa X-Received: by 2002:a17:907:785a:b0:a37:4752:8e61 with SMTP id lb26-20020a170907785a00b00a3747528e61mr42727ejc.45.1706910191269; Fri, 02 Feb 2024 13:43:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706910191; cv=pass; d=google.com; s=arc-20160816; b=Zc09XaLVTVLwMEtzZJKhRgILnWFoltRAn0KiNDbzO9XkVjpNHCbaWmx8ozPDFAize5 4inhbw6iZRKRRrjIzhQaCAbK0nOFYIMZdQO7QosAs8kmvrQ9nRwhWz7qtwMwIOxdzG0X YU9pfS7sHrv2bo4vohVP3Xwq3lg4+Ejk1+6jEzJiUEp1HPi1bpRDMCaOMOL2yQ+UITJg jQ4Mhg9gBJRdtf0x88untD7Wf75L7Z1rxfiu8BlEV/2Zoq5XLrtn3krZ7VCDaEaoF1B8 BM15LQJgIyItb9eB9/29E2AWiE5I+KIhgZCIOKCw+lp+rXcN0YdvvQ8f5GcQT7ZWnhBF I2gw== 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=JMTAKCnlm+qRofrbzQT0twQWPmdB7rbVAIRwYv4C2eY=; fh=60ACm6/HlKXpU83Idz+HuTpjfV45u1PmP3ujHXLnzDU=; b=zqYeYahja7IASp6s4IJXih/KOBhLXYSXSBnNv9XM7j90a++o8ha+D8mCz9opmgVgAr NqX+DHEvvhyjNJupbwkvWaf3ETdJLRo9AyGw297uTTAIUj4rYxBnuMHex9qeQsH7v2Ln wMOysFXs2yTIwac+zXKK9k6hjcgzrBqYU0bHUfBN/3HJTTt/eWUa2fHMozvxcZCFbJRZ FdK0XW+ZMfPc1eNLOXgHk1QUUY4KuRlInmq4Ym5liDMjfSaIRb87Ingjcn3dedj06eWS 2jrQbz/epo8o+ojnbQ4DGIqTC3wEbSghZe0BqA8IZ+UzSaqbT5F8ufXh+GHqgtW7yg0E 8a0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=b+2bvFHM; 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-50621-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50621-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCV7iG9ONKDOSoTPPmGaXnMYskuCU5sFaJcIS9PHl3/V9VEj4BfY5oNKUZWWhSGeg2MND8huaskEA7C0oaL/VXb7vlh7BCqAxBmYtIp/Mw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id pj4-20020a170906d78400b00a3711d8a9edsi842503ejb.676.2024.02.02.13.43.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 13:43:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50621-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=@google.com header.s=20230601 header.b=b+2bvFHM; 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-50621-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50621-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0A6201F2654C for ; Fri, 2 Feb 2024 21:43:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C4A483A03; Fri, 2 Feb 2024 21:43:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="b+2bvFHM" Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) (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 61A3A8173E for ; Fri, 2 Feb 2024 21:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706910180; cv=none; b=UMfqEu8518J2P1DCH7W7ddkEupJTWHJpCDxm0Q7dHMEMEIHAY/x1S1bNnOIqt1GnsRFB3t0ebbkcELn9X4g7olLCkDNd4tE1SW5OyJsA5RH63SEk9I0wIYKJ77MtfLvATJDCxcyD9B6ndMaFntQkAkOUX0R/2844hpWAU79eGWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706910180; c=relaxed/simple; bh=JMTAKCnlm+qRofrbzQT0twQWPmdB7rbVAIRwYv4C2eY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=sfb6XSGvy1Uf0wISC1uH2s53AGDjh6xpRqpJChFJoF1TkZGrSoARyjW8H0vIOzNELV+E6sfj8dIq9LeC+jIJ5DcvJnsEP1RiUYXZmIQ3JSmev+EJ9PDjqN2Md+pM5/1L2XQck2zRDoNvIxt3pz3GsrSVji3UA26wtzjw0qCoGpU= 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=b+2bvFHM; arc=none smtp.client-ip=209.85.128.176 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-yw1-f176.google.com with SMTP id 00721157ae682-604255f581cso15923357b3.3 for ; Fri, 02 Feb 2024 13:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706910178; x=1707514978; 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=JMTAKCnlm+qRofrbzQT0twQWPmdB7rbVAIRwYv4C2eY=; b=b+2bvFHMt/shTzmoWL5DDZZanZduRvwtWMeUbrg14JSv2o7g1pnYM/zyRPFdH4qh3D HiUgbmp9tKe76sIoeliVx0cT69mQufXj7x4YxQaFUI2BFtzjQ6eXRaNsheSgxgN6n2rT VXLZX1KMWi9Lf0lQgHfxgg2p7pyIS1DUIw9yq0/SWbpibBx+PtLG1J2V0/xNaCz7JoXj 3QDoos5dwjaz1f0YE5obz3nOji7n44OFf7yNeOawOPLQdsgR7PufauTBjYU7r03UCb4I Y0mcstiM0mAf4an21kVUtTTcQT2VpeqyGA0txzucY74JjbMPZB0q41tFanQisdRsr+2I sFRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706910178; x=1707514978; 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=JMTAKCnlm+qRofrbzQT0twQWPmdB7rbVAIRwYv4C2eY=; b=l5mPQNNyCmrcFcbaFDdOr3B7za8bXHfgPoZaVYZB7c8FkMKemkVcO/bTA+WciBn1Hx 5tVp5L1aXSruf/mVWiHG2Z/vM4PwI8NteuKkeM7F0+6Frypl3Vh3i9DPn4zXyoNcG9Li QjJE3Smnt+RZIxUz072sSsEUCTAV9OHXglNB+x8JWj9e3PcnQyY2dMZPoIaDmRvoCXvu cMmuzwD3ZT6sCMI/3LPXLoiVsRJYVZ6wZtup0fbfMvtRxIRHB8Xx7XxtjL0rnwuguVfj Q6XESq2Z2btSvV8VIaEGaZzFnUUXAf8TFi48xnySVjzcykOl5DOxdG3wlttIcHjNsHCL kXfg== X-Gm-Message-State: AOJu0YzghbgrwIf0TC7FSZPGSWH67pvA0xmuamRuKg3kB0Cr0PGpBqGw Lo6W/dp0kKNG6tI79+iNruv09KVRrIny1NpF2HMI5ydfk8+punraGCYTkXFCPq1iIZl1H+Cc+QT ul5o3/X4AqGZwnoYZAVPtKqFA9elNfTXS3DdD X-Received: by 2002:a0d:d495:0:b0:5eb:3851:2bba with SMTP id w143-20020a0dd495000000b005eb38512bbamr9522889ywd.41.1706910178189; Fri, 02 Feb 2024 13:42:58 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240201153428.GA307226@cmpxchg.org> <20240202050247.45167-1-yangyifei03@kuaishou.com> In-Reply-To: From: "T.J. Mercier" Date: Fri, 2 Feb 2024 13:42:46 -0800 Message-ID: Subject: Re: Re: Re: [PATCH] mm: memcg: Use larger chunks for proactive reclaim To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Efly Young , hannes@cmpxchg.org, akpm@linux-foundation.org, android-mm@google.com, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@kernel.org, muchun.song@linux.dev, roman.gushchin@linux.dev, shakeelb@google.com, yuzhao@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 2, 2024 at 11:46=E2=80=AFAM Michal Koutn=C3=BD wrote: > > On Fri, Feb 02, 2024 at 10:22:34AM -0800, "T.J. Mercier" wrote: > > So all of these should be more or less equivalent: > > delta <=3D SWAP_CLUSTER_MAX ? delta : (delta + 3*SWAP_CLUSTER_MAX) / 4 > > max((nr_to_reclaim - nr_reclaimed) / 4, (nr_to_reclaim - nr_reclaimed) = % 4) > > (nr_to_reclaim - nr_reclaimed) / 4 + 4 > > (nr_to_reclaim - nr_reclaimed) / 4 > > > > I was just trying to avoid putting in a 0 for the request size with the= mod. > > The third variant would be simpler then. Modulo looks weird. > > Oh, and I just realized that try_to_free_mem_cgroup_pages() does > max(nr_pages, SWAP_CLUSTER_MAX). Then I'd vote for the fourth variant + > possible comment about harmless 0. > (I'm sorry if this was discussed before.) > > Michal Ok great, let's do that. Thanks for your input.