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 832DCC4332F for ; Fri, 9 Dec 2022 16:42:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A5A618E0003; Fri, 9 Dec 2022 11:42:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A0A798E0001; Fri, 9 Dec 2022 11:42:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D3058E0003; Fri, 9 Dec 2022 11:42:03 -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 7E07E8E0001 for ; Fri, 9 Dec 2022 11:42:03 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E542D1C5BAB for ; Fri, 9 Dec 2022 16:42:02 +0000 (UTC) X-FDA: 80223334884.25.1E84B85 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf27.hostedemail.com (Postfix) with ESMTP id 670EC40019 for ; Fri, 9 Dec 2022 16:42:01 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=kcLGQWVD; spf=pass (imf27.hostedemail.com: domain of weixugc@google.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=weixugc@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670604121; 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=i9EfDV7EBqWGFnaYDO/cpEuxlHa0WTqeQPcdpc0bkis=; b=taDMzHTGLthG0bBLA4X0YxVNLXDlvyfc6+bwFVuqNcXhMk43xBl32JiiDZiQ+iv3jW4SBE gQQOZ5dpJaomCAdG3Xpue9BYsQWDZcACUEk2/ZLV+x44h03F9vLHwFH2lTnS7AomlkxIZc HLxoHKbAP4LlMGPqVqCT89+cD4iewB0= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=kcLGQWVD; spf=pass (imf27.hostedemail.com: domain of weixugc@google.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=weixugc@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670604121; a=rsa-sha256; cv=none; b=zQjDwPAWnURMo6y1Znxopid6UeAFHAASuOc5YQp8Pd+bWAc7X3xj20D+MzUvaA/ySDQkI5 2YqqX5G5CZUljNTDeOzEoithER5UN5ZjWqXzc0Vfx0JRUyIzvwc558MR/28PfXGquzgQ5u nkpkYpfFLK5tbBsVs1vymiPgAEd1LWE= Received: by mail-pj1-f47.google.com with SMTP id js9so4347242pjb.2 for ; Fri, 09 Dec 2022 08:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=i9EfDV7EBqWGFnaYDO/cpEuxlHa0WTqeQPcdpc0bkis=; b=kcLGQWVDzGqnXIK2OUrhHfduI4saLmxlUlFxYA9TOx0BiOqjv8QeRv2rj6gheEKZQz 0llTw8X/KWAcHOngmarldA48AVKQPn+z1PmtohnnYihrZ8BpShW5/47uz2yu6AO1pUZp kGeZ1W0F83IyD+lEuWShFxFquSzpmZfN7w3CW7jBvVCit++L369DBisGLHumCA30U/xm CbvT8HwLVYkGLM/pfSv6n83X3ffWEpHZ6ZDA28a9VBmcVaEy65LD2brgEm4bjJo16hJ6 felu+EU0W3Kzk7v9K0gntBqoxsRvDeglbJGTr0ta4uVF5HWzFyUPTlTLAmdrrCDgDhwN S34w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i9EfDV7EBqWGFnaYDO/cpEuxlHa0WTqeQPcdpc0bkis=; b=A8M9hswY6n5oN8/KibEjxSxdH2CHcICqNwx9kA54bXwBCNRrsc6J7t/FhU0wcaiUFu nWfJ0epMEEjvNdsFmt0Qx4vmAbNEnt9wCTXooE+v1y+ivUajcDLBzYNyrWJnHlcCIqWn L9aziFXpBn+8rgVMyTYc9ZhOkUYjsBGKrMn+PsaXqQ8jiYacUVU+/+Rfrc7TUiU1oHcQ YXWnXSim27fWvANpL86/tZ/oNtZzghQm0vsgsNCjKlWduBpLbQQBPfyiiNKv3BEc3a6Q EtQ5K/jZDvt6+fa2ilfy6WROkA12P+2MhyPJ74g2JSZjX/KlklgwBN2TAIqjqb23Xl/U nOQg== X-Gm-Message-State: ANoB5pnvsslZndmQXEjoJS0Ll9GX4giGKC6JntnuIRRqizXxrdldq4De HG9kz2nEBJcFzWel4VZAnjnA19yi6Qn1KOLKz2NgYg== X-Google-Smtp-Source: AA0mqf7ULUiN+XaofS3Qne0MnOWDIr+MNzzEs7jX1BbeeJOaJKhvLNL48/v0L4GOmW52sb8gAXURlFw8L6Zpf/LMyzA= X-Received: by 2002:a17:90a:5a41:b0:219:41ef:a812 with SMTP id m1-20020a17090a5a4100b0021941efa812mr51961934pji.153.1670604120017; Fri, 09 Dec 2022 08:42:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Wei Xu Date: Fri, 9 Dec 2022 08:41:47 -0800 Message-ID: Subject: Re: [PATCH v3] [mm-unstable] mm: Fix memcg reclaim on memory tiered systems To: Michal Hocko Cc: Mina Almasry , Andrew Morton , Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , Huang Ying , Yang Shi , Yosry Ahmed , fvdl@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 670EC40019 X-Stat-Signature: pppti75utw7ymrunpcn3g49r4itihrbx X-Rspam-User: X-HE-Tag: 1670604121-408472 X-HE-Meta: U2FsdGVkX1/jZitK9uwaSCvpRs4jC6Nog9mYGgb2mLrjFkzbvKKMurHXGYf9Ku8YeGdbvFvC8yIg8NL/zhjfjafln7BU2uMd44WLIr4Ama7Ql5SHmmqWTfeHhHSJ5xdgajjEHHERvRigJrBU0C8jSR3gdTAMKwgEWfmR+HuhyizMZ0pCdBkXMRrfjBf6kvgPKoHjTzdPUcO+lJcLPQttQ8/rq3/EyqK7egeNtyeVHUSdDig61Il6AN32w+LP0RZhNVLf9XVhrnNpD/xOVBU3eg5zFIKCCfRsvlkB/FgVKcMUxwkpLAI6kuXbVo9B6vmd0uSMw9L4r13toDv4xmuedy3bwaLvq4boubJLtYMRefzuLtKUGI+IfL+fAMQihAkP+tFrQO5X4yrHzv3CYl9ZFxuVTd2LVQICgDsXqM47cWu8D8lZq2EIEYdQz8WNGgv0hbdTE5RfXeIiGIGY7LUSYb4h622b5SfXZc9t/3cc5YdwXs1VBb/Soyc0fQfSrFnAuN25N4lt/fgeSJvo0I6BAWqhZAzU0d9kF4ctULxzSAdTUDLM87dgbY0nmDoo+hvFkVJOAt9JAmRi8eKswz0B8uFcz7Pgl+g/sovJyFSKA6UuNK3qRn88oKYFcJVxC2AOSGQShhhHzE2afayISCkg0O4+TTzDq1ygDlSyhyBb87cbcK3jCKGx4pfH3sJL/AkkOSk+by2f/yuStrl68+kZAcOSkUSvT9tU8PMcTDI7eYlGflTBPp4b/32pqF6cabILbWdc05KJN5iwMOXW6eqTWWn9fssfHPXyvtSNjXpwntOFZrxnoLi/ytRSx4kBTZHdbpwjJBRMXr7H/6z+tyDd7ogrWkBNDsRQd9ivwOthWqgkf2GaUeHfS0o0vPk42/IFipaA6Y8LgCxTZA0gyA5j9qK7+xFsfPCvXrmjZAz4gKqR0cFSderNvkpDFc0kIm2wooQ7mc/sY5zbodQqVNq jmzfLBDN bNkRWqq8v/HAmwfI= 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 Fri, Dec 9, 2022 at 12:08 AM Michal Hocko wrote: > > On Thu 08-12-22 16:59:36, Wei Xu wrote: > [...] > > > What I really mean is to add demotion nodes to the nodemask along with > > > the set of nodes you want to reclaim from. To me that sounds like a > > > more natural interface allowing for all sorts of usecases: > > > - free up demotion targets (only specify demotion nodes in the mask) > > > - control where to demote (e.g. select specific demotion target(s)) > > > - do not demote at all (skip demotion nodes from the node mask) > > > > For clarification, do you mean to add another argument (e.g. > > demotion_nodes) in addition to the "nodes" argument? > > No, nodes=mask argument should control the domain where the memory > reclaim should happen. That includes both aging and the reclaim. If the > mask doesn't contain any lower tier node then no demotion will happen. > If only a subset of lower tiers are specified then only those could be > used for the demotion process. Or put it otherwise, the nodemask is not > only used to filter out zonelists during reclaim it also restricts > migration targets. > > Is this more clear now? In that case, how can we request demotion only from toptier nodes (without counting any reclaimed bytes from other nodes), which is our memory tiering use case? Besides, when both toptier and demotion nodes are specified, the demoted pages should only be counted as aging and not be counted towards the requested bytes of try_to_free_mem_cgroup_pages(), which is what this patch tries to address. > -- > Michal Hocko > SUSE Labs