Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp497165imw; Thu, 14 Jul 2022 05:33:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vIDzWkh9Jq/ussaNyElj9LWgBWPjmDCAFZrmqiESj91bJHSGqwMyipRqikjEnEMXQzhemD X-Received: by 2002:a17:902:ab53:b0:16c:3b00:4eaf with SMTP id ij19-20020a170902ab5300b0016c3b004eafmr8811122plb.132.1657802010903; Thu, 14 Jul 2022 05:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657802010; cv=none; d=google.com; s=arc-20160816; b=dl9UEW4lrIQt77AGEPELAOpYNZKr3c9Dz9WAeFq4ZRrsfdatGJiwD6UVPBRE2f62ng 0YPZLPIrgS5og9nRMyN0SGjpF0Xnw1BOV+rBtQjaR+SbR5Np9Wpqx0EsE16LOOGzY80z fk+/dmZEDNyhSl+RO5HbVjn0200VJBiEW65oAZlifcBrmXbcDnN1q+JAErg0gjp5c9bL iu/KuFZlz+CPTKyZcp/gxHe1noRytb0dL4fLPpYdl01Xo8AwDdqBmJy0faaMgLkvMaTq 0cwM1Bq5I1emnDj1kvD5ifEzOhHArluLtZYPypzqmwxuWHHnmVrBg0uzKpZUuCvw0B7q qn1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=CAFpgjbkSXs23SqMSdhXAXRILCOHwFb9tz6xE9wAZGg=; b=zf8Y+mK8E6FE0n42xxUIFjs+7y8cuc7sdaEIWJqjfLINrRoGNYFEV/mIN5/n5rPdbk THSkH/OTM7NOqIFWh7MT2zCl7kIr5xmi7FjP0EL5eaCZEfXug5nuHokGxdYM+LzrOJVR ORtz0f/K3P1sjkGofHIY3kFS/Lh+VC/gHF7NEQdPDV5Gp9QA2I5mBlR1MABB9WpyjQP3 8lkM0W8p5JV4PWDSm5n8A6nlT5SoeCIpfOEDEosM5cbJIq6yQQqXxM11bIGYwg0T5JHi R0QZ6WaHsuVlCwPCV+NZ9r2hNInEHs7bTHdjmA2NjAwXmiJ0+TpgQTlHjf0cAtfOum/A LO7A== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a63470c000000b00412a01de724si1808421pga.343.2022.07.14.05.33.18; Thu, 14 Jul 2022 05:33:30 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239130AbiGNMcM (ORCPT + 99 others); Thu, 14 Jul 2022 08:32:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239303AbiGNMb5 (ORCPT ); Thu, 14 Jul 2022 08:31:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3272542ACF for ; Thu, 14 Jul 2022 05:31:48 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6EA8213D5; Thu, 14 Jul 2022 05:31:48 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C7D0A3F792; Thu, 14 Jul 2022 05:31:46 -0700 (PDT) Message-ID: Date: Thu, 14 Jul 2022 14:31:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2 04/10] sched/fair: remove redundant cpu_cgrp_subsys->fork() Content-Language: en-US To: Chengming Zhou , mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, rostedt@goodmis.org, bsegall@google.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org References: <20220713040430.25778-1-zhouchengming@bytedance.com> <20220713040430.25778-5-zhouchengming@bytedance.com> From: Dietmar Eggemann In-Reply-To: <20220713040430.25778-5-zhouchengming@bytedance.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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 On 13/07/2022 06:04, Chengming Zhou wrote: > We use cpu_cgrp_subsys->fork() to set task group for the new fair task > in cgroup_post_fork(). > > Since commit b1e8206582f9 ("sched: Fix yet more sched_fork() races") > has already set task group for the new fair task in sched_cgroup_fork(), > so cpu_cgrp_subsys->fork() can be removed. > > cgroup_can_fork() --> pin parent's sched_task_group > sched_cgroup_fork() Don't we set the task group (`p->sched_task_group = tg`) now directly in sched_cgroup_fork() and not in __set_task_cpu()? > __set_task_cpu --> set task group > cgroup_post_fork() > ss->fork() := cpu_cgroup_fork() --> set again nit pick: cpu_cgroup_fork() -> sched_change_group(..., TASK_SET_GROUP) > After this patch's change, task_change_group_fair() only need to > care about task cgroup migration, make the code much simplier. > > Signed-off-by: Chengming Zhou > Reviewed-by: Vincent Guittot LGTM too. Reviewed-by: Dietmar Eggemann [...]