Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756035AbcCCDMJ (ORCPT ); Wed, 2 Mar 2016 22:12:09 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:30742 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046AbcCCDMG (ORCPT ); Wed, 2 Mar 2016 22:12:06 -0500 Subject: Re: [cgroup/for-4.6 1/2] cgroup: re-hash init_css_set after subsystems are initialized To: Tejun Heo , Johannes Weiner References: <20160302180712.GA11029@mtj.duckdns.org> CC: , , From: Zefan Li Message-ID: <56D7A9E5.2030507@huawei.com> Date: Thu, 3 Mar 2016 11:05:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160302180712.GA11029@mtj.duckdns.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.236] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0202.56D7AB3E.0099,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 5970c178654dec13fef05d74b020dc49 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 788 Lines: 18 On 2016/3/3 2:07, Tejun Heo wrote: > css_sets are hashed by their subsys[] contents and in cgroup_init() > init_css_set is hashed early, before subsystem inits, when all entries > in its subsys[] are NULL, so that cgroup_dfl_root initialization can > find and link to it. As subsystems are initialized, > init_css_set.subsys[] is filled up but the hashing is never updated > making init_css_set hashed in the wrong place. While incorrect, this > doesn't cause a critical failure as css_set management code would > create an identical css_set dynamically. > > Fix it by rehashing init_css_set after subsystems are initialized. > While at it, drop unnecessary @key local variable. > > Signed-off-by: Tejun Heo For both patches: Acked-by: Zefan Li