Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6075749pxv; Thu, 29 Jul 2021 06:02:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxElRzSdH6xY+suO7hzcb7q4G9mY/hdzE5hqDogkejmiqL+yC4Z1ONGh1sUfZWqUv2VmH6R X-Received: by 2002:a17:906:c1d0:: with SMTP id bw16mr4619547ejb.146.1627563721920; Thu, 29 Jul 2021 06:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627563721; cv=none; d=google.com; s=arc-20160816; b=W1yjlbTItt37qYJR/LxSfXByNBowwl//QuNwuw2hJmJLXCaJN6drqKlowNOxBCtVt1 +dAyrzfclDzY6oGpEhEetdJ1JSWoN+YGJ5i202DIlgVvc0Q80TFlE/NsJqs4RKaTYcZ6 30qx0cHUuWWMWEg4nwEXPg22t+zDHm6Q7mP7Ita4OrcQXls3Yxt9I9ffeysfrzJyuePm rYcg0Y/fLHz6Or2MuNSKYjd5pEJAJpO9s2a80LVNfdKKZW/shamX2RTcKfSr/+HiGkJs RlvStczFzj/Oc+EiJiWZMdD1yV3TlWJ1hu3N3SfrcliCfVR9ih+DkvkOy8Cvt42t7r6R to/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jA62ogIV74TDdUxSOA0BAMppFKpT6670XwM9qMi+07k=; b=F0Hy7K4gxOK0QN97/aMd7Iro50crtvuIsFmqP7tPoxZ+qEfBNaR2iIt95zB2w8THpt MpFW4Qg+yurRzUzF2h5R6geQejDviGIE3ZCe0s0Ch12i8JYSCoSGPTMkdzNub8Ll8/Fw TAHadM8D0LKGaG9r0n1FV5zynaSXicxxAMDDAdToGwvbXBMsb10RBbUx6wvCxusIrybI homJWi+m1encBWSXl8xuKyHvpD5qqMODXQ1jAqFabXg14hD9tVcwngq10zjAFLA88e15 2gntn6NSuyOLDYP3ob3+xBYjrdxhyaZCbst/j/m/19xTJtcDCsGVfIGEVde2WQdwYRuZ lhyw== 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si2542835edc.520.2021.07.29.06.01.37; Thu, 29 Jul 2021 06:02:01 -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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237381AbhG2M6E (ORCPT + 99 others); Thu, 29 Jul 2021 08:58:04 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7895 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234245AbhG2M6A (ORCPT ); Thu, 29 Jul 2021 08:58:00 -0400 Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Gb9TF6k1qz81CY; Thu, 29 Jul 2021 20:54:09 +0800 (CST) Received: from huawei.com (10.175.124.27) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 29 Jul 2021 20:57:55 +0800 From: Miaohe Lin To: , , , CC: , , , , , , , , , Subject: [PATCH 3/5] mm, memcg: save some atomic ops when flush is already true Date: Thu, 29 Jul 2021 20:57:53 +0800 Message-ID: <20210729125755.16871-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210729125755.16871-1-linmiaohe@huawei.com> References: <20210729125755.16871-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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