Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6710180pxv; Thu, 29 Jul 2021 23:53:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTpnnWOGCX5rjNfRC5M8WTDonPh7/ee0yB6Eoq31YoJPvtvoRS/V9TkuP+UdEVDsO8VTUl X-Received: by 2002:a05:6402:c81:: with SMTP id cm1mr1228758edb.355.1627627998224; Thu, 29 Jul 2021 23:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627627998; cv=none; d=google.com; s=arc-20160816; b=CxiCj287hbz51aytXxy/s+CRveeQAv2eYEYW3bInjrEuWubbXMip8yP7Pchf7JcKvy JaavjnTZfOcUrum3w9YMnVrZktxfYZE4sPSy1lL+zDlTv1NxvvE3ksVeSBA4QTGA2wW5 Gfaw2tCq99+R0BEBPstuhjnEubi422ekpHcECmowlJHrnFv+FoMwRKNPWaOJDWMvEUCO cevLqGFnmwKy70MkjD7CDxFjtPsw0FvSndvaEU5I1ubvFUB0gb5z2z5xkDxwhaYwI9Fj dCG3H2BLAd5QXk9mIa9cet5obRO4gEz48TD1V9Gju+V04rWnBt+yYBE638vUKGqyd6s3 Qa9A== 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=JU3Y5J8NTdc7M6n9NoKsTCUbYMjkBBca/WKKJGoryDo=; b=D/Ekg/np6WgRo4XMS39dMbgxLkigg6foIDcoPCTMdbSZILlmNgxxrT21e2iKMg4Z1G qNJjRqGc/MJrpctwt38LUTHvvlrhL7iWC5uwUeEXi6op1oDKqFBsivKrjh8L/vWrk3zA Ein8cKoapT3Oo4bf/hNwzRJd/lCVw65MqSaDV+rqe9Xx2t4l8wlUQlEaNdaRjBSskn77 /2DWoXjbtjbzgpDLQOx+5Cc3saU0mWzSKM1hgj3kNwIDGSUTyKwEbGYcYJLvH9Hn/Zot OWHcZLJVwD/Q67MNpA9DzIr2zTqLMTMA4gRLw3vhO+bvKQrl2PUbd+BMxwmqcTR/hgp0 oG5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=GksVOKRf; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u24si810599edo.515.2021.07.29.23.52.53; Thu, 29 Jul 2021 23:53:18 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b=GksVOKRf; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237600AbhG3Gve (ORCPT + 99 others); Fri, 30 Jul 2021 02:51:34 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:59386 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbhG3Gvd (ORCPT ); Fri, 30 Jul 2021 02:51:33 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 6341022349; Fri, 30 Jul 2021 06:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1627627888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JU3Y5J8NTdc7M6n9NoKsTCUbYMjkBBca/WKKJGoryDo=; b=GksVOKRfYmeR2RUP8XIfL2vg5hb5LIxjAS39cHhBHoJxg0KFftVR4wUpO4WzV5vGdycJ4z hG5JPhKddpFhD+SLE24qLZDzQU9riORLVGFrm71HqUSLeY3Dv21rQ4lq2lZXPefXht0JA9 nFpJIKLuppdSXu0VUNaji7ebeIY7DU0= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 2D163A3B87; Fri, 30 Jul 2021 06:51:28 +0000 (UTC) Date: Fri, 30 Jul 2021 08:51:27 +0200 From: Michal Hocko To: Miaohe Lin Cc: hannes@cmpxchg.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, shakeelb@google.com, guro@fb.com, willy@infradead.org, alexs@kernel.org, richard.weiyang@gmail.com, songmuchun@bytedance.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH 3/5] mm, memcg: save some atomic ops when flush is already true Message-ID: References: <20210729125755.16871-1-linmiaohe@huawei.com> <20210729125755.16871-4-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210729125755.16871-4-linmiaohe@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 29-07-21 20:57:53, Miaohe Lin wrote: > Add 'else' to save some atomic ops in obj_stock_flush_required() when > flush is already true. No functional change intended here. > > Signed-off-by: Miaohe Lin Acked-by: Michal Hocko > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index a03e24e57cd9..5b4592d1e0f2 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -2231,7 +2231,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) > if (memcg && stock->nr_pages && > mem_cgroup_is_descendant(memcg, root_memcg)) > flush = true; > - if (obj_stock_flush_required(stock, root_memcg)) > + else if (obj_stock_flush_required(stock, root_memcg)) > flush = true; > rcu_read_unlock(); > > -- > 2.23.0 -- Michal Hocko SUSE Labs