From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6140CD6E68 for ; Wed, 11 Oct 2023 13:07:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234894AbjJKNH7 (ORCPT ); Wed, 11 Oct 2023 09:07:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbjJKNHw (ORCPT ); Wed, 11 Oct 2023 09:07:52 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDE3EA9 for ; Wed, 11 Oct 2023 06:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697029670; x=1728565670; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=KLhN9KgQsZyg0n8Ly1Pb7b8a/0TBjyZmAM7hyIaqDU0=; b=J6fs9sLyRoI03cWWBHvxDYGmvSjZ9fbOUsYOMa5VTkXBWhy0W4ep3sG4 t/B5SpDOoTluUhn1q/aIZ+okZ5VQfhE3PJ9wBOd9MSNOm1WbM24B+Tafm miaA/CqhjysrZnGoPXqPDjXH9qF9RKTDPnJuc4YAXcaY8GVaNpYp1bvVS 42ddhRzAZRVCV7GER5NU7vnQGCyKawVQbltCgNJeaxHjKVpAyPrQlRTTO gqTNbY3CZA/u7ziiAhkuwGGqnXdWtXmGI2Nsf5uEHO29CvJpuZE92DhY5 Mi6q6P7CveRowvwjTi2G4vmD2dBkyoMm2NOm/UCr7bsl78vAshjQ2oE8+ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="415703647" X-IronPort-AV: E=Sophos;i="6.03,216,1694761200"; d="scan'208";a="415703647" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 06:07:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="788987517" X-IronPort-AV: E=Sophos;i="6.03,216,1694761200"; d="scan'208";a="788987517" Received: from laptop-dan-intel.ccr.corp.intel.com (HELO box.shutemov.name) ([10.252.56.166]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 06:07:46 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 0FD8B109FB5; Wed, 11 Oct 2023 16:07:43 +0300 (+03) Date: Wed, 11 Oct 2023 16:07:43 +0300 From: "Kirill A. Shutemov" To: Kuppuswamy Sathyanarayanan Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Elena Reshetova , Jun Nakajima , Rick Edgecombe , Tom Lendacky , kexec@lists.infradead.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/13] kernel/cpu: Add support for declaring CPU hotplug not supported Message-ID: <20231011130743.mdfi27pdwktefbsv@box.shutemov.name> References: <20231005131402.14611-1-kirill.shutemov@linux.intel.com> <20231005131402.14611-3-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 10, 2023 at 06:35:59AM -0700, Kuppuswamy Sathyanarayanan wrote: > > > On 10/5/2023 6:13 AM, Kirill A. Shutemov wrote: > > The function cpu_hotplug_not_supported() can be called to indicate that > > CPU hotplug should be disabled. It does not prevent the initial bring up > > of the CPU, but it stops subsequent offlining. > > > > This function is intended to replace CC_ATTR_HOTPLUG_DISABLED. > > > > Looks good to me. > > Reviewed-by: Kuppuswamy Sathyanarayanan Thanks. > > @@ -543,6 +546,18 @@ static void lockdep_release_cpus_lock(void) > > rwsem_release(&cpu_hotplug_lock.dep_map, _THIS_IP_); > > } > > > > +/* > > + * Declare CPU hotplug not supported. > > + * > > + * It doesn't prevent initial bring up of the CPU, but stops offlining. > > + */ > > +void cpu_hotplug_not_supported(void) > > +{ > > + cpu_maps_update_begin(); > > + cpu_hotplug_supported = false; > > + cpu_maps_update_done(); > > +} > > Since this function is not used in this patch, do you need to add __maybe_unused to > avoid warnings? Hm? I don't think compiler complains about non-static unused functions. It has no visibility if it is used. -- Kiryl Shutsemau / Kirill A. Shutemov