Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8431840rwb; Tue, 13 Dec 2022 06:21:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4gAiIdn0kthlqK/wP2NJWKpEFCx5xxgsJKP4Sgx1Xg0IlDV8eCIZ1W7rHBpzzJZVtERg23 X-Received: by 2002:a05:6402:1693:b0:46c:91fa:5a7d with SMTP id a19-20020a056402169300b0046c91fa5a7dmr18487245edv.12.1670941280235; Tue, 13 Dec 2022 06:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670941280; cv=none; d=google.com; s=arc-20160816; b=LwmG2mstefrm7wukuTK3r5w5/KH+b5Pj4O0j//PPRFIzdU/rNZHUjB4zvQT8t6SHp9 MkYNPP+oAiOJLF1jkJ1eR71H7BkGd9sGhzuX/7X9xJgbZt690HhCAIK0yfThNiglzWKq Ii7lHVvpi5aXYpmlKSqRyHMlexKl/Uf1Y1eoK7yxxlOpjT91c2/BDUNuUm0UM6s+Ea0M 9VKuDOojvLv3m+QNfxvsmwnRKr/QMrhtx+lNmkSqQjt0K2DAyD3JIlU05xNK81IzmY9N guSRWJlujUtuA8rSv5Fc0vMy/zyqk11NofxAtQXB0fqMqa0DwIfNpYFIzbe8t82zjpNF KNrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:dkim-signature; bh=iFObNv7SXhRCOqsI0Mn0COs/Vc6CHXDFMLyv6UIK9wA=; b=OA1dVpstXEtEEuUZVEzFjc/QP2bFTBxEXqnDYdfGLk4vcd12c4BegPuEk8M0DKmFlw V47BvsT4qYrUmnuv99XxUb17tCGYa/K0s7eb3n/trV+g4KkuhPyvkTDXy0AZggFYVnyX CiMrUMciR5HK03kLiyAtkpe9CClRxJnqJWAmsNCv7WXJhgrEgdtJ9XfkGLdKdY1P+P/G Q29XFGizYYon05oXlUeuywE2Ou2tSiJvfdDjfS5GZWxmIoqsU+aQ2WKPWqfZfAWVysx8 UnbD7xIt/LmozxyZTSlVFAUVlUGJV6FIdFi/Eb369poPSQDHL35YQ7AlXEJWem4Qg7w1 KB1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VZmYsUSK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a05640250ce00b00463c29b153dsi11363845edb.297.2022.12.13.06.21.02; Tue, 13 Dec 2022 06:21:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VZmYsUSK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235708AbiLMNnQ (ORCPT + 72 others); Tue, 13 Dec 2022 08:43:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235768AbiLMNnC (ORCPT ); Tue, 13 Dec 2022 08:43:02 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95A0D8E; Tue, 13 Dec 2022 05:43:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670938981; x=1702474981; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=XCQGGTjFZDCNegxIbrsrKbDLonWPRMS8SgLrOu3wwKk=; b=VZmYsUSKZjvlKomuMD689fIIhTd7j1Tw8vbxBgtYJ+6oqZ92WTB85Ffp EZmmiN2bzre3pupahYqFTq5ZmtgSPFnm/OJdW0shvRsfyvadYANythArN W1jL9ZeTStSxPaF4wACKyrY8zZj5QyEyP2tsJ25jCQhX0JV3XGfKTLJNT y+hlmnAXkrxkxWT3RfBFwRLtNp4X+nIn5/bxJocLPoY2irCip8HXrUJHv IKgCh+6028QZIC0xWxUzwoO95ZZC/EdFa+y8HS02EjL3epJiJg5AqFuwC HPagXXrvgxOpNS/DbLTnwKO3GdO1fsms75rzOVqBn/m+vu21ih6dUW/xg A==; X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="297810521" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="297810521" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 05:43:01 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="790936440" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="790936440" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 05:42:57 -0800 From: "Huang, Ying" To: Michal Hocko , Mina Almasry , weixugc@google.com Cc: Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Yang Shi , Yosry Ahmed , fvdl@google.com, bagasdotme@gmail.com, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3] mm: Add nodes= arg to memory.reclaim In-Reply-To: (Michal Hocko's message of "Tue, 13 Dec 2022 09:51:27 +0100") References: <20221202223533.1785418-1-almasrymina@google.com> <87k02volwe.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Date: Tue, 13 Dec 2022 21:42:02 +0800 Message-ID: <87bko7h13p.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE autolearn=ham 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 Michal Hocko writes: > On Tue 13-12-22 14:30:57, Huang, Ying wrote: >> Mina Almasry writes: > [...] >> After these discussion, I think the solution maybe use different >> interfaces for "proactive demote" and "proactive reclaim". That is, >> reconsider "memory.demote". In this way, we will always uncharge the >> cgroup for "memory.reclaim". This avoid the possible confusion there. >> And, because demotion is considered aging, we don't need to disable >> demotion for "memory.reclaim", just don't count it. > > As already pointed out in my previous email, we should really think more > about future requirements. Do we add memory.promote interface when there > is a request to implement numa balancing into the userspace? Maybe yes > but maybe the node balancing should be more generic than bound to memory > tiering and apply to a more fine grained nodemask control. > > Fundamentally we already have APIs to age (MADV_COLD, MADV_FREE), > reclaim (MADV_PAGEOUT, MADV_DONTNEED) and MADV_WILLNEED to prioritize > (swap in, or read ahead) which are per mm/file. Their primary usability > issue is that they are process centric and that requires a very deep > understanding of the process mm layout so it is not really usable for a > larger scale orchestration. > The important part of those interfaces is that they do not talk about > demotion because that is an implementation detail. I think we want to > follow that model at least. From a higher level POV I believe we really > need an interface to age&reclaim and balance memory among nodes. Are > there more higher level usecases? Yes. If the high level interface can satisfy the requirements, we should use them or define them. But I guess Mina and Xu has some requirements at the level of memory tiers (demotion/promotion)? Best Regards, Huang, Ying