Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5364736rwd; Wed, 24 May 2023 00:09:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kiNfjnBxtnxxZ9dYc5qIwx8fcSACcWro55HpME8CYN4W/oFOfKMhUXOmCfY2MxbrQoJgI X-Received: by 2002:a17:90b:1d03:b0:246:5968:43f0 with SMTP id on3-20020a17090b1d0300b00246596843f0mr15685178pjb.10.1684912192580; Wed, 24 May 2023 00:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684912192; cv=none; d=google.com; s=arc-20160816; b=zyyl8w8VLhdh+g0XyVDMYOYxsEckivZkh1S5Fvevno+m/xBIC+0mM2I6s3z6Ybq67t EH2Qa7mf5i9OvdHEltX80yNDUCaIMiS+z/Iq1u4Kcxrs+6yNR8HyGszs4cS+P2AcWjKk veHCechx5dvi3epxqE1mSx3YgfADhECgeHJ4HsvZ5UXNfsFvsAxxI/tD9CO/seYLqgcq wYEdEO930CIRX00ZlJUYjVAhbLzE8skwNZ1sXKAB/NFplGFSlb2pUL75i2y4z5nBMc09 HaYgUtuzMaAOgMZ7dJMG+0GpJbWUPqQYF7WVgj1x/h52Fsh4AsujiKkQAoeykwKQ8EQZ CVQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=AKZ8ZwsZTbP8ncwM1qn57YZYAF3a/qhWLGPm4aT0vnk=; b=cRYF94ZRr4WvBvc3FMDVecZxf8Evcd9B9Bv7EypabX22qd67lWRDMEydX/DOzROnX6 eOZjXuBmEjoz+shR5aI8CwT9rofPqneCrB8YvcfIRUX2hnWyjGDKtIAtQGCyVhVSgLHO P5xpvBwwSxQEI06ME8I2l++UNuqozhVIWfdXDIySEtRN59DuX3qBX5qVz0B3NionC4SX oFFE0AvCzFxmWJcHPJ9/89qTFzAim23e+axKYz0uM/otROhlvSDRdWUVba+oIoD1GWsl nVLwms1xCkgs5Jn+uRva4WHN0dercpB3ml50WGelU6xctG+78glygX8IYIauaXFG9fcv VKzg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u27-20020a63b55b000000b00518a1800624si7994501pgo.307.2023.05.24.00.09.39; Wed, 24 May 2023 00:09:52 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239670AbjEXG4q (ORCPT + 99 others); Wed, 24 May 2023 02:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239212AbjEXG4V (ORCPT ); Wed, 24 May 2023 02:56:21 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB39BE71; Tue, 23 May 2023 23:55:46 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QR25B1jLzz4f3kpy; Wed, 24 May 2023 14:55:42 +0800 (CST) Received: from ubuntu1804.huawei.com (unknown [10.67.174.58]) by APP4 (Coremail) with SMTP id gCh0CgCnD7PvtG1k22hiKA--.7544S4; Wed, 24 May 2023 14:55:43 +0800 (CST) From: Xiu Jianfeng To: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH -next v2] cgroup: Update out-of-date comment in cgroup_migrate() Date: Wed, 24 May 2023 14:54:31 +0800 Message-Id: <20230524065431.145434-1-xiujianfeng@huaweicloud.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: gCh0CgCnD7PvtG1k22hiKA--.7544S4 X-Coremail-Antispam: 1UD129KBjvJXoW7Wr43Cr1rWry3Jr1rtw43Wrg_yoW8Jry3pr ykJ345K345u3Wqvw1UCas29ryfC3yFgF47t39xXwsayr13Jw1YgFy0ka13Zr1YvF4IkF47 tFWYva9YkFyqyaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUgCb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6r1S6rWUM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x 0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG 6I80ewAv7VC0I7IYx2IY67AKxVWUXVWUAwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFV Cjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCj c4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4 CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1x MIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Zr0_Wr 1UMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsG vfC2KfnxnUUI43ZEXa7IU189N3UUUUU== X-CM-SenderInfo: x0lxyxpdqiv03j6k3tpzhluzxrxghudrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 Commit 674b745e22b3 ("cgroup: remove rcu_read_lock()/rcu_read_unlock() in critical section of spin_lock_irq()") has removed the rcu_read_lock, which makes the comment out-of-date, so update it. Signed-off-by: Xiu Jianfeng --- v2: don't remove the comment, just update it. --- kernel/cgroup/cgroup.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index d8ba2c67910d..f10cef511ffa 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -2872,9 +2872,11 @@ int cgroup_migrate(struct task_struct *leader, bool threadgroup, struct task_struct *task; /* - * Prevent freeing of tasks while we take a snapshot. Tasks that are - * already PF_EXITING could be freed from underneath us unless we - * take an rcu_read_lock. + * We should take an rcu_read_lock to prevent freeing of tasks while + * taking a snapshot, because tasks that are already PF_EXITING could + * be freed when traversing all threads of leader. However rcu_read_lock + * which disable preempt is implied by the spin_lock_irq, so no explicit + * rcu call here. */ spin_lock_irq(&css_set_lock); task = leader; -- 2.17.1