Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp934671ybj; Thu, 7 May 2020 10:51:44 -0700 (PDT) X-Google-Smtp-Source: APiQypKzzmoVDI1mmmUKFS2Djvf8rCQyzF9hAcI6JnqcEopT/IQDnBWSD3xlH+e4qNDGX2qOL6f3 X-Received: by 2002:a17:906:5e4e:: with SMTP id b14mr13378862eju.285.1588873904364; Thu, 07 May 2020 10:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588873904; cv=none; d=google.com; s=arc-20160816; b=Q7jj2OYwXqWeEaUqi2QhCPQJkKDFPB/fAUnG6pCLM4uNrgAjl3039v0cYfrmlMXzND cmwDXvQ/GAZjtE1HU9YI5wQhVoeTqK8+odYdJJ9k+6OhHY2tFHZoSpLJRCtmbAozBBKH fIKNU1XlhC8RGcW32VbjCRYDHxeLd4YX5bsTPcE/ZP/AEMB/NJS+S1dIBuUf/lEP//f7 DNQROQUUT635jOw46Xr32Hj/tqfF9rVJ3XS2sxUPZEJcmKLiluDeNRbjwB4sZQlfdj7e 86YZeeOi1enyLRiYEoqnfujYokBJ+suKMbpbmMrBeBuaaR6CMwiOSkvhIclLe05CwIp+ IEpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=uzx7yPipGDJlLzd9pOfuRh3M2JP+Q1gSc82f3ElJ8zY=; b=czXS6jz6gncOjEnnaTuCxcRjRXBxbS8rUTVoScKuPW4+2tPa+DMG5kCnXL+GgUn2j5 WunXTs/G3oKH6Ely6IB2UGBbe3mod7KoLjEjjJx1AkUZ4h6rY4ns21kk7wlmDJxwOr/p zKPPERgbO//N31HUH42lYJ90ag57EsPGg7wwfyeq1IDwhj/G6e/wS/2tb7+PvDt/3A0L +KyJ0uFUirTvAv5fsKUv2Ixmojc+mmDHC5aKbg/iVaUyEB+u881nqKzYaA0ySlaJt/Tx xTlv4c2VXz3pLGnp8H5jvua2UigupTVMoaRZpxlO3dfuyVi4L0mfQzpqvZzNF/DLlISz iv4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si3525782ejq.495.2020.05.07.10.51.19; Thu, 07 May 2020 10:51:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727780AbgEGRtz (ORCPT + 99 others); Thu, 7 May 2020 13:49:55 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37628 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726367AbgEGRtz (ORCPT ); Thu, 7 May 2020 13:49:55 -0400 Received: by mail-wm1-f65.google.com with SMTP id z6so7834916wml.2; 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=SjSHKjg5wPelS7nsNbolhH2TI4JkNmfUEucLnOJLJf9QiVPOv+0J+0kz490Frs4sLN L4C4uz6hdW4H4iOXTQruVf0a9f+Wz/Vn7+HPsLSQMxEvW6JFY2FaCUFswU6ktMkycw7c wIP0CTLq6TVyOPtC8T1TPcYqQssWpIxTIynuuwVQT/XvdJhv+fMeSg5pTVj8XMxL2DTz lKSqbeuADNCTDzCm+Pr4U04ZvzyL4s2GJ1Ty0OQzk+2F+OHGgXvzQ5iqn7Mxr1YFau1s K/zv+p267aAB/vR0iyVoE7xTV+zbNIIGpfvP35F8MAhBKN62AEmtbd2EAvIVfii/qRXp gixw== X-Gm-Message-State: AGi0PuaJsDBQWRjK+DjXDwGhvF4g2jpATOzvk7mMbmc3heFbra7D00Oo yC0ra2weRcj53WT1ttdt0z4= 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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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