Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp369105rwb; Tue, 13 Dec 2022 19:09:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf70QhuFZAlRmKL7o4vzrWQiyrS4NP7h1dQjv5UR836fSMfYmJOXCBJh/9fhKIfqa0BuMKLr X-Received: by 2002:a17:903:515:b0:189:ec2d:89c0 with SMTP id jn21-20020a170903051500b00189ec2d89c0mr23991975plb.59.1670987374355; Tue, 13 Dec 2022 19:09:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670987374; cv=none; d=google.com; s=arc-20160816; b=LK71sUKrd2lsVz5ZcH2ONrr8kEi8a8fkHCGZv+Oq9uIyclVafGuOBFU6ZyyulI2A99 trk2OScfW1S8yFVGH6Jyqi4lTmb2zejrf5bgdMKSVfWUCu/GZ7fJT1TjTfF4Lz4DREiS DPFBtJMS0e810PKFxVnMGZ+3JUt5HHZ4qZVWEB4+n9+O6YGSqn0ZwMNm9SE9Z4xOVEGc x3LKmGEoPYI8ELbzJhZnK1uNqQOyIQzEpLDYG9LuDsjKIRwwUWHlIAvqhVGNiH7Vym0C k7lRa3XMakg4ZOOtuzggzYXHHmtBDNokyKrJ8IY+a95495cifNq2AS2rFpmYQuX4hFVI vIWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=T2Bo+BBjnqGGJw2O97UmAgNZFTgxTgab/gmI3Aw1OGk=; b=Tp1XKXW3EiE0TrNXZdut7kr6YpvQC5f5P/VQwf0iMzt7bDXM40aA32c8fvOEE/u/ex Qdw4SkSSbZaorsDVOZ1/fMGAa3wc0E2d96Zs4r+BymckKBD/VeZyDEnr0/lTVUZ2EPJO +uo7ZP7d5rRULWEm221DUOjiaao/OYSnD63hco+E4VEkNR6TtTjS89UopFlBX491303r su9+MjfnpngWls28mjfOihAjI6eNtn7Q9SoeAKOJEA2UTkRB9VUE4Gh/4tr79uf7vkJO xj2caH4l8RGuvZRh0iNEd3NTyZ0lriGhg5+KZzBbuVLle8VzFTM26HR6j0mJ7FnQTJcz mgiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AM7H6Ht1; 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 m7-20020a170902db0700b00189fdf3b84csi1842281plx.385.2022.12.13.19.09.21; Tue, 13 Dec 2022 19:09:34 -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=AM7H6Ht1; 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 S237148AbiLNC64 (ORCPT + 71 others); Tue, 13 Dec 2022 21:58:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235717AbiLNC6y (ORCPT ); Tue, 13 Dec 2022 21:58:54 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 977D313F7F for ; Tue, 13 Dec 2022 18:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670986733; x=1702522733; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=ExjfdK4PVXcQs1nDQm/OvoUCmX5LNXAjOgYPOUopzVo=; b=AM7H6Ht1urGG4xkKzHQ6s3MtKyzG5i1AMSL+cKHnLMberSlvxQk7xWgl arK62jFTIrvzSjtlrPUu5N/R/gfHt370Q7zN/O7XzqL37Ba2fg5J3FDin getatZph1T+2G99qVsgwBM9PsziwpUB9+OKkh9ypdj6IH2RHbrpq3IqT6 PVuFqbOBOGmbUh71A/oLz9XZysUhN/C+eznbsN1Aqpm+K3oR0OTLJtNrR 6wSdEqptpKWN7lzTuqHY5oes0cibJIBJQtOfGEKcEx8yQRMueOia5AVJN tk498DpXGr1WKHmoN1Zd/XpJTocf24d8EZp/2GmX53Nu/CFmgnmhdAVS+ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="315935589" X-IronPort-AV: E=Sophos;i="5.96,243,1665471600"; d="scan'208";a="315935589" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 18:58:50 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="791155668" X-IronPort-AV: E=Sophos;i="5.96,243,1665471600"; d="scan'208";a="791155668" 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 18:58:48 -0800 From: "Huang, Ying" To: Michal Hocko Cc: Dave Hansen , Yang Shi , Wei Xu , Johannes Weiner , Andrew Morton , linux-mm@kvack.org, LKML , Feng Tang Subject: Re: memcg reclaim demotion wrt. isolation References: Date: Wed, 14 Dec 2022 10:57:52 +0800 In-Reply-To: (Michal Hocko's message of "Tue, 13 Dec 2022 16:41:10 +0100") Message-ID: <87o7s6g09b.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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: > Hi, > I have just noticed that that pages allocated for demotion targets > includes __GFP_KSWAPD_RECLAIM (through GFP_NOWAIT). This is the case > since the code has been introduced by 26aa2d199d6f ("mm/migrate: demote > pages during reclaim"). IIUC, the issue was introduced by commit 3f1509c57b1b ("Revert "mm/vmscan: never demote for memcg reclaim""). Before that, we will not demote for memcg reclaim. > I suspect the intention is to trigger the aging on the fallback node > and either drop or further demote oldest pages. > > This makes sense but I suspect that this wasn't intended also for > memcg triggered reclaim. This would mean that a memory pressure in one > hierarchy could trigger paging out pages of a different hierarchy if the > demotion target is close to full. It seems that it's unnecessary to wake up kswapd of demotion target node in most cases. Because we will try to reclaim on the demotion target nodes in the loop of do_try_to_free_pages(). It may be better to loop the zonelist in the reverse order. Because the demotion targets are usually located at the latter of the zonelist. Best Regards, Huang, Ying