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 93E23C4167D for ; Wed, 8 Nov 2023 08:11:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C75B8D00A8; Wed, 8 Nov 2023 03:11:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2770E8D00A2; Wed, 8 Nov 2023 03:11:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 118CC8D00A8; Wed, 8 Nov 2023 03:11:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 021818D00A2 for ; Wed, 8 Nov 2023 03:11:41 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CD537409DE for ; Wed, 8 Nov 2023 08:11:40 +0000 (UTC) X-FDA: 81434067960.23.8105927 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by imf30.hostedemail.com (Postfix) with ESMTP id D051C80015 for ; Wed, 8 Nov 2023 08:11:37 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=U2XuJVKl; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf30.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699431099; a=rsa-sha256; cv=none; b=jrfiC+m7BMTPsMGj5hGFc+1lNF31rJBzYuPC6UQZDv8/xBDgP+qs2vsMzD12ZalEJIvXyO Wf78CeQbOAqaMg/QMcFKChzy9gxzDaZk8y/iwGQvSQkYx5dycCu6D2OvIINMTyYJuKe2eb uDzA1ymHncEoPEIa5xDsDbGA/LGOMow= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=U2XuJVKl; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf30.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699431099; 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=7SHsIJephVm/R2zbiOXO6tDVmCT9fmbFsk0Xgr9LLBE=; b=5/H1x1xFwruJF8cic52u8vx/NkOGCmkPnvP4OnxCcWKU53FT2qvTZVsPFBlKDNA1w/EdMm a9Kz0/797ypuJX7sWdJwGtN5u8Rnm2bdeBmQ031DMANtguH3ZrD0NxzXHav6YI8y8tWtKP Yu1GP4qcP1fUeUM4xS+qn6qvk/dPx/Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699431097; x=1730967097; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=t39GUkIid9dZJeh3529U2jVJKYEbEiVsy5OvbtMLGXA=; b=U2XuJVKluA4E/U8gyJwy3Gurh+xieJGYPrz0jl6vrpJunnMWIKfA/PvO TsZyg/Nygf09FdkcNNTAe7Cj/egKlaygxRPR0oKk8HBgXbul48Cx7BhHy Dut3BBVfIClljUyU6OugZtk6gIQ5T4FIOcHqyGU183bj4gvtayC+/Fifm Q1oP9hOXfDoSNUi1LYpsOJPHQBLUGoSfQYOd4QngDYghYkzo0Ccx1IXd3 7L1jScA5T72ZnDrtHYS5hYzjMX5WRfCKe9D5Pzju/JIf09rdHDA7bx4rq msjkgoUP3TEjItLH4EaUFOeoh2queLshZZJGOXwn6rfxBT+n8w4ZNtylh w==; X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="389523279" X-IronPort-AV: E=Sophos;i="6.03,285,1694761200"; d="scan'208";a="389523279" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2023 00:11:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="936438382" X-IronPort-AV: E=Sophos;i="6.03,285,1694761200"; d="scan'208";a="936438382" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2023 00:11:31 -0800 From: "Huang, Ying" To: Huan Yang Cc: Tejun Heo , Zefan Li , "Johannes Weiner" , Jonathan Corbet , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , David Hildenbrand , "Matthew Wilcox" , Kefeng Wang , Peter Xu , "Vishal Moola (Oracle)" , Yosry Ahmed , Liu Shixin , Hugh Dickins , , , , , Subject: Re: [RFC 0/4] Introduce unbalance proactive reclaim In-Reply-To: (Huan Yang's message of "Wed, 8 Nov 2023 15:53:16 +0800") References: <20231108065818.19932-1-link@vivo.com> <87v8ack889.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Wed, 08 Nov 2023 16:09:29 +0800 Message-ID: <87r0l0k6o6.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: D051C80015 X-Stat-Signature: rppozwzmoe43uutiq6b1cymj8fhg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iOXZONVYE2igEW9CljLqMNrcy49SWHorvy4gy/QpG9GQEp6CtLpcocmKhdxHFdOTV4zdSzXgMnq4p/+T0zq9/3yi6UXkBl9w2HB5Nx9l9TM+wT8dJgLJ3TpaoqDGQbfPDgDLdjJSRtM0c+nRuL3xbw02ahs6MUXvNneGQIvphwH3wYp1oiNwKlwJ6g0uxLg0qE9clqP7dqGj9FjErbBlFhTYL8wz7ZEQ== 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: Huan Yang writes: > HI Huang, Ying > > Thanks for reply. > > =E5=9C=A8 2023/11/8 15:35, Huang, Ying =E5=86=99=E9=81=93: >> Huan Yang writes: >> >>> In some cases, we need to selectively reclaim file pages or anonymous >>> pages in an unbalanced manner. >>> >>> For example, when an application is pushed to the background and frozen, >>> it may not be opened for a long time, and we can safely reclaim the >>> application's anonymous pages, but we do not want to touch the file pag= es. >>> >>> This patchset extends the proactive reclaim interface to achieve >>> unbalanced reclamation. Users can control the reclamation tendency by >>> inputting swappiness under the original interface. Specifically, users >>> can input special values to extremely reclaim specific pages. >> From mem_cgroup_swappiness(), cgroupv2 doesn't have per-cgroup >> swappiness. So you need to add that firstly? > Sorry for this mistake, we always work on cgroupv1, so, not notice > this commit 4550c4e, thank your for point that. > > I see this commit comment that `that's a different discussion`, but, > to implements this, I will try add. > >> >>> Example: >>> echo "1G" 200 > memory.reclaim (only reclaim anon) >>> echo "1G" 0 > memory.reclaim (only reclaim file) >>> echo "1G" 1 > memory.reclaim (only reclaim file) >>> >>> Note that when performing unbalanced reclamation, the cgroup swappiness >>> will be temporarily adjusted dynamically to the input value. Therefore, >>> if the cgroup swappiness is further modified during runtime, there may >>> be some errors. >> If cgroup swappiness will be adjusted temporarily, why not just change >> it via a script before/after proactive reclaiming? > IMO, this unbalance reclaim only takes effect for a single command, > so if it is pre-set using a script, the judgment of the reclamation tende= ncy > may become complicated. If swappiness =3D=3D 0, then we will only reclaim file pages. If swappiness =3D=3D 200, then we may still reclaim file pages. So you need a way to reclaim only anon pages? If so, can we use some special swappiness value to specify that? I don't know whether use 200 will cause regression. If so, we may need some other value, e.g. >=3D 65536. > So, do you mean avoid use cgroup swappiness, just type anon or file to > control > this extreme unbalanced reclamation? > >> >>> However, this is acceptable because the interface is dynamically called >>> by the user and the timing should be controlled by the user. >>> >>> This patchset did not implement the type-based reclamation as expected >>> in the documentation.(anon or file) Because in addition to extreme unba= lanced >>> reclamation, this patchset can also adapt to the reclamation tendency >>> allocated according to swappiness, which is more flexible. >>> -- Best Regards, Huang, Ying