Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp886411ybj; Thu, 7 May 2020 09:49:44 -0700 (PDT) X-Google-Smtp-Source: APiQypLL3ywr6mXtwr+WOHPG+lbqfRqUzBvfjkyObqhU9AXsldA+/3Kb4x84kZCbcQG+KXcvsKxO X-Received: by 2002:a50:c3c2:: with SMTP id i2mr12507071edf.93.1588870184030; Thu, 07 May 2020 09:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588870184; cv=none; d=google.com; s=arc-20160816; b=TYyyU2+HOy1RhlsbmDm3Ov+fcWwDcNJoNnVhrGx5ftfaO4nXt0cq9nSoXiJ8KjmjlI WqpKDslbsQnGc1l8aSKbl7tHHsQvQiDq/wlwgqrTM+WKczvLSO4KVGc+dWHcSDqJ7/p1 aXg1uMsA3oBEBjB2JXQarDwMnrxQ1O08FS4GYKAnj+2XBsZZQy8Z5WqD5madcbkAULaG rdn4D+joRXIWfh5XmIx7J/mDRLfn99Lh/YL4aqO+Ab8wHrlhcOMv0n7vTmEYJJTT3mcK u7BT/tFZXDmGjc/Vf0dd04eu7E0zHP/FpvC5iUQ1fuXOoAE8SZleHrSvmPVep1C5DEP6 7jTw== 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=EIgmxX814C2jT2rV+jySB1AamDNAJaeVnCN6Yqs05Yc=; b=QgeqPkem3Ibeb8nEo0O6Ub7BIIH19H2rPkM6LpCxuXEGawaqYBCe9qCVhWS3Kqo49C e7h5PjLqQXmWwM5Gc589gkwu7QMgedRkysbMGwhw66wRT4PRk3U1oUtGph0z34QtFaGN ipvK9CZDVZynMX2EcoasaZnr+Yufg3uCPgBxnic6duZjAYIXl5XJzrXPqRXeFdeakZ+n imr7oa6QmD2UTA+eKQH3B7r5+eW7Nm5Ls/5Jf0zehJw4l2tkVuxetGKnmICZ7k4UDUvi 3VMev/oegqJ05XfSAmN/H/kya6oetGG/nTMsZdnM+VIx0biOq+DTY3SslS+0JhCfAZlr /vmA== 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 d63si3478083edd.226.2020.05.07.09.49.19; Thu, 07 May 2020 09:49: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 S1727834AbgEGQrD (ORCPT + 99 others); Thu, 7 May 2020 12:47:03 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35802 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgEGQrC (ORCPT ); Thu, 7 May 2020 12:47:02 -0400 Received: by mail-wm1-f67.google.com with SMTP id r26so7628844wmh.0; Thu, 07 May 2020 09:47:01 -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=EIgmxX814C2jT2rV+jySB1AamDNAJaeVnCN6Yqs05Yc=; b=Xef9qLQjR2f/kicB9gNJl7Eej+C7MRdgXG2das2uFdQx/D30LcYEg1afokNFfdRhev QuJq3i2XC7Udf7KH4wCIG6AgZ2tIXXPAbig2bpvhbHsB+m0vuhyy1Mmstl15r5JW/pCI gsPSoZrgAJiGjGlHrxVI5A8FwbCqGH1dc5c4CibhT/topZJfPsCoytqAcXUVVdqhVueO g++JNmVKZvPw3PHlR+uPWTEq/vBRiPnySxOMkDZQBrE7l//JF3fLCuVVPVrQi4bwlxPa owGOJeq1ltuQkQMet2JORaDA6cBNobgOcVm2OcJppbUypDcC0sw4CNsn6ecx4EBX/R+l VfDw== X-Gm-Message-State: AGi0PuZmeZ+u1p1LDiwv4Ken/9QZNN+TMdgWdLZGBAmvyEoaGLBC9kKk 38UV8zoCWuMWxYpWzIoDHTw= X-Received: by 2002:a1c:ed04:: with SMTP id l4mr11315095wmh.93.1588870020627; Thu, 07 May 2020 09:47:00 -0700 (PDT) Received: from localhost (ip-37-188-183-9.eurotel.cz. [37.188.183.9]) by smtp.gmail.com with ESMTPSA id q2sm3554922wrm.42.2020.05.07.09.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 09:46:59 -0700 (PDT) Date: Thu, 7 May 2020 18:46:53 +0200 From: Michal Hocko To: Shakeel Butt Cc: Johannes Weiner , Roman Gushchin , Greg Thelen , Andrew Morton , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memcg: effective memory.high reclaim for remote charging Message-ID: <20200507164653.GM6345@dhcp22.suse.cz> References: <20200507163301.229070-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200507163301.229070-1-shakeelb@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 above reclaim might not be able to do much. Punt > + * the high reclaim to return to userland if the current > + * task shares the hierarchy. > + */ > + if (current->mm && mm_match_cgroup(current->mm, memcg)) { > + current->memcg_nr_pages_over_high += batch; > + set_notify_resume(current); > + } else > + schedule_work(&memcg->high_work); > break; > } > } while ((memcg = parent_mem_cgroup(memcg))); > -- > 2.26.2.526.g744177e7f7-goog > -- Michal Hocko SUSE Labs