Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp52399pxh; Thu, 7 Apr 2022 13:43:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWZZGAddaPxBuh3YH5kcCUmRm7PWNBKqdlRGZIMFpwHvuPmmixaXNl2m1n4Ir4p939UTs1 X-Received: by 2002:a05:6a00:234f:b0:4fa:f52b:46a1 with SMTP id j15-20020a056a00234f00b004faf52b46a1mr16187401pfj.32.1649364193329; Thu, 07 Apr 2022 13:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649364193; cv=none; d=google.com; s=arc-20160816; b=vBt1msLY99KWORd+OernqGdXgf+3vwGVlm0zKAR4QAz8zZn+ec5SJuEMWUd9mFgmI8 OFbltb4JSRNeN4xoGv5A2EcqgpBNvH8Iqs7ig/5V27G1o9n0nxq/oMYqPEVE29WqUVTB azmELdf1uNvu3TOzOOe6LB2vkaBErdkD6kcJiwQIpw4isVD+iL0nJTcnRVc8JrJJ84/W kDBIk++VpTqEQm0wWQVf9JWeILKzMOYcxEkDoq1dtg16VNx3vFu2+tWqUzY4BRuRhFGd 96vvtXoZHTaaPV9t6/OaPX9w8adcun+YHhPFHj1Jnebbw4/w8zmFLl1IZ/ZgXYQzaUr9 UXzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4+V8CVr+PsVvoMRvSRXz1QR100B6sh+pY7exh4j2aBc=; b=vVQXubrvyeVF20Bh6dqEOlFYAYUMEEhTFsnctfum1/o8x0zMoeMXWUTmOYhcD0e/mi VNAyENKHNVaDGKrte56czuzrIunlOx9+Svtbuo0LestEmfgmugnb1bNbD8bnGxkMmFpS WRq5XG4+MiDT3xNPe9jnCeMzxFgerp+AX9schsN1vC2f4UMF39O+CDf++sVtRzKhvUCo WcVS1DuN3hqKizbn+A3gFM+Hx5becbE5vTdOBzE0yELNpg9UUKZsVN/bQ63tRI8P9BeW izoyJ9DEpNjhqxoEU5zU+6F2BFazbWjteBw8m01p+8xvdH0wFZDgk2fUhsB/VmwclIn8 f4+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=o5iaBUNZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x189-20020a6386c6000000b0039cce49d349si2263288pgd.319.2022.04.07.13.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:43:13 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=o5iaBUNZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 85C983C6502; Thu, 7 Apr 2022 12:52:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241914AbiDGHiH (ORCPT + 99 others); Thu, 7 Apr 2022 03:38:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241963AbiDGHhd (ORCPT ); Thu, 7 Apr 2022 03:37:33 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95C74DF4A; Thu, 7 Apr 2022 00:35:33 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 0340B21122; Thu, 7 Apr 2022 07:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649316932; h=from:from:reply-to: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=4+V8CVr+PsVvoMRvSRXz1QR100B6sh+pY7exh4j2aBc=; b=o5iaBUNZARcTgJe1NnxGXMIcqlgmG9bsli9PzpUf7DjbZ8YS1jF7HF8ooX2hVuDm3lyZSN 2DcYNmsVkwM1UhSNWQUsfsKBwgNocKT+VvJEyTI9AdJ7C8TBU5Lr4WzrxrVrdBGzBPvhW6 yBNJheAWgva8zVizVPCwPxEe5A7T1F0= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id F2B1CA3B83; Thu, 7 Apr 2022 07:35:26 +0000 (UTC) Date: Thu, 7 Apr 2022 09:35:30 +0200 From: Michal Hocko To: "Huang, Ying" Cc: Wei Xu , Yosry Ahmed , Johannes Weiner , Shakeel Butt , Andrew Morton , David Rientjes , Tejun Heo , Zefan Li , Roman Gushchin , Cgroups , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Linux MM , Jonathan Corbet , Yu Zhao , Dave Hansen , Greg Thelen , Tim Chen Subject: Re: [PATCH resend] memcg: introduce per-memcg reclaim interface Message-ID: References: <20220331084151.2600229-1-yosryahmed@google.com> <87y20nzyw4.fsf@yhuang6-desk2.ccr.corp.intel.com> <87o81fujdc.fsf@yhuang6-desk2.ccr.corp.intel.com> <87bkxfudrk.fsf@yhuang6-desk2.ccr.corp.intel.com> <877d82vi13.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877d82vi13.fsf@yhuang6-desk2.ccr.corp.intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 06-04-22 14:32:24, Huang, Ying wrote: [...] > I think we should define the interface not from the current > implementation point of view, but from the requirement point of view. Agreed! > For proactive reclaim, per my understanding, the requirement is, > > we found that there's some cold pages in some workloads, so we can > take advantage of the proactive reclaim to reclaim some pages so that > other workload can use the freed memory. We are talking about memcg here so this is not as much a matter of free memory as it is to decrease the amount of charged memory. Demotion cannot achieve that. > For proactive demotion, per my understanding, the requirement could be, > > We found that there's some cold pages in fast memory (e.g. DRAM) in > some workloads, so we can take advantage of the proactive demotion to > demote some pages so that other workload can use the freed fast > memory. Given the DRAM partition support Tim (Cced) is working on. Yes, this is essentially a kernel assisted memory migration. Userspace can migrate memory but the issue is that it doesn't have any information on the aging so the migration has hard time to find suitable memory to migrate. If we really need this functionality then it would deserve a separate interface IMHO. -- Michal Hocko SUSE Labs