Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3476580ima; Sun, 3 Feb 2019 23:15:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN5OQR604JJpI3Gn7H372z9FkdFZxck68B6UgawbyeIQ2sQVksckuQT3UnXr3qrkuOtMrYxB X-Received: by 2002:aa7:83c6:: with SMTP id j6mr49936116pfn.91.1549264511049; Sun, 03 Feb 2019 23:15:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549264511; cv=none; d=google.com; s=arc-20160816; b=NaexAdxnnMXbhSWdslYXCZTMAuDJATkkqRavEjjbf6kinUQhGqPV17Lj8afM5XguWs sMIPMYjtVbuVHqmPMuSd8WhqfT0OxvJqYiBjma2kwGQT96Oj6g9v32TlrnPW6LaMNfEz TzBvq5Ua1MJhSwGwr2davdFrcdxXoo8w+CysWhd2QrIGPXoXp5lS/aTJ2tkOXDyAsk0s Qi/Ehdkb0KiMhQabAf/kDQTGKiHyPugRnF/CZYiHONvicmilR5YXrVEPr1D4HolR6avo dF6m+lHQRm+fSZZPVQgWIHOXBtSm/v21tAlI4owEqi9ot6yVdVqvRx8U71Uetn7jOHz6 i+yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=BM3+rOrrZV0YgRDBnl40ZzMI+pPwknz22Xb6T2bgxBk=; b=a0e4UVZQvBYUHDhKABeFfGBbSVxGFvE9VKWDVosMSv3jWLLNzhGsuFif0u3Q8IIJ2e PuE/Zc1EhMCr1CLGYEXE9JpRkdTjPV0kqw98oHgMw8/CIlZce0A5BTsG8kxd1ai6DrLc OhEOfugBPcBOT6xH2IjUv1la0E3RO9apeqVmoB+G7fijqAPveTojbgnoV6if+WICAdC9 tvt6TcWey/hJ8EV0tk37A63OoWyEfJpcR9AWkTNnsVBsL4s95dWBZ8LGYDYURoxRzm+l cSvrxdhA5iSrtPABRsc4Pj82YxPt7V6DT1sTbXyyw8dIY76/VlhBSf1EtJxejkopDs3H qQWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si15077283pfa.99.2019.02.03.23.14.55; Sun, 03 Feb 2019 23:15:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727975AbfBDHMf (ORCPT + 99 others); Mon, 4 Feb 2019 02:12:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:50798 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726023AbfBDHMf (ORCPT ); Mon, 4 Feb 2019 02:12:35 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3DFBBAF42; Mon, 4 Feb 2019 07:12:33 +0000 (UTC) Subject: Re: Question on handling managed IRQs when hotplugging CPUs To: Thomas Gleixner Cc: John Garry , Keith Busch , Christoph Hellwig , Marc Zyngier , "axboe@kernel.dk" , Peter Zijlstra , Michael Ellerman , Linuxarm , "linux-kernel@vger.kernel.org" , Hannes Reinecke , "linux-scsi@vger.kernel.org" , "linux-block@vger.kernel.org" References: <20190129154433.GF15302@localhost.localdomain> <757902fc-a9ea-090b-7853-89944a0ce1b5@huawei.com> <20190129172059.GC17132@localhost.localdomain> <3fe63dab-0791-f476-69c4-9866b70e8520@huawei.com> <86d5028d-44ab-3696-f7fe-828d7655faa9@huawei.com> <745609be-b215-dd2d-c31f-0bd84572f49f@suse.de> From: Hannes Reinecke Message-ID: Date: Mon, 4 Feb 2019 08:12:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/1/19 10:57 PM, Thomas Gleixner wrote: > On Fri, 1 Feb 2019, Hannes Reinecke wrote: >> Thing is, if we have _managed_ CPU hotplug (ie if the hardware provides some >> means of quiescing the CPU before hotplug) then the whole thing is trivial; >> disable SQ and wait for all outstanding commands to complete. >> Then trivially all requests are completed and the issue is resolved. >> Even with todays infrastructure. >> >> And I'm not sure if we can handle surprise CPU hotplug at all, given all the >> possible race conditions. >> But then I might be wrong. > > The kernel would completely fall apart when a CPU would vanish by surprise, > i.e. uncontrolled by the kernel. Then the SCSI driver exploding would be > the least of our problems. > Hehe. As I thought. So, as the user then has to wait for the system to declars 'ready for CPU remove', why can't we just disable the SQ and wait for all I/O to complete? We can make it more fine-grained by just waiting on all outstanding I/O on that SQ to complete, but waiting for all I/O should be good as an initial try. With that we wouldn't need to fiddle with driver internals, and could make it pretty generic. And we could always add more detailed logic if the driver has the means for doing so. Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)