From patchwork Sat Jul 15 03:08:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 120733 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp2844109vqm; Fri, 14 Jul 2023 20:17:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlFDbqoGn/2G1ktAd7uBgwMeqAl1pfRrPDZv5xbAQmCMj50/Cbbn2iVb5WePO5QCEIt/brAo X-Received: by 2002:a05:6358:2815:b0:134:d559:259a with SMTP id k21-20020a056358281500b00134d559259amr8541686rwb.17.1689391065396; Fri, 14 Jul 2023 20:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689391065; cv=none; d=google.com; s=arc-20160816; b=XvOLFDg5BzSSg7syfPUKHzxoUt42zJsyOfliwdCgsuKKMCsinYqKddqkUXjOJ5pHSt dgT5eZNeDYnPEHu8X88nJMufUZWMwR5yGIYXuztWQVRlMOL7hk4oVTaCh4jqBPChh8F5 wsliLYbGG+cNXkOjG7jgOM/g7x5t6QSmjlIniElLBKyAfF4r781os/DMtK06qO0VcX2J 8JC7T1abjWO2lwfwhhYmacovZWeDHvRESWBWQTJgNHljj3cvUv7g8BJutDUdOjQ9vBKa hce1mWjZNXDaGRTQrul+NYjB/YjaDBgs3FP+MyuvQhxazYOCT8KjzM8vj22fy2dIbyV6 JLQQ== 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 :message-id:date:subject:cc:to:from; bh=OJwMp2p4Q0AZZSsAr2qCdn1TjA2glB+vJ1kUNWHafTU=; fh=pZWOv2pRkfQFUJ1QSi9xw43l3YtSwTmReJZNUnZfmEA=; b=OA1AQYReoN2d7Y73JU0nImok+S+s+pdsNg9I+XGq0wOyMaJn74xEMDnOaLNHdLjVFz buzhUJy0vfDiF0uRem/QPog/VK6VrIBP9mhdVQq/VEmgHxAH/isAyR8BPDf6M4w1JoJd 5gNqKZPoyUPkjRdcAy8EFwgwJ72NLCTn1Jm3QKfA+hgmFJdNnm/bUyu/aBRfJNUHAtlM kVu9z0b8PoUkwT2OKow1VTOKSFN8qVgvWCMNCp7gCN2cNmNUyAw7atCKpnySxjj7XzX6 zhOtGX6JxB6Dl3tYUw8z/SHAtBgqgJs67snqbECKZ7+yMIfZT0NQbHO7gw4Y0G2Uuyzz xoPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m16-20020a63fd50000000b005579d6bdf7esi1216431pgj.856.2023.07.14.20.17.30; Fri, 14 Jul 2023 20:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbjGODI3 (ORCPT + 99 others); Fri, 14 Jul 2023 23:08:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbjGODIZ (ORCPT ); Fri, 14 Jul 2023 23:08:25 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 917EA3A81; Fri, 14 Jul 2023 20:08:23 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R2tZ51qmgzhYj0; Sat, 15 Jul 2023 11:07:41 +0800 (CST) Received: from huawei.com (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 15 Jul 2023 11:08:19 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH] cgroup: use cached local variable parent in for loop Date: Sat, 15 Jul 2023 11:08:29 +0800 Message-ID: <20230715030829.2343109-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771454925779687104 X-GMAIL-MSGID: 1771454925779687104 Use local variable parent to initialize iter tcgrp in for loop so the size of cgroup.o can be reduced by 64 bytes. No functional change intended. Signed-off-by: Miaohe Lin --- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 6225d5829459..033f38fb5cef 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -5894,7 +5894,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) parent->nr_threaded_children--; spin_lock_irq(&css_set_lock); - for (tcgrp = cgroup_parent(cgrp); tcgrp; tcgrp = cgroup_parent(tcgrp)) { + for (tcgrp = parent; tcgrp; tcgrp = cgroup_parent(tcgrp)) { tcgrp->nr_descendants--; tcgrp->nr_dying_descendants++; /*