Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8645046rwb; Tue, 13 Dec 2022 08:44:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf5tzw7NBPwZxSKrKN3FUFq795QG31Gf9DFNUXrqz/u8JAQ2KUongEypd9VdQTDUyI5veEjM X-Received: by 2002:a17:903:2487:b0:189:bdd4:1d60 with SMTP id p7-20020a170903248700b00189bdd41d60mr18917046plw.7.1670949887394; Tue, 13 Dec 2022 08:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670949887; cv=none; d=google.com; s=arc-20160816; b=X1VrKnymse4pDS0WOoY2sEKTBHXlGaA0XQpWnmLSaqyuL8KcepcrAUQhY4UQZBQXil IFS8l5f4xisEjr6JPI68GMHPpZdcGpNA88ftSH988FYGiZ7hr9Au5/wmkquEtDbk64wS 3IAlFyzdhtTW39W402i+mcWIaN3n82XbpR8KV/X9JuT1OPTQ2Zbl60YUJJ0KTtPCzns7 GiFFWeGzzIBEeFrF0HYp5bd8g4IhQIrUzYNZpVbMeYgxeaPOIi0Q+wCqHf9E62i5mla4 z0HkGuTqeVnUODH10rymt5fmP+UV7E3LWeFnQ/wbAKME9boj0YOqxFjQGl8E+b/+Dr2H tnSA== 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=f1nD9sEqUn0kZvdyrOVwMupeHs9n9TUcPbvvCTtNHKY=; b=eNw07kD5ZU/WYAtfDKthgavcbcyC9Lakixn85/jFy5g+eKepUviXuVFJFiSMVcDMrr xXys7RqtrlRuSHFK/iJ52J8f/0k8nHcfCRJ6XtctDe5iZbngGW2Fsh64iBfg9xdRloGY pefR7s6qmM/QbL18H7DgqfoFA3j95aZ5BQHzR9UMn0XC5TpFkooY6cUemaIMxDS56jL3 E5+jzw8qNwvc2phniQBE5kOqPXRHugdLzCD4fkX8Xx+GA71p3EINKDOZUExNYDdHajzj 4kYUV2g8adVu4vcJDDoA7D2BCUa7IsQN+K18X7I4p2DWM2rb8iEPr5t4OnX8eGJ81Cii jYPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=Dcg+fvf5; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jk18-20020a170903331200b001899dca65b5si198723plb.272.2022.12.13.08.44.37; Tue, 13 Dec 2022 08:44:47 -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=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=Dcg+fvf5; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236032AbiLMQO6 (ORCPT + 73 others); Tue, 13 Dec 2022 11:14:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235670AbiLMQOz (ORCPT ); Tue, 13 Dec 2022 11:14:55 -0500 Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 006B320984 for ; Tue, 13 Dec 2022 08:14:53 -0800 (PST) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-3c090251d59so198788707b3.4 for ; Tue, 13 Dec 2022 08:14:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=f1nD9sEqUn0kZvdyrOVwMupeHs9n9TUcPbvvCTtNHKY=; b=Dcg+fvf5E73fyEBvAWU3Q9s+yoVXu4xkzlDFKkK6XjenGPZH+qPhP787QtMpRHBe6+ AJkLvvbBr648QYu5qDnZx9EhqHEMMXgCE9eq1F45KD19dbZMHYxhYj0zjusaUcSXueaW O5bUKkSuKhwU6lhynhlcCjan0b0vEurCg2y6f92+lj7Ktbz/K/zHAT/JI8mf1suAGVVZ ZCdfJdu5A5SRUz7UzJ/Wpz8MCvexDVHVd9+IEbm/8Ok1Yp8Dk7QDnHQ5gmf2MMlrl2QY RFJY0mymmScFWzWBVBkb7z9G9xc6KKwOwARGpaP/CaiQx3P9z9k3+ISZFUUPfGsAIF+J JwlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=f1nD9sEqUn0kZvdyrOVwMupeHs9n9TUcPbvvCTtNHKY=; b=XeIGWtRXLnRNj7j02/wQ68q3/r1U5SR0D1vcOOsbu6auC02tkrjE+nB9PRo658tJZN InE6OtSr867goI7wMqEK4TmOVljGQytJ9pis3hkwLvtksM0droROYHmxuQpZJ+eNbitu Mb6757QpS2zzh+QMFmkqRu6Z9w0v+OV8tnCsmA3dr19eRyTFRVwGQN012cjbU8vZfWr6 /cvYIp9h716UQw+/geYEd1mntTSf8gTfaQbayEnabkh/sylpcncfo6gWpfINjnI6IRCu Dw4SepUQZtaGz7lqHdPvFNIWvikoCcT6pgNHeFJr0x9JgpRXpD/1NxM23gLFjFG40Wlx v6NQ== X-Gm-Message-State: ANoB5pnVQZgfTAOC1VAnwTd04hPh1yD91xIJA5k97Tw8OFCN+BvUdTEC 6iQBRNihcSCvXOwjQixhJDVDQA== X-Received: by 2002:a05:7500:5c1b:b0:eb:3b43:9eb7 with SMTP id fd27-20020a0575005c1b00b000eb3b439eb7mr2217849gab.5.1670948093136; Tue, 13 Dec 2022 08:14:53 -0800 (PST) Received: from localhost ([107.116.82.99]) by smtp.gmail.com with ESMTPSA id bm25-20020a05620a199900b006fa4cac54a5sm8142328qkb.72.2022.12.13.08.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 08:14:52 -0800 (PST) Date: Tue, 13 Dec 2022 17:14:48 +0100 From: Johannes Weiner To: Michal Hocko Cc: Dave Hansen , "Huang, Ying" , Yang Shi , Wei Xu , Andrew Morton , linux-mm@kvack.org, LKML Subject: Re: memcg reclaim demotion wrt. isolation Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Tue, Dec 13, 2022 at 04:41:10PM +0100, Michal Hocko wrote: > 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"). 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. This is also true if you don't do demotion. If a cgroup tries to allocate memory on a full node (i.e. mbind()), it may wake kswapd or enter global reclaim directly which may push out the memory of other cgroups, regardless of the respective cgroup limits. The demotion allocations don't strike me as any different. They're just allocations on behalf of a cgroup. I would expect them to wake kswapd and reclaim physical memory as needed.