From patchwork Mon Jul 16 04:53:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pandarathil, Vijaymohan R" X-Patchwork-Id: 1199871 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B70723FC33 for ; Mon, 16 Jul 2012 04:56:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750817Ab2GPEzw (ORCPT ); Mon, 16 Jul 2012 00:55:52 -0400 Received: from g1t0028.austin.hp.com ([15.216.28.35]:39464 "EHLO g1t0028.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750784Ab2GPEzv (ORCPT ); Mon, 16 Jul 2012 00:55:51 -0400 Received: from G1W0400.americas.hpqcorp.net (g1w0400.americas.hpqcorp.net [16.236.31.10]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by g1t0028.austin.hp.com (Postfix) with ESMTPS id 275511C28E; Mon, 16 Jul 2012 04:55:51 +0000 (UTC) Received: from G6W0173.americas.hpqcorp.net (16.230.33.182) by G1W0400.americas.hpqcorp.net (16.236.31.10) with Microsoft SMTP Server (TLS) id 8.2.176.0; Mon, 16 Jul 2012 04:54:00 +0000 Received: from G9W0364.americas.hpqcorp.net (16.216.193.45) by G6W0173.americas.hpqcorp.net (16.230.33.182) with Microsoft SMTP Server (TLS) id 8.2.176.0; Mon, 16 Jul 2012 05:54:00 +0100 Received: from G9W0337.americas.hpqcorp.net ([169.254.1.7]) by G9W0364.americas.hpqcorp.net ([16.216.193.45]) with mapi id 14.02.0283.003; Mon, 16 Jul 2012 04:53:59 +0000 From: "Pandarathil, Vijaymohan R" To: "Kani, Toshimitsu" , "lenb@kernel.org" , "linux-acpi@vger.kernel.org" CC: "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] ACPI: Add ACPI CPU hot-remove support Thread-Topic: [PATCH] ACPI: Add ACPI CPU hot-remove support Thread-Index: AQHNYQks1Kax+V9Qd0y1oXYnYRMZnpcrWrJQ Date: Mon, 16 Jul 2012 04:53:59 +0000 Message-ID: References: <1340981479-6521-1-git-send-email-toshi.kani@hp.com> In-Reply-To: <1340981479-6521-1-git-send-email-toshi.kani@hp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.210.48.12] MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Hi Toshi, Did some basic KVM guest cpu hotplug testing of this patch over your OST patchset along with fixes in qemu-kvm for guest cpu hotplug. Vijay virsh # vcpucount vmb91g1 maximum config 4 maximum live 4 current config 4 current live 4 virsh # setvcpus vmb91g1 3 virsh # vcpucount vmb91g1 maximum config 4 maximum live 4 current config 4 current live 3 virsh # setvcpus vmb91g1 4 virsh # vcpucount vmb91g1 maximum config 4 maximum live 4 current config 4 current live 4 virsh # setvcpus vmb91g1 2 virsh # vcpucount vmb91g1 maximum config 4 maximum live 4 current config 4 current live 2 The guest cpu counts (as shown by lscpu in the guest) also changes. Tested-by: Vijay Mohan Pandarathil -----Original Message----- From: Kani, Toshimitsu Sent: Friday, June 29, 2012 7:51 AM To: lenb@kernel.org; linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org; Kani, Toshimitsu Subject: [PATCH] ACPI: Add ACPI CPU hot-remove support Added CPU hot-remove support through an ACPI eject notification. It calls acpi_bus_hot_remove_device(), which shares the same code path with the sysfs eject operation. acpi_os_hotplug_execute() serializes hot-remove operations between ACPI hot-remove and sysfs eject requests. Signed-off-by: Toshi Kani --- This patch applies on top of the patchset below. [PATCH v6 0/6] ACPI: Add _OST support for ACPI hotplug http://marc.info/?l=linux-acpi&m=134074381322973&w=2 --- drivers/acpi/processor_driver.c | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-) -- 1.7.7.6 diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index f9fa1b2..a6f6bde 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -699,8 +699,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device) static void acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data) { - struct acpi_processor *pr; struct acpi_device *device = NULL; + struct acpi_eject_event *ej_event = NULL; u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ int result; @@ -732,20 +732,27 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, "received ACPI_NOTIFY_EJECT_REQUEST\n")); if (acpi_bus_get_device(handle, &device)) { - printk(KERN_ERR PREFIX - "Device don't exist, dropping EJECT\n"); + pr_err(PREFIX "Device don't exist, dropping EJECT\n"); break; } - pr = acpi_driver_data(device); - if (!pr) { - printk(KERN_ERR PREFIX - "Driver data is NULL, dropping EJECT\n"); + if (!acpi_driver_data(device)) { + pr_err(PREFIX "Driver data is NULL, dropping EJECT\n"); break; } - /* REVISIT: update when eject is supported */ - ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; - break; + ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); + if (!ej_event) { + pr_err(PREFIX "No memory, dropping EJECT\n"); + break; + } + + ej_event->handle = handle; + ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; + acpi_os_hotplug_execute(acpi_bus_hot_remove_device, + (void *)ej_event); + + /* eject is performed asynchronously */ + return; default: ACPI_DEBUG_PRINT((ACPI_DB_INFO,