Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5158646ima; Tue, 5 Feb 2019 07:15:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IZCcinaySeEXeeMWiDcGq7ZEvxcWZGDe/1ffRRR+59YjPogjgkvOisV5zw/ZMLrW3Z7razj X-Received: by 2002:a63:c22:: with SMTP id b34mr81579pgl.398.1549379750060; Tue, 05 Feb 2019 07:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549379750; cv=none; d=google.com; s=arc-20160816; b=ZUiOqZzmf7cF5XczZJx/NqMekC87auWItjv48T4f9dG7KINOH8HWm405sozqcTk/7A f63CdLK8PHP6LRhYmFjP//OrF+lOAx+/FgfTlNOYclIiYKvlyQUkmr21Enl/avr13b63 36q6PvpA4Axd115GXcBmwgTiZEuI+Sbd6f/lq0qu4Xaj8pvknI/mFTlbPHrSgqz+rDn8 VIw1TV4GRoMpakT7gueq1GodBQYam5hjNE0UUWr4HjbsXUABdYUOjuTMOeZZH58yVGo+ q7dd9JlNKgjkO4YQ/wihHGXyaENBOKdQkOknuvNyuIxWmtxCYviuMA7jHmKhThKmBcy/ CXgw== 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=fxdOdlMFc4eOsqjhTbC2HmJDbYKeL3oOhs/9izG31gE=; b=ptHDwkw2TwQVkUa8nHmLz/Ak8n83XR+k2O+kb/0c9UoXE/VEC2yX9GOa03aH3ftaYt EQWiVBNZ5dVdmhzEdgmn13MzeaLeFOqe4KT4dmZnY0hzMkNvijwoIeXCredRHHF2ou5D KG8uw2MDAiG5rR993moxszW3m6nkoxCIG5Cknxa3GBKDx4Jc+FxT/C0YtTbcYyl7IMG4 LoC5EMJQqd8Zw1lFqmCix4oF6VhfAVmUC5rF53R1nXmg4NE9joR4e62p69+gs3TmM2FE Msv++Nz/IDP85ezRX+hWA1tUS/pCNKlG/tDuMgGtF010aaQcusxelMlEiax6547cJaAO T38w== 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 a6si38267pfa.227.2019.02.05.07.15.33; Tue, 05 Feb 2019 07:15:50 -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 S1729606AbfBEPPO (ORCPT + 99 others); Tue, 5 Feb 2019 10:15:14 -0500 Received: from mx2.suse.de ([195.135.220.15]:58746 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728220AbfBEPPN (ORCPT ); Tue, 5 Feb 2019 10:15:13 -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 52B62B638; Tue, 5 Feb 2019 15:15:12 +0000 (UTC) Subject: Re: Question on handling managed IRQs when hotplugging CPUs To: John Garry , Keith Busch Cc: Thomas Gleixner , 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> <42d149c5-0380-c357-8811-81015159ac04@huawei.com> <20190205145244.GB28023@localhost.localdomain> From: Hannes Reinecke Message-ID: <43b43df0-8c8a-fbf0-69d8-9165a73bffea@suse.de> Date: Tue, 5 Feb 2019 16:15:11 +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=windows-1252; 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/5/19 4:09 PM, John Garry wrote: > On 05/02/2019 14:52, Keith Busch wrote: >> On Tue, Feb 05, 2019 at 05:24:11AM -0800, John Garry wrote: >>> On 04/02/2019 07:12, Hannes Reinecke wrote: >>> >>> Hi Hannes, >>> >>>> >>>> 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. >>> >>> I don't fully understand this idea - specifically, at which layer would >>> we be waiting for all the IO to complete? >> >> Whichever layer dispatched the IO to a CPU specific context should >> be the one to wait for its completion. That should be blk-mq for most >> block drivers. > > For SCSI devices, unfortunately not all IO sent to the HW originates > from blk-mq or any other single entity. > No, not as such. But each IO sent to the HW requires a unique identifcation (ie a valid tag). And as the tagspace is managed by block-mq (minus management commands, but I'm working on that currently) we can easily figure out if the device is busy by checking for an empty tag map. Should be doable for most modern HBAs. 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)