Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4801919imu; Tue, 29 Jan 2019 07:45:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN7VR0OkSHRmVcb1lPITbzrxmbK8HCsxeKVsm7FlptfxLsaphtErcOCKv5cK34+cf59SuCwT X-Received: by 2002:a63:4926:: with SMTP id w38mr23115126pga.353.1548776755312; Tue, 29 Jan 2019 07:45:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548776755; cv=none; d=google.com; s=arc-20160816; b=EcXueD7oUZfP0qZzBSRUqUgWqEdPkI+CEH8Wa/rgR3AXYboeZqtMo8D0J0kgyRPh7y AJsdX8QlYOikPZcB7lQolYF8a5xrDUEznottsfkpivsnueTenHnlzuSNTq1TyIaozm+2 U7kw7/M2QRBrSasvBGKE6Kji9YXVzwJHfvUdhkh1jg9xDytAPnMBPNiBreeS+XUjZqTK lPFdpFe5uPLrv/hYw331RVsEYayvYp2rNnCuEq8jaJbmZaKSxwEeElf9qN5L7cODwTnz p4QcJTADnyzT9EP+JZU0nDUn7prPLPwvdHEA9ZKN8q0PbRRx1+m8w95vDjIw9sgm7uR9 Svyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5dpfeXpSxOpPva1pSnoQh9Ul1C9nk4VeS72o3cFIjiU=; b=QODEin5PWAQZvCUFX5VQttDWHuYjjpgGkoi7LlJm2vALA+BD9Qdoz75AaLtcxVjVK8 O0DuxYfSvbQGgv4KDh52HQUltbFXUzpH8qrD0Q/byL+C3KtCdMgzmwnum4Rcsjn4+DpF IlcGWe8eu3khxesugHxHRizTv3n4kMUV4ty0GG0NIeqUnEJnkp514Fy0MFRsxMdydG6L lzqmmsMooflfHZHWxArBMQu3nkjE7LV7q5iWr9w8gAy/AjX96Q1sKMqu6mWpVR/OnZQZ bARIhdX+pbKPDmFsmrgHRaKCwPHEdwkNCAquj8QG4DS4WYNdL77Q0HOMKS0pNrC7njKV mR0A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si35905020pge.48.2019.01.29.07.45.39; Tue, 29 Jan 2019 07:45:55 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728201AbfA2PpW (ORCPT + 99 others); Tue, 29 Jan 2019 10:45:22 -0500 Received: from mga17.intel.com ([192.55.52.151]:49362 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbfA2PpV (ORCPT ); Tue, 29 Jan 2019 10:45:21 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2019 07:45:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,537,1539673200"; d="scan'208";a="139790854" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by fmsmga004.fm.intel.com with ESMTP; 29 Jan 2019 07:45:20 -0800 Date: Tue, 29 Jan 2019 08:44:33 -0700 From: Keith Busch To: John Garry Cc: "tglx@linutronix.de" , Christoph Hellwig , Marc Zyngier , "axboe@kernel.dk" , Peter Zijlstra , Michael Ellerman , Linuxarm , "linux-kernel@vger.kernel.org" , Hannes Reinecke Subject: Re: Question on handling managed IRQs when hotplugging CPUs Message-ID: <20190129154433.GF15302@localhost.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2019 at 03:25:48AM -0800, John Garry wrote: > Hi, > > I have a question on $subject which I hope you can shed some light on. > > According to commit c5cb83bb337c25 ("genirq/cpuhotplug: Handle managed > IRQs on CPU hotplug"), if we offline the last CPU in a managed IRQ > affinity mask, the IRQ is shutdown. > > The reasoning is that this IRQ is thought to be associated with a > specific queue on a MQ device, and the CPUs in the IRQ affinity mask are > the same CPUs associated with the queue. So, if no CPU is using the > queue, then no need for the IRQ. > > However how does this handle scenario of last CPU in IRQ affinity mask > being offlined while IO associated with queue is still in flight? > > Or if we make the decision to use queue associated with the current CPU, > and then that CPU (being the last CPU online in the queue's IRQ > afffinity mask) goes offline and we finish the delivery with another CPU? > > In these cases, when the IO completes, it would not be serviced and timeout. > > I have actually tried this on my arm64 system and I see IO timeouts. Hm, we used to freeze the queues with CPUHP_BLK_MQ_PREPARE callback, which would reap all outstanding commands before the CPU and IRQ are taken offline. That was removed with commit 4b855ad37194f ("blk-mq: Create hctx for each present CPU"). It sounds like we should bring something like that back, but make more fine grain to the per-cpu context.