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 62AC6C4332F for ; Fri, 15 Dec 2023 07:42:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D58278D011C; Fri, 15 Dec 2023 02:42:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CBAD48D0103; Fri, 15 Dec 2023 02:42:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B33C08D011C; Fri, 15 Dec 2023 02:42:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 999968D0103 for ; Fri, 15 Dec 2023 02:42:49 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 722571C0C7D for ; Fri, 15 Dec 2023 07:42:49 +0000 (UTC) X-FDA: 81568260858.20.EE53BD0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 6615F1C001C for ; Fri, 15 Dec 2023 07:42:47 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QlwaBUFl; spf=pass (imf18.hostedemail.com: domain of fdeutsch@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=fdeutsch@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702626167; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BgGkk2orSgG3v2yFIPuHY9f17x2ZrhM/BfFGC9bz9C8=; b=Cg1j2ZJMlVzQULlP3oAFmrHTdAMIJdY7LUTqf63gABuaLbrZWEn0tXIPorlO3KoWgayZHs UhvjLFr9YpFFPnvY39shBpjNQbx+Tkns/6A+9MZL6asiOSsY8in/jVlQG/e7JHZIna9zF+ PtVv8DxoK4R6ZC+QF1qyE07A/yTFxiQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702626167; a=rsa-sha256; cv=none; b=oLdhj6F164Cn6RYrtmZbz4U9StO2duJN9QpnxJZ1gQIv+glxtP00IR7MEY6OM1pSNGj5aW nAmOjQ5qpX4TVe3BVTMfWcwV3uEbgUKWgs2IO5uRTJhCpquIAVpPb59m07Zsonie1+mJoj /UJAQHC1KWhdhwkIyfHqfG8bOWs4a3c= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QlwaBUFl; spf=pass (imf18.hostedemail.com: domain of fdeutsch@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=fdeutsch@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702626166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BgGkk2orSgG3v2yFIPuHY9f17x2ZrhM/BfFGC9bz9C8=; b=QlwaBUFlJgIooikX8eUAT/7sh6VQO+D36pAK9S+rpneSZ0qDv2hVTbYTME5X4Ww7A/CBci ttUzfCjgZ5Fwh02c/Rj0UyQS4w2+zhMEWSjaBi3vQZSxAFKagP7vqY41xnedgC3677Fqq8 YssfLVycCxWmnedM8PHj9TEB5X8yaaE= Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-U97571DRPNanmrDVRakabw-1; Fri, 15 Dec 2023 02:42:45 -0500 X-MC-Unique: U97571DRPNanmrDVRakabw-1 Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-5e302b65cc7so2332497b3.1 for ; Thu, 14 Dec 2023 23:42:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702626164; x=1703230964; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BgGkk2orSgG3v2yFIPuHY9f17x2ZrhM/BfFGC9bz9C8=; b=KWqOK9xOWBudA56AQ0NIfFmC2BTkvM2mVrZsVB4Gp6jvEXcpdbR96g11kIP/lQW8oi afArVLs8axHF0JwwDbBp/NM4/HxvNfom5lYfHb7AKe0ur48cCNPDSLTSYF7ck2T+OuNW 7gDaLCLorCoF1pFjNMPxTiEG+5dIRAW7O8p8mGKAaxeCDGz1wKbtAL1K+QbJJSoUzdpP J+cAUprlYPvilYsfG/wq8USJPPRcLc+TPOBLlmk9XtUR0+1rsnSw6bFbk2avX/OuCkfc SaLkSA4wZKNArDhE9sp6SCnDn1ppCD9ci3+VyD/9iElML1R33xyI92BmHamezI+OzehF u0pA== X-Gm-Message-State: AOJu0YxaT17Q84X1N+SRtK4GFv9xahXRdSJf3m6qnCGgc0wVUBFJpt3s IEa8ys6dGmr81Beh0wxwiYtBdk2PTyD2K9RrECcYaIg9EDtFmet2FFtjYnaYBKTgE3UABWW/G3u jHTyTWb0vQVdwxq5ecI0l21sV99I= X-Received: by 2002:a0d:d141:0:b0:5d7:1940:8ddd with SMTP id t62-20020a0dd141000000b005d719408dddmr4829795ywd.68.1702626164447; Thu, 14 Dec 2023 23:42:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqeWK0cIPpqgv/aPIysLT1ex5Ye4aHNv3A71vODMQX0AFpLn6qSyHTfxUdySORCeoBDyms1emB8MPgyinwKlM= X-Received: by 2002:a0d:d141:0:b0:5d7:1940:8ddd with SMTP id t62-20020a0dd141000000b005d719408dddmr4829787ywd.68.1702626164193; Thu, 14 Dec 2023 23:42:44 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:7010:a407:b0:38d:99aa:5b2f with HTTP; Thu, 14 Dec 2023 23:42:43 -0800 (PST) In-Reply-To: References: <20231207192406.3809579-1-nphamcs@gmail.com> <20231209034229.GA1001962@cmpxchg.org> <20231214171137.GA261942@cmpxchg.org> From: Fabian Deutsch Date: Fri, 15 Dec 2023 08:42:43 +0100 Message-ID: Subject: Re: [PATCH v6] zswap: memcontrol: implement zswap writeback disabling To: Chris Li Cc: Yu Zhao , Johannes Weiner , Minchan Kim , Nhat Pham , "akpm@linux-foundation.org" , "tj@kernel.org" , "lizefan.x@bytedance.com" , "cerasuolodomenico@gmail.com" , "yosryahmed@google.com" , "sjenning@redhat.com" , "ddstreet@ieee.org" , "vitaly.wool@konsulko.com" , "mhocko@kernel.org" , "roman.gushchin@linux.dev" , "shakeelb@google.com" , "muchun.song@linux.dev" , "hughd@google.com" , "corbet@lwn.net" , "konrad.wilk@oracle.com" , "senozhatsky@chromium.org" , "rppt@kernel.org" , "linux-mm@kvack.org" , "kernel-team@meta.com" , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "david@ixit.cz" , Kairui Song , Zhongkun He X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000b3d5ca060c878ba6" X-Stat-Signature: qx9rpf5c7s19gdgygyw33qk8gum8ff7m X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 6615F1C001C X-Rspam-User: X-HE-Tag: 1702626167-910192 X-HE-Meta: U2FsdGVkX1+3vBme8wOP6X+2egkfJOSzSXTAFJ6vmNS2g/jHRFf3A+x0A6x5O17W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Jth/evZgPe+8nHtjDEHWgf2OB/Ogc6czgcRvIINJEYX69TWFK4Vb0fNCbcWghHVZ93yfmvK2E7jonIeTFag1vgu7dvOFBg9eQX+0JOuCpkixth0ayP/s7U8f0sYWyM+Krcbs+p+S4w4cm6yy2ZnPO7gMHkI9n1R9YTbsfvVmjh2H/GOD+DpUXPcchkDTwwLtI200enr4kD4vLgXDAG9uCP597zQSBK7iJutHxIfO3/vX01ZjymttLZxyCCc+KOxKcHZbIsZKmKxg64+ZD+tV7Fbk2GlfZ7cc/QAjAOI4D2NiCB+6rZbwp7+Op74Q== 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: --000000000000b3d5ca060c878ba6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Friday, December 15, 2023, Chris Li wrote: > Hi Fabian, > > On Thu, Dec 14, 2023 at 10:00=E2=80=AFAM Fabian Deutsch wrote: > >> Yep - for container use-cases. >> >> Now a few thoughts in this direction: >> - With swap per cgroup you loose the big "statistical" benefit of having swap on a node level. well, it depends on the size of the cgroup (i.e. system.slice is quite large). > > Just to clarify, the "node" you mean the "node" in kubernetes sense, > which is the whole machine. In the Linux kernel MM context, the node > often refers to the NUMA memory node, that is not what you mean here, > right? Correct, I was referring to a kubernetes node, not numa node. > >> - With todays node level swap, and setting memory.swap.max=3D0 for all cgroups allows you toachieve a similar behavior (only opt-in cgroups will get swap). >> - the above approach however will still have a shared swap backend for all cgroups. > > Yes, the "memory.swap.tires" idea is trying to allow cgroups to select > a subset of the swap backend in a specific order. It is still in the > early stage of discussion. If you have any suggestion or feedback in > that direction, I am looking forward to hearing that. Interesting. There have been concerns to leak confidential data accidentally when it's getting written to a swap device. The other less discussed item was QoS for swap io traffic. At a first glance it seems like tires could help with the second use-case. - fabian --000000000000b3d5ca060c878ba6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Friday, December 15, 2023, Chris Li <chrisl@kernel.org> wrote:
> Hi Fabian,
>> On Thu, Dec 14, 2023 at 10:00=E2=80=AFAM Fabian Deutsch <fdeutsch@redhat.com> wrote:
><= br>>> Yep - for container use-cases.
>>
>> Now a fe= w thoughts in this direction:
>> - With swap per cgroup you loose = the big "statistical" benefit of having swap on a node level. wel= l, it depends on the size of the cgroup (i.e. system.slice is quite large).=
>
> Just to clarify, the "node" you mean the "n= ode" in kubernetes sense,
> which is the whole machine. In the L= inux kernel MM context, the node
> often refers to the NUMA memory no= de, that is not what you mean here,
> right?

Correct, I was re= ferring to a kubernetes node, not numa node.

>
>> - With= todays node level swap, and setting memory.swap.max=3D0 for all cgroups al= lows you toachieve a similar behavior (only opt-in cgroups will get swap).<= br>>> - the above approach however will still have a shared swap back= end for all cgroups.
>
> Yes, the "memory.swap.tires"= idea is trying to allow cgroups to select
> a subset of the swap bac= kend in a specific order. It is still in the
> early stage of discuss= ion. If you have any suggestion or feedback in
> that direction, I am= looking forward to hearing that.

Interesting. There have been conce= rns to leak confidential data accidentally when it's getting written to= a swap device.

The other less discussed item was QoS for swap io tr= affic.

At a first glance it seems like tires could help with the sec= ond use-case.

- fabian --000000000000b3d5ca060c878ba6--