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 X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A3FBC38A2A for ; Thu, 7 May 2020 17:49:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 330B520643 for ; Thu, 7 May 2020 17:49:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 330B520643 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D061A900003; Thu, 7 May 2020 13:49:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB862900002; Thu, 7 May 2020 13:49:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF49D900003; Thu, 7 May 2020 13:49:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0182.hostedemail.com [216.40.44.182]) by kanga.kvack.org (Postfix) with ESMTP id AB9CB900002 for ; Thu, 7 May 2020 13:49:54 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6A4C4181AEF21 for ; Thu, 7 May 2020 17:49:54 +0000 (UTC) X-FDA: 76790661108.14.walk16_73927de4c6a02 X-HE-Tag: walk16_73927de4c6a02 X-Filterd-Recvd-Size: 3933 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 May 2020 17:49:54 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id e26so7521240wmk.5 for ; Thu, 07 May 2020 10:49:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uzx7yPipGDJlLzd9pOfuRh3M2JP+Q1gSc82f3ElJ8zY=; b=tjr0PwZGLTCO/0bjYpeHDHZbGG98Q/MPXUk/e7T/9xHt+qnyv4i9Y5++85Rraz1D4N 6t+NpAJ84tjIuTu8svqsmocW+0wiJqG2glyzv35jxZa88cm+Rs0QGFJ8FpY9vP4/21f7 uKZVdumyc6nxUNM5hRhHQihxNA7PrtxgugseqC5JwbqRPCORrvGG9PfwWIn4IhVGMiwr +Ap7zO66xIaC6dKIlhwXAe9OFr4MT4e4ktEq9f2v6TsgLRgKAkqblasPqDIe4zWdVSuh Gh54KReXCEz1Nxe/AMHWk1k9DQ4irqcQ+nKblPKVvd/fV5N71WxjTCp3YTJ0tVaelntP VpQg== X-Gm-Message-State: AGi0PuZ68yZKc2z7A2dYk34FIKMpm2YnOw6Ia/PD08/37LDVTUCRD7Gi ubdLTw5GExIB/jEMjeRBF+8= X-Google-Smtp-Source: APiQypIzr87jhEXZelDUSzpK7Ud4dOVfvMCNVoLIJsfeJx8v5mGHEwPPoIyxRblXb/5q9zF8hQSNcQ== X-Received: by 2002:a1c:1fc9:: with SMTP id f192mr12578342wmf.129.1588873792788; Thu, 07 May 2020 10:49:52 -0700 (PDT) Received: from localhost (ip-37-188-183-9.eurotel.cz. [37.188.183.9]) by smtp.gmail.com with ESMTPSA id k133sm9875442wma.0.2020.05.07.10.49.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 10:49:51 -0700 (PDT) Date: Thu, 7 May 2020 19:49:49 +0200 From: Michal Hocko To: Shakeel Butt Cc: Johannes Weiner , Roman Gushchin , Greg Thelen , Andrew Morton , Linux MM , Cgroups , LKML Subject: Re: [PATCH] memcg: effective memory.high reclaim for remote charging Message-ID: <20200507174949.GN6345@dhcp22.suse.cz> References: <20200507163301.229070-1-shakeelb@google.com> <20200507164653.GM6345@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu 07-05-20 10:00:07, Shakeel Butt wrote: > On Thu, May 7, 2020 at 9:47 AM Michal Hocko wrote: > > > > On Thu 07-05-20 09:33:01, Shakeel Butt wrote: > > [...] > > > @@ -2600,8 +2596,23 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, > > > schedule_work(&memcg->high_work); > > > break; > > > } > > > - current->memcg_nr_pages_over_high += batch; > > > - set_notify_resume(current); > > > + > > > + if (gfpflags_allow_blocking(gfp_mask)) > > > + reclaim_over_high(memcg, gfp_mask, batch); > > > + > > > + if (page_counter_read(&memcg->memory) <= > > > + READ_ONCE(memcg->high)) > > > + break; > > > > I am half way to a long weekend so bear with me. Shouldn't this be continue? The > > parent memcg might be still in excess even the child got reclaimed, > > right? > > > > The reclaim_high() actually already does this walk up to the root and > reclaim from ones who are still over their high limit. Though having > 'continue' here is correct too. Ohh, right. As I've said weekend brain. I will have a proper look next week. This just hit my eyes. -- Michal Hocko SUSE Labs