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 3914CC47257 for ; Thu, 7 May 2020 16:47:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 071CC20870 for ; Thu, 7 May 2020 16:47:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 071CC20870 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 87A8D900004; Thu, 7 May 2020 12:47:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 82A7C900002; Thu, 7 May 2020 12:47:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 766FB900004; Thu, 7 May 2020 12:47:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id 5BBAC900002 for ; Thu, 7 May 2020 12:47:02 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 197204405 for ; Thu, 7 May 2020 16:47:02 +0000 (UTC) X-FDA: 76790502684.17.lunch96_32b7a0735e29 X-HE-Tag: lunch96_32b7a0735e29 X-Filterd-Recvd-Size: 3578 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 May 2020 16:47:01 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id u127so7594156wmg.1 for ; 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=i8Xe7AeDPh/L/bUhAqUlpk2/PRFU85YUDInpUdSiSYZ25h2OVTf2eMFumyEheEj07P hxsTHb3jweNUkbIT8w8mE0+UfS6BM3DYD4KdFDoAo1v4Zl/nZnuf98g1x/uy1OASgxie YWSP8KPnGMwNfuAeYLFJ3Q+EpCkB3NdtzDbqEqIgdubPyroIX3pUix1e8x2H2Xgyv+q8 g7vRuqB7pQTR5QHspxTVykGrl0YLynDO3CmfXl1iYdSdSCJMRXMfofUI0XcZkIxvwv4G fRR4tlja0kMAs8m3nHY823nQzj9o+qNmWDRfIh20DtUp4RFT3rsEypYSAuomDWLTRmRe eQKA== X-Gm-Message-State: AGi0PuY3/BZs1zTnyCwf8PEHMOpHffqajb6bdPdfx3Tr2zCdiBfhL1wx eZosZjxJrTW0LFoaEwtceF1BVPwN X-Google-Smtp-Source: APiQypIRx74HYY9YS+imm0npI96iz1lm4ynkT4c22/lcqv53j+jdbFjzODq4YvtVDcRdtqQ+RrqWeQ== 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> 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 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