Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp364869pxb; Thu, 9 Sep 2021 02:46:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3zn4MifSgAteeoP94Hh0ytFyl+6cD1Zw54lmt7UrEfKp2c4ZqhKaSBLw5yGkv/75Z6ozh X-Received: by 2002:a02:ad19:: with SMTP id s25mr2040822jan.17.1631180776696; Thu, 09 Sep 2021 02:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631180776; cv=none; d=google.com; s=arc-20160816; b=dZ8knprgv019pVue2SyCDgulrHK+XO2h+nASuNQe+hH06iaaJtN3OLSTIDlECRvoJT icPPAQKOt7L+m0/mB8X7fB55YS27MnVCVydeuJPPXLGwq5T+NMAIfnxEu4t59N5Ep83x +JAm6t3LbraENQdlit+7Zy4rVDLnmcBe2i7tVUWPt7V1jMtQP25SeJGWv4pQKUUZtlOf 92U431OH6xsRrD47ooVNoluVboRMyBmlDEEDWlV/ZkjTiuf08r9LBnVBpiaZArDKwGJz SqYTPMk5jsSpkkN4ElPmDdKtP/APzJsm4kgo27xOsHeq1Y+9I6SVcpPVCME+2vWBKK8M a2ug== 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 :user-agent:date:message-id:in-reply-to:from:references:cc:to :subject; bh=I47FDZ8HY0g0HJMTls9SGQJCLgYDVPUhkh/EqJHFyoQ=; b=i5+KY8zYJDcGBuk+yTF/c8v/fE6KFidMZ57HHUsMcpfdNIiKQuSUPY3lgkBm4dN0xM 0j4vVwH0pR7U4ZLGt5tX2MLRSnzDQcJOpkWV3/fIWnL/QeS1LlEbGniAYV2nJnxikc1p f6W8M88Za37zMBVNm7TDbSZMX8PO4acw/L45UF0+d3g4Tz7tyq056SsRv/a9GEcNG93Q uErx6lkCOedDy28yPBUy3qLNamH4+74Fku+zA/bZkP4vbYw96BRg9VdKs8UsG9n042Rc TLHTIsz+dKnm/uIQk4F17Ih/DhZrCscH8tXTcAqw9ATdxg/Q6Bqcp7xbxCiJzH0DE4Hv PlgQ== 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 t10si1722297iof.42.2021.09.09.02.46.05; Thu, 09 Sep 2021 02:46:16 -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 S233080AbhIIJq3 (ORCPT + 99 others); Thu, 9 Sep 2021 05:46:29 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:9022 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbhIIJq1 (ORCPT ); Thu, 9 Sep 2021 05:46:27 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4H4vGw3VLwzVh3h; Thu, 9 Sep 2021 17:44:24 +0800 (CST) Received: from dggpeml500018.china.huawei.com (7.185.36.186) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Thu, 9 Sep 2021 17:45:17 +0800 Received: from [10.67.101.251] (10.67.101.251) by dggpeml500018.china.huawei.com (7.185.36.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Thu, 9 Sep 2021 17:45:17 +0800 Subject: Re: [PATCH] kernel/sched: Fix sched_fork() access an invalid sched_task_group To: Tejun Heo CC: , , , , References: <20210826112635.7404-1-zhangqiao22@huawei.com> <1f0cd867-9c6d-4e22-cadd-06af9f852f7a@huawei.com> <128d52ab-b4ee-65f8-e0a3-2796ef43a98b@huawei.com> <3df62791-d123-db9b-ec9c-092c47a941cc@huawei.com> From: Zhang Qiao In-Reply-To: Message-ID: <3036e192-20ba-4345-66e6-14fa8b765d59@huawei.com> Date: Thu, 9 Sep 2021 17:45:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.101.251] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500018.china.huawei.com (7.185.36.186) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2021/9/9 0:29, Tejun Heo ะด??: > Hello, > > On Wed, Sep 08, 2021 at 07:32:06PM +0800, Zhang Qiao wrote: >> I will update this patch by following the steps below: >> 1)rename cgroup_subsys->fork() to cgroup_subsys->post_fork(); >> 2)add cgroup_subsys->fork() and the cpu_cgroup_fork() callback like this: >> >> void cpu_cgroup_fork(struct task_struct *task) { >> .... >> p->sched_task_group = task_group(current); >> __set_task_cpu(p, smp_processor_id()); >> if (p->sched_class->task_fork) >> p->sched_class->task_fork(p); >> .... >> >> >> 3)call cgroup_subsys->fork() after cgroup_can_fork(). >> >> Do you have any suggestion? > > I'm not following why it needs to shuffle the callbacks. Can't you just Just to provide a placeholder to call task_fork(). But thought about it, there are indeed some problems with this modification. Thanks. Zhang Qiao > relocate the fectching of task_group after can_fork?> > Thanks. >