Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp27436pxu; Thu, 22 Oct 2020 14:23:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1EBgZdWGpRT7DPu7e8RKlR4gCVs/0BrOBTosFHNXUbftiMNnCPyi2eUr/pS9V2iasIs2l X-Received: by 2002:aa7:c2ca:: with SMTP id m10mr3933371edp.255.1603401791753; Thu, 22 Oct 2020 14:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603401791; cv=none; d=google.com; s=arc-20160816; b=BfGeUgyS/B9gVfVZCV4zQmAag/garzX5qoF0xxz9qtyeq7wvoJJ4Imzss0RmQhajq/ Rv99oklKE4ZtfzV2Fd/OyCOTryvFResgEk7KdyBtmZDChc+DJyidA45hasw71Jg4lE4s t050Sgf4u5qKLwCsQLJ2K6e7kSBBJ/mmAmPnZBtkwnASK/jDbVv44rLhHUeIyl+i4zse HpqAOJ1QWWcZ/E9Lug113nQDbFBHUxjPcxdr/vgfWC13JEvKv0UVYkurBl0F2QOw74os 7p3LI1aX4K2XgeSe4mGw6ap0o5BB4sdE0Z1so8fdZEsmDYI/1Y2+Vc6/jxYXfzPZKD2Q uoEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LckgkZ6IVJMsEiwSkmcuHngu8LJFXLEySIsMLY2OYag=; b=pLzLVoyA+4B5S1ATlNIjzPRm16VWMlmdMYMlfrHEKhCERhClNCKHMvmWeob8BjnRhG RCk0XeG7X99i85tVR5F8zpG0bMTfkb0ilC8vVR+lPXi4hIGG5F27khbyzzJorgmtj4HJ vlWT8WDJaQTltGHL5cMMTqaC5KyNokwu3KH8RoG85qCBqVD11qpsrWBzwVgF8Q2S7+QU HiazvbSHsbdWPZdAEj7GPS6OPX/4zrrWllBNmyvn0EnUW92mcVA9ag1KeOcEdbnqXkCO J+wM48byRt/EUftRSZdnE99Rp+eknd8UdEXF2XC2GkuCMaQdNMajzba4IWPV0FYFAh40 pbWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hyGE9EM2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si1591509ejb.456.2020.10.22.14.22.49; Thu, 22 Oct 2020 14:23:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hyGE9EM2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2898202AbgJVM3a (ORCPT + 99 others); Thu, 22 Oct 2020 08:29:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42485 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2898194AbgJVM30 (ORCPT ); Thu, 22 Oct 2020 08:29:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603369765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LckgkZ6IVJMsEiwSkmcuHngu8LJFXLEySIsMLY2OYag=; b=hyGE9EM2jx/8czZ/Irwu+5lirmt1NgXAxSwcNkpzFRZVj9scw+zFcxHUo1I1EOzilPNF2J uI13Zysg0M/EpmO0HHwdRBtZPqCDMg5RhxCTU8WBDkoiqUhSUUx6ASeJFvXKag/x0MfFjr ycYcAkaireR18Uvl5thqFve1SV/I6RQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-131--71cejwHNtG7emFfUNsmQQ-1; Thu, 22 Oct 2020 08:29:21 -0400 X-MC-Unique: -71cejwHNtG7emFfUNsmQQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 708DE186DD3D; Thu, 22 Oct 2020 12:29:18 +0000 (UTC) Received: from fuller.cnet (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A4A05C1C7; Thu, 22 Oct 2020 12:29:12 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 7F7BB41853FB; Thu, 22 Oct 2020 09:28:49 -0300 (-03) Date: Thu, 22 Oct 2020 09:28:49 -0300 From: Marcelo Tosatti To: Thomas Gleixner Cc: Nitesh Narayan Lal , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, intel-wired-lan@lists.osuosl.org, frederic@kernel.org, sassmann@redhat.com, jesse.brandeburg@intel.com, lihong.yang@intel.com, helgaas@kernel.org, jeffrey.t.kirsher@intel.com, jacob.e.keller@intel.com, jlelli@redhat.com, hch@infradead.org, bhelgaas@google.com, mike.marciniszyn@intel.com, dennis.dalessandro@intel.com, thomas.lendacky@amd.com, jiri@nvidia.com, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, lgoncalv@redhat.com, Jakub Kicinski , Dave Miller Subject: Re: [PATCH v4 4/4] PCI: Limit pci_alloc_irq_vectors() to housekeeping CPUs Message-ID: <20201022122849.GA148426@fuller.cnet> References: <20200928183529.471328-1-nitesh@redhat.com> <20200928183529.471328-5-nitesh@redhat.com> <87v9f57zjf.fsf@nanos.tec.linutronix.de> <3bca9eb1-a318-1fc6-9eee-aacc0293a193@redhat.com> <87lfg093fo.fsf@nanos.tec.linutronix.de> <877drj72cz.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877drj72cz.fsf@nanos.tec.linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 21, 2020 at 10:25:48PM +0200, Thomas Gleixner wrote: > On Tue, Oct 20 2020 at 20:07, Thomas Gleixner wrote: > > On Tue, Oct 20 2020 at 12:18, Nitesh Narayan Lal wrote: > >> However, IMHO we would still need a logic to prevent the devices from > >> creating excess vectors. > > > > Managed interrupts are preventing exactly that by pinning the interrupts > > and queues to one or a set of CPUs, which prevents vector exhaustion on > > CPU hotplug. > > > > Non-managed, yes that is and always was a problem. One of the reasons > > why managed interrupts exist. > > But why is this only a problem for isolation? The very same problem > exists vs. CPU hotplug and therefore hibernation. > > On x86 we have at max. 204 vectors available for device interrupts per > CPU. So assumed the only device interrupt in use is networking then any > machine which has more than 204 network interrupts (queues, aux ...) > active will prevent the machine from hibernation. > > Aside of that it's silly to have multiple queues targeted at a single > CPU in case of hotplug. And that's not a theoretical problem. Some > power management schemes shut down sockets when the utilization of a > system is low enough, e.g. outside of working hours. Exactly. It seems the proper way to do handle this is to disable individual vectors rather than moving them. And that is needed for dynamic isolate / unisolate anyway... > The whole point of multi-queue is to have locality so that traffic from > a CPU goes through the CPU local queue. What's the point of having two > or more queues on a CPU in case of hotplug? > > The right answer to this is to utilize managed interrupts and have > according logic in your network driver to handle CPU hotplug. When a CPU > goes down, then the queue which is associated to that CPU is quiesced > and the interrupt core shuts down the relevant interrupt instead of > moving it to an online CPU (which causes the whole vector exhaustion > problem on x86). When the CPU comes online again, then the interrupt is > reenabled in the core and the driver reactivates the queue. Aha... But it would be necessary to do that from userspace (for runtime isolate/unisolate).