Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp138071lqj; Wed, 10 Apr 2024 06:31:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiB+QiEX9BGa24/XlwJFg7TeeDgdw261lISXInXwKyVWnBD4xsd3CvHGvziCol2Mo8KOtk3tMCh6PsKPDK8IFTJsg182p+fe6JcJrTkA== X-Google-Smtp-Source: AGHT+IHqbynAVqW+svdVco3+nQ3icZtKr1Q1jtYjAu0BGn5m9sbs6VTNszRk/YMYrq1ldwjEJDZH X-Received: by 2002:a05:6214:4108:b0:69b:15bc:c765 with SMTP id kc8-20020a056214410800b0069b15bcc765mr2719906qvb.21.1712755875602; Wed, 10 Apr 2024 06:31:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712755875; cv=pass; d=google.com; s=arc-20160816; b=d4SEc8P0pKPgN+vUfSG2jBYxGbbjZcaZpgmon3Z1rfhtVF4Ukp08VcPrifYkpn5S2u ZUq+aSKJxRssYRaKn+VEFXgSTYdTkSGSDw/s76VquR+tk6wnfXYoDiC3pA3j9W/MvlN1 TKwsz2zrb4ow8lxhWo/y4cP3x8/ZMr6CrAokXupY3LUI6FfhQ4Y9Z4vYdfirIisaBI0b piuCfd3XWRRZP8JMh0rggOOiUz5AaNWMqnPC+xBKhaHWWWm/7eY7cFWxDeGeS0lIvbM+ lq/8vJjGmmwp0htZhedciGUlmR1GXiJ0WunkxN59LRMTcvmACl3h3XcoOhDKyG3ifFQD vhOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=9u380hRPGRxoQBMKaBuo6fGzabIaCWnCTiuGgLQM8W8=; fh=zEGmk4gArVX7ZXZHkgebk1BFRVO0MfMywHhteVOCv8w=; b=LEUBrBwBOXmEXWN7k+aru991V24Hl/BwB6K7ymD5Hlk0n6Bi6qjcM+vfpxf/vPnu0p 8qsaEzhejoomx69D6U37LWCVSDR4J0c5+uk//rfqLegDaodp76gZdpsvmR8ZQ/iEAkXZ AkXUB8v4v78YsaNKUpbCDcwlt4gNDzsIP1igtZuJzHVLXtDVWimL9X2kMuOqLOGOk63R UvDvxM59yTtyh0z+cxhYkRpcNc6Cd5uECXHFSPonW8cG715f78zyUqpNYghK0ZuMVurj p2iSwCIETHNKUau+LlDcIkaePsdaR64Tni+3BJNDCpVXA4FN+2h/WH0EwqC5JKfnlgYF 7Pgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-138606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a5-20020a0cca85000000b0069b31905905si2852939qvk.440.2024.04.10.06.31.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 06:31:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-138606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 533D41C21D9B for ; Wed, 10 Apr 2024 13:31:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF28D15ECF0; Wed, 10 Apr 2024 13:31:08 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD1F7158D76; Wed, 10 Apr 2024 13:31:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712755868; cv=none; b=ue7gTIxzsXlJVNTj4yz5R1JS8tYvyDlLUM2CxVvMpIYtyYUBfLGL23WqGlRUP97D+mbkuBUm4syxDyBTlB44NK7WoSomIugJIqpAQUuGaNlQmXoxrQoUScAD1HBCAsXVB+ZFKo1ddF3LiJytNbiH98auNs6M/Ngh3l5KFI4OR+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712755868; c=relaxed/simple; bh=T81nWrifqkrF1jPgKRiL81vtI/6DX3N2s7ITSs9oN0s=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gwweA1rqUuIWdkUGO8NMREGxSv/3cIguqtnzkxyXl3etN89OnYVQCJYVyGQPUdDXGHx7CHDdZJejZEgZGpw7/ZcCIlR8Ahzy+KPCupARGz1c1UMOYnPYTcQZoqg8uvY5vdXM5YTyie8END4GeYgVQGhqts8ppsE2vYmdEDeD4KY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VF3WC2Z6Bz6K7FW; Wed, 10 Apr 2024 21:26:15 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id B9E091400CA; Wed, 10 Apr 2024 21:31:02 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 10 Apr 2024 14:31:02 +0100 Date: Wed, 10 Apr 2024 14:31:01 +0100 From: Jonathan Cameron To: Miguel Luis CC: "Rafael J. Wysocki" , Len Brown , , , Subject: Re: [RFC PATCH 4/4] ACPI: processor: refactor acpi_processor_remove: isolate acpi_unmap_cpu under CONFIG_ACPI_HOTPLUG_CPU Message-ID: <20240410143101.00001f5a@Huawei.com> In-Reply-To: <20240409150536.9933-5-miguel.luis@oracle.com> References: <20240409150536.9933-1-miguel.luis@oracle.com> <20240409150536.9933-5-miguel.luis@oracle.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500002.china.huawei.com (7.191.160.78) To lhrpeml500005.china.huawei.com (7.191.163.240) On Tue, 9 Apr 2024 15:05:33 +0000 Miguel Luis wrote: > acpi_unmap_cpu is architecture dependent. Isolate it. > The pre-processor guard for detach may now be restricted to > cpu unmap. > > Signed-off-by: Miguel Luis Again the why question isn't answered by the patch description. I assume this is to try and resolve the remove question of releasing resources that was outstanding on vCPU HP v4 series Russell posted. I've not looked as closely at the remove path as the add one yet, but my gut feeling is same issue applies. This code that runs in here should not be dependent on whether CONFIG_ACPI_HOTPLUG_CPU is enabled or not. What we do for the make disabled flow should not run a few of the steps in acpi_processor_remove() we should make that clear by calling a different function that doesn't have those steps. > --- > drivers/acpi/acpi_processor.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c > index c6e2f64a056b..edcd6a8d4735 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -492,6 +492,14 @@ static int acpi_processor_add(struct acpi_device *device, > } > > #ifdef CONFIG_ACPI_HOTPLUG_CPU > +static void acpi_processor_hotunplug_unmap_cpu(struct acpi_processor *pr) > +{ > + acpi_unmap_cpu(pr->id); > +} > +#else > +static void acpi_processor_hotunplug_unmap_cpu(struct acpi_processor *pr) {} > +#endif /* CONFIG_ACPI_HOTPLUG_CPU */ > + > /* Removal */ > static void acpi_processor_remove(struct acpi_device *device) > { > @@ -524,7 +532,7 @@ static void acpi_processor_remove(struct acpi_device *device) > > /* Remove the CPU. */ > arch_unregister_cpu(pr->id); > - acpi_unmap_cpu(pr->id); > + acpi_processor_hotunplug_unmap_cpu(pr); > > cpus_write_unlock(); > cpu_maps_update_done(); > @@ -535,7 +543,6 @@ static void acpi_processor_remove(struct acpi_device *device) > free_cpumask_var(pr->throttling.shared_cpu_map); > kfree(pr); > } > -#endif /* CONFIG_ACPI_HOTPLUG_CPU */ > > #ifdef CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC > bool __init processor_physically_present(acpi_handle handle) > @@ -660,9 +667,7 @@ static const struct acpi_device_id processor_device_ids[] = { > static struct acpi_scan_handler processor_handler = { > .ids = processor_device_ids, > .attach = acpi_processor_add, > -#ifdef CONFIG_ACPI_HOTPLUG_CPU > .detach = acpi_processor_remove, > -#endif > .hotplug = { > .enabled = true, > },