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 735FFC433F5 for ; Tue, 17 May 2022 16:05:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F05A58D0001; Tue, 17 May 2022 12:05:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB5056B0075; Tue, 17 May 2022 12:05:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D7D338D0001; Tue, 17 May 2022 12:05:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CAC026B0074 for ; Tue, 17 May 2022 12:05:15 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 88F6B20C17 for ; Tue, 17 May 2022 16:05:15 +0000 (UTC) X-FDA: 79475709390.28.42E2AEF Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf06.hostedemail.com (Postfix) with ESMTP id 163971800CA for ; Tue, 17 May 2022 16:05:11 +0000 (UTC) Date: Tue, 17 May 2022 09:05:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1652803513; 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=QRscBrAyYKCcsJKeuDnK4iX4aYhS2tbsgqstU6o6r+0=; b=E3i7b2DvMjTaav2SXoJjrd4womnB85IlKuEu0WiUCqZOEn75QMduH1dscInT1mHh0d/X2H 0jfXW0NcaUEoShRxWykTXdll8ZmIL2hasAGT/f1bR4rCjzHLRtw0/jnJJQshTVZLxaQqBF KkiCSxwcLLhNNQrn0+qH6cl7D3G9GSE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Yosry Ahmed Cc: Johannes Weiner , Michal Hocko , Shakeel Butt , Andrew Morton , David Rientjes , cgroups@vger.kernel.org, Tejun Heo , Linux-MM , Yu Zhao , Wei Xu , Greg Thelen , Chen Wandun Subject: Re: [RFC] Add swappiness argument to memory.reclaim Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=E3i7b2Dv; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf06.hostedemail.com: domain of roman.gushchin@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 163971800CA X-Rspam-User: X-Stat-Signature: pkbyxd9nuhz6dck1r4q6z59udiugkffh X-HE-Tag: 1652803511-378848 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: On Mon, May 16, 2022 at 03:29:42PM -0700, Yosry Ahmed wrote: > The discussions on the patch series [1] to add memory.reclaim has > shown that it is desirable to add an argument to control the type of > memory being reclaimed by invoked proactive reclaim using > memory.reclaim. > > I am proposing adding a swappiness optional argument to the interface. > If set, it overwrites vm.swappiness and per-memcg swappiness. This > provides a way to enforce user policy on a stateless per-reclaim > basis. We can make policy decisions to perform reclaim differently for > tasks of different app classes based on their individual QoS needs. It > also helps for use cases when particularly page cache is high and we > want to mainly hit that without swapping out. > > The interface would be something like this (utilizing the nested-keyed > interface we documented earlier): > > $ echo "200M swappiness=30" > memory.reclaim What are the anticipated use cases except swappiness == 0 and swappiness == system_default? IMO it's better to allow specifying the type of memory to reclaim, e.g. type="file"/"anon"/"slab", it's a way more clear what to expect. E.g. what $ echo "200M swappiness=1" > memory.reclaim means if there is only 10M of pagecache? How much of anon memory will be reclaimed? Thanks!