Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4393213rwj; Tue, 20 Dec 2022 09:30:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf7xRLdvcTpjZnp1YIAKwP5pqNUJM/S1yFIIncM4o6zjTZ1URvVZ1vlhOzMpcYItBMTqJcNy X-Received: by 2002:a17:906:fb02:b0:78d:f454:386d with SMTP id lz2-20020a170906fb0200b0078df454386dmr41303428ejb.42.1671557420562; Tue, 20 Dec 2022 09:30:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671557420; cv=none; d=google.com; s=arc-20160816; b=cmA13UprCFP5mB0Pq2U9XkVSOWUb54l8qcGA10BmOJ0YgC5Ug72CuVon0z3VA2qfMJ HoRSeP/HVl4HUq4ZFIWW1TCmYhyAuwFtocVn8Aju9lI8TPNNQrymSoKMW7WFzSj6hhPQ Ti1V6TdNH5OJhSlemsRU9bXzQLeNa7ChTpWR/rB+NIkFjy5Czm4pSefylxYY7ixd2yLZ blYkVR509zjlF7pS+ZzoC1/Uwuo8oV53OWvmiAimjC41qfHKrbHlmFPwaNlQJ50Z2r61 Kj1x3kw6d8zHGdlXEjq9LApb21BLlqAUfXTiWDVNG8KiwFXOTznJQWyduDTGuV7eJM5S DPaA== 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:dkim-signature; bh=KRZ5NBQkSBEMSzVXiSUDsWEBTOjISuGVrqOh0e75EmM=; b=iReiwCQ8Y6YbFwoalIem9MBd3lL/apT6yn/zsaHz/unWyRyA+FPhFaxpNWk886p9gs VsEukPQZZtcfJ3TKMDdgVMcLV+Ywhoa4wth8RLuoVtZMH63SCBLBQViWBQ3O7iLlItX2 TYufYv6QvfijjcOLJgIvriL9BDdIUEvl1fQlwH/OzGGYgqhqoUPZUY1Tk9Sxwy7h729j 42IZB2InSGZSXDRrhupaQRiVb/Uh7/5U9bWrCZqxXGJmFjcAaMxq7LovBKNhSQ6ZvX0s 3eZVv7+HtpZbnJUvEQAKTmW2gifzvRVn/lxE2K5B+E5A9afE2SfZr/Az2uLfW8oLlRRb i+Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gUb1ar3F; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a17090658c700b0077b45792af2si12199294ejs.464.2022.12.20.09.30.03; Tue, 20 Dec 2022 09:30:20 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gUb1ar3F; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233685AbiLTQ7z (ORCPT + 70 others); Tue, 20 Dec 2022 11:59:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233632AbiLTQ7v (ORCPT ); Tue, 20 Dec 2022 11:59:51 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FFC01838C for ; Tue, 20 Dec 2022 08:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671555545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KRZ5NBQkSBEMSzVXiSUDsWEBTOjISuGVrqOh0e75EmM=; b=gUb1ar3FA9jIQMgMFmjoB3CAfUSSsRO80YQAz8kSE0/QxXF22l8G4cCH7+e3V9zWd9zsHC 9KOxqbaOTi7Wg0ECmL7Mf6yTX3ef7Q16Ets7EAqEHk7FjNoU2+xZkHltPHY/SrVDuBGAYx gmCU/fYxr4rLwbIYERL6/MCIdDCo7vw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-44-16qy3JQhNAGn_wza0obbDw-1; Tue, 20 Dec 2022 11:59:02 -0500 X-MC-Unique: 16qy3JQhNAGn_wza0obbDw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7819B88B7A7; Tue, 20 Dec 2022 16:59:01 +0000 (UTC) Received: from [10.22.18.106] (unknown [10.22.18.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EE61112132C; Tue, 20 Dec 2022 16:59:01 +0000 (UTC) Message-ID: <9295b73a-5a3c-b1f6-d892-0da1d356ab9f@redhat.com> Date: Tue, 20 Dec 2022 11:59:00 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH] cgroup/cpuset: no need to explicitly init a global static variable Content-Language: en-US To: Daniel Vacek , Zefan Li , Tejun Heo , Johannes Weiner Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221220151415.856093-1-neelx@redhat.com> From: Waiman Long In-Reply-To: <20221220151415.856093-1-neelx@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 12/20/22 10:14, Daniel Vacek wrote: > cpuset_rwsem is a static variable. It's initialized at build time and so > there's no need for explicit runtime init leaking one percpu int. > > Signed-off-by: Daniel Vacek > --- > kernel/cgroup/cpuset.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index a29c0b13706bb..87fe410361b3d 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -3281,8 +3281,6 @@ struct cgroup_subsys cpuset_cgrp_subsys = { > > int __init cpuset_init(void) > { > - BUG_ON(percpu_init_rwsem(&cpuset_rwsem)); > - > BUG_ON(!alloc_cpumask_var(&top_cpuset.cpus_allowed, GFP_KERNEL)); > BUG_ON(!alloc_cpumask_var(&top_cpuset.effective_cpus, GFP_KERNEL)); > BUG_ON(!zalloc_cpumask_var(&top_cpuset.subparts_cpus, GFP_KERNEL)); It will be clearer if you mention that DEFINE_STATIC_PERCPU_RWSEM() is used to set up cpuset_rwsem at build time. Other than that, the patch looks good to me. Cheers, Longman