Received: by 10.213.65.68 with SMTP id h4csp465840imn; Wed, 4 Apr 2018 01:26:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx49QOuLYPKz//PWV5CxYGfd5ZNmwjXKiSg8fqcYYPnQySmW8BocPLURe6OG26fqrO6nWKtuq X-Received: by 2002:a17:902:6bc3:: with SMTP id m3-v6mr17415361plt.363.1522830409192; Wed, 04 Apr 2018 01:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522830409; cv=none; d=google.com; s=arc-20160816; b=AnI7Y/tcbWMgJAJYdnWvKm71/zSFQZ4edYXbbDMGBsx29hyaJt4KU1a/sC6QoX+IZI m287L6zOqILUp4E8iUFgm8jeU2/YjQGmUs32z+4v1nVd5l1yXJga1BBqjRdV1jg5YfQT LMXiRkLohWZMFZ9hRQ2Ij62RKuosiGUxiZgwx4C+t70BDZV97tBP6sNA5EByEbICgLcn ifqKp9IEGveIbDplYHUbhZpAsLBwjAxHMg9+KIvXHOmRT/ZkiPA3xd7rNsh/RMfUh44y Ff6O+i4aZivh2EtmCnS+/Yv++qLb658dHFx1R8Klzomy1Vw3gEz3aPhQxyY09EnJDh8V 1aYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=Csu+3EPIt12EHPmzH0ZZ8oY6Rz/no3v0ErQhNB7zsYg=; b=HpHR6Q9HfrZiNPQNeKFtcvXlXvy7OtZe0TzLfCcqweX2X7woJ15GGu2lElxYUP+5xV IPxPQcCTZGQ3geWXk9nl1Ne0ZedAX/9ZxhaEnsqw0JFyl4Kn+QmL9LDXe3oUGbkpcOVv +jZekrgYMD90ZR6zXOzab9giS57/IHp0Z0BD8RVp6p+ci2TfxDMj0TexKxMkB/Exx9ho gXLeps51Xa1a3/TkjxPTvf4btcB36aoSuTaQh8kK9clJYwQhzA6yWsLu8edJj1S067fZ i6KRWN3+NJtDSZZWoHOijHQukkImvCbik5uwohGErgmrGZL1CZ8TIDx1hs9aWpZtEeGF BJeQ== 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 l30-v6si4987655plg.541.2018.04.04.01.26.35; Wed, 04 Apr 2018 01:26:49 -0700 (PDT) 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 S1751365AbeDDIZZ (ORCPT + 99 others); Wed, 4 Apr 2018 04:25:25 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:60909 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbeDDIZT (ORCPT ); Wed, 4 Apr 2018 04:25:19 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1f3djI-0001Zx-QE; Wed, 04 Apr 2018 10:25:16 +0200 Date: Wed, 4 Apr 2018 10:25:16 +0200 (CEST) From: Thomas Gleixner To: Ming Lei cc: Jens Axboe , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Laurence Oberman Subject: Re: [PATCH V3 4/4] genirq/affinity: irq vector spread among online CPUs as far as possible In-Reply-To: <20180403160001.GA25255@ming.t460p> Message-ID: References: <20180308105358.1506-1-ming.lei@redhat.com> <20180308105358.1506-5-ming.lei@redhat.com> <20180403160001.GA25255@ming.t460p> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Apr 2018, Ming Lei wrote: > On Tue, Apr 03, 2018 at 03:32:21PM +0200, Thomas Gleixner wrote: > > On Thu, 8 Mar 2018, Ming Lei wrote: > > > 1) before 84676c1f21 ("genirq/affinity: assign vectors to all possible CPUs") > > > irq 39, cpu list 0 > > > irq 40, cpu list 1 > > > irq 41, cpu list 2 > > > irq 42, cpu list 3 > > > > > > 2) after 84676c1f21 ("genirq/affinity: assign vectors to all possible CPUs") > > > irq 39, cpu list 0-2 > > > irq 40, cpu list 3-4,6 > > > irq 41, cpu list 5 > > > irq 42, cpu list 7 > > > > > > 3) after applying this patch against V4.15+: > > > irq 39, cpu list 0,4 > > > irq 40, cpu list 1,6 > > > irq 41, cpu list 2,5 > > > irq 42, cpu list 3,7 > > > > That's more or less window dressing. If the device is already in use when > > the offline CPUs get hot plugged, then the interrupts still stay on cpu 0-3 > > because the effective affinity of interrupts on X86 (and other > > architectures) is always a single CPU. > > > > So this only might move interrupts to the hotplugged CPUs when the device > > is initialized after CPU hotplug and the actual vector allocation moves an > > interrupt out to the higher numbered CPUs if they have less vectors > > allocated than the lower numbered ones. > > It works for blk-mq devices, such as NVMe. > > Now NVMe driver creates num_possible_cpus() hw queues, and each > hw queue is assigned one msix irq vector. > > Storage is Client/Server model, that means the interrupt is only > delivered to CPU after one IO request is submitted to hw queue and > it is completed by this hw queue. > > When CPUs is hotplugged, and there will be IO submitted from these > CPUs, then finally IOs complete and irq events are generated from > hw queues, and notify these submission CPU by IRQ finally. I'm aware how that hw-queue stuff works. But that only works if the spreading algorithm makes the interrupts affine to offline/not-present CPUs when the block device is initialized. In the example above: > > > irq 39, cpu list 0,4 > > > irq 40, cpu list 1,6 > > > irq 41, cpu list 2,5 > > > irq 42, cpu list 3,7 and assumed that at driver init time only CPU 0-3 are online then the hotplug of CPU 4-7 will not result in any interrupt delivered to CPU 4-7. So the extra assignment to CPU 4-7 in the affinity mask has no effect whatsoever and even if the spreading result is 'perfect' it just looks perfect as it is not making any difference versus the original result: > > > irq 39, cpu list 0 > > > irq 40, cpu list 1 > > > irq 41, cpu list 2 > > > irq 42, cpu list 3 Thanks, tglx