From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52D95C3DA4A for ; Thu, 22 Aug 2024 17:49:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2F9A80048; Thu, 22 Aug 2024 13:49:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE00580044; Thu, 22 Aug 2024 13:49:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ACE9F80048; Thu, 22 Aug 2024 13:49:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8C9FD80044 for ; Thu, 22 Aug 2024 13:49:40 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2F70E8067D for ; Thu, 22 Aug 2024 17:49:40 +0000 (UTC) X-FDA: 82480618920.20.99D7659 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by imf20.hostedemail.com (Postfix) with ESMTP id 60AE91C0009 for ; Thu, 22 Aug 2024 17:49:38 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="4VSgZqB/"; spf=pass (imf20.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724348937; a=rsa-sha256; cv=none; b=Mtm6aq1fkbTSh3UKYpndv46/bnAVro8HApRx5hiqPdir0JLao7EVf6q4y5SvMMjPN1vXzW kzrYfVwYCyWlsz3plPo42/rPH9sTBdWv+zEVyKn6OA1WGIwljTc6k29XCxl2hKJCQL5jFK Cu60iQt7FaGyx3Apfwz/++X9DtDip6w= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="4VSgZqB/"; spf=pass (imf20.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724348937; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4DCNjjCKoSP4eyvhwLdjPqdqgDhehWVQKDeRIGJ9azU=; b=Q6kTWbVHMIitLsaVnQOo8n4fevp2CYo+FtKZ355l71pwJnN3yZ1FoUC9hEOX/8cmrvHUli crH+doGcb2oaVmnOpvXC+LS/d+1mAMXP1jy+GMBQmcIoNEOusASYuEgXk/ZCzKK0gDqwIZ nlFQgm9F6fM+qN2lHKLgmlaE3GzLb+I= Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a868831216cso147988166b.3 for ; Thu, 22 Aug 2024 10:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724348977; x=1724953777; darn=kvack.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=4DCNjjCKoSP4eyvhwLdjPqdqgDhehWVQKDeRIGJ9azU=; b=4VSgZqB/8a6tKloNWLxllhCs/19V6cH5zRXIfgIt5yyF4oBXePXPgXB6Pui2aVYBP8 hxNk39d5CQPQ9BaZDUlNf14IeIUjvgCnLNEy11Yq5lsvN1kqj5k11r9slfoNVx1u0Mp0 RTHaexQzKKZ5jBhdWcMPTU/TxH6jfB4WEj7nho9cIG8rxHEjXP7iKjHaaMaREvUiuiqY APlTdfJuTJaYtW+t4PPsKW2WrEkPcLjG6XPfeIiIHcGkJ8Vdj6woaUXi6rrqpeq/8x6X DeOQfwoa5t5vwYFK0POHLbMfOzrHdOXw4rSJZDpUJ9YEtdLNO7I3ABxU7Z8g46RXBnRh MWew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724348977; x=1724953777; 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=4DCNjjCKoSP4eyvhwLdjPqdqgDhehWVQKDeRIGJ9azU=; b=aFMOoDHLHrhlkpmNdHJ9gEyhzNSsHjapLPfXwbjVzylzEioanRFs/vewI0tkzoWNB/ klra6qNzuPKR/r6iRtVN+TCgKy0IdKlHES8pC+sLHqF0q+HRa5ceLRXc+2Q1e266UJ61 vV6oqeU97PBTP06LNvN7aJZoi1qwYjgbNLWO4duVZXSFBVB0Kfqk79Ngb0Vf6zw2M7uc yBllCWbCXuuT6miieM1cbNFu7ea85+hiOUIjcV72m4Pz60OT8zkfSD9r9dHJkjIss9J+ K5yhup1Njeu/97bKmv7aOR8Rt0uvIBSSz9/5tb9V7ukIwkXoYXwe1tlWts1Q5p1a/BRE nIOQ== X-Forwarded-Encrypted: i=1; AJvYcCXsLUI9y6AYP5SDvsf719QETXQ6om4HadbskNsfPRkCSSTRwFegmeUPXVQR+jy1+d+fX2JsblOPsg==@kvack.org X-Gm-Message-State: AOJu0YwHfg3Fixf3Pzec7ZswJIfqyOP4vz/Hh4eAqgYeJzk4NnghTwuK m5zvW+OkybybT42zMJ6KbkVvkoGKGV72ykyjE6xFquI2veVOn2ikXvUuv8F6SKUm0ZB83bL91z5 xFW47yUdTUD0wrKvtOjfnZEzMqzE4vxzNVuLy X-Google-Smtp-Source: AGHT+IE4IQPc9rbpt76DXkp3o0GnQk0sV4FVm/dLBBD+l2uTlPMrcgrYLjxXm0Xi/oBVM9Rz3LssTdd79gSz+FmJjI8= X-Received: by 2002:a17:907:944c:b0:a7a:a89e:e230 with SMTP id a640c23a62f3a-a866f3600b7mr421320966b.30.1724348976225; Thu, 22 Aug 2024 10:49:36 -0700 (PDT) MIME-Version: 1.0 References: <20240814171800.23558-1-me@yhndnzj.com> In-Reply-To: From: Yosry Ahmed Date: Thu, 22 Aug 2024 10:49:00 -0700 Message-ID: Subject: Re: [PATCH] mm/memcontrol: respect zswap.writeback setting from parent cg too To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Nhat Pham , Mike Yuan , linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, Andrew Morton , Muchun Song , Shakeel Butt , Roman Gushchin , Michal Hocko , Johannes Weiner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: t3yy3fiy58z66zs1rm19ziuw51bcp441 X-Rspamd-Queue-Id: 60AE91C0009 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1724348978-68216 X-HE-Meta: U2FsdGVkX1/vdG/OnfWEzILDiay3oBNbB3487hMZIX+C3yjSIenq7QOQClkIwI0upO+VBHtnyNwhxvKXRrJbWD5sa3068yn4IKudRo0AJTr+5bXrmYBRM1wId5MsP4H4TG7yxMMbtdXGV036t22oELLv2C3IWKPp9kIoQnq2WUDMq7ufbGmygblappyXWELHcujF4Ioi0aLSRrz+PKp/dEItzZRUd3TmMl6DS549jzVQCTVdrT2SRrwsjuAPQ6HBJk646X5Mx1xGWQGU+6+C9npgi12tjK3JnkkB0CfibXgzr0bKlp84PF3w+zKbD9SbKB4OBVGYqgN5ULgrXFjNSkEkFviign/zyJ8p+Sc+1SMMpAxCuRmBcZrFBOC4SNUizp+jquHVMoIOJVf5ATC0K9omDG97EcxuFPiblE9rimLp900YGpZt2lSbK0tTc0dbw/kyTSsgH9AJjxRarJlZEjjPAh7+YXHdS+2TDF3LAAPjE+vz6OMsxWBd79aPGzFTkmt9iz+FhRiZM5JKFJsd4zx1EGpsKYx0SPLYcrroDPQT4w8qC3rzYe5uYHX1sQ/uT1WY4W6XTj9cIszudqPkKvxmeLmJw2lXlqXttRq3aBtH84nYirLlxEsICVslUVIgEkaq5bysdFNT+476JAacru5Wb3ioPyUpTcfOJ7BjKm3/eY/20V2ODvR8HbR1cMdkNiyzg7+vn6ERIYzmjyyLDydzDR3XPW4sYEwDoFhmmmsnYxCha8iJNH7n42h7a1H9iMfcVP7eRpTXbmTGvGSwi18ADC9MHWX2+T9ZYQjP9Jhv1mDp4Y4jlnO91N6U7/1wa9SAEg+9YPTg1c+0pidwkR5L2ZLqOIqwHzRE4jA2WeenChFde614rrz0bL2gbLCZdRaA5DsFhycFjaxLAVXsKJYd9StLAkgBHScW+PJphg/Pvfefvh0riIQ88QWkIw+/qbrZTEX4KZ4GGcSOL2A x9qaSm/r fZpD/i7MFxWotpAFtc4NP2s3Pjp9/V8ro4BYrzJ9DwT5jna97W3JpcIFzyFjb83/oyik56zbS8df9Btow7TLypi3UTiXgGdVCLQn0ol9AqJywMN3dA7txcJIrTmjAQmrTkSDTNs1j5sm1KHf7S1ND/iog8mzD2szjzG6Bq1oAtQj3nGbHFcXXiEsT0rj0TUc/9+cgShvD/Ed5saBt5YakcVuYXkbnrhSqwqSbMQt0hZCvwWjYa1VWQS7GkxGD8pKpFVbI X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, Aug 21, 2024 at 9:14=E2=80=AFAM Michal Koutn=C3=BD wrote: > > On Wed, Aug 14, 2024 at 01:22:01PM GMT, Yosry Ahmed wrote: > > Anyway, both use cases make sense to me, disabling writeback > > system-wide or in an entire subtree, and disabling writeback on the > > root and then selectively enabling it. I am slightly inclined to the > > first one (what this patch does). > > > > Considering the hierarchical cgroup knobs work, we usually use the > > most restrictive limit among the ancestors. I guess it ultimately > > depends on how we define "most restrictive". Disabling writeback is > > restrictive in the sense that you don't have access to free some zswap > > space to reclaim more memory. OTOH, disabling writeback also means > > that your zswapped memory won't go to disk under memory pressure, so > > in that sense it would be restrictive to force writeback :) > > > > Usually, the "default" is the non-restrictive thing, and then you can > > set restrictions that apply to all children (e.g. no limits are set by > > default). Since writeback is enabled by default, it seems like the > > restriction would be disabling writeback. Hence, it would make sense > > to inherit zswap disabling (i.e. only writeback if all ancestors allow > > it, like this patch does). > > > > What we do today dismisses inheritance completely, so it seems to me > > like it should be changed anyway. > > I subscribe to inheritance (at cgroup creation) not proving well (in > general). Here's the case of expecting hierarchical semantic of the > attribute. > > With this change -- is there any point in keeping the inheritance > around? (Simply default to enabled.) Agreed, please feel free to include a patch in your next version that does that, and add "Fixes" tags and Cc:stable so that the changes are backported and users get these changes ASAP.