Received: by 10.213.65.68 with SMTP id h4csp3680903imn; Tue, 3 Apr 2018 09:01:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/XeKxsGLDfsXybg0W5b55Ahy8ttdCx+YA94pZCOuC25JmRS80TLHyfhUzYm83TMeBVYCmM X-Received: by 10.99.119.129 with SMTP id s123mr9457042pgc.137.1522771319136; Tue, 03 Apr 2018 09:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522771319; cv=none; d=google.com; s=arc-20160816; b=gohApqHNQiblSxLo7OqCgkJuLYdpPGY2VErFABWIGpAkr5bZPCdc5CUNKnGkM/mTzX DrQ6Rr5jeS6QTpv6REC87bkupiBFIDK0F0FRkLHQmN8VHR0zKKHMtRHohWeYpbSIkpBz oo/EytYKQqrYFhkII0rjP8Y9sySIeS3deoLZrFXv7e9ZyFaa2KudaznOmxUNFMaEcmbM WDf5nL2cOF8tEv9rlknb40KUTQ2R3zyQ6U7NinZdY7OblptM6gEnRgjIedfIVydXU47i uvauQ6ddHu6EgiCbFSI5FiKikNUR/2lhX8bs2CI4HABlJjkiFpJvHOedmzehqokGj8Iu d4CQ== 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:arc-authentication-results; bh=JD5tQRaWC8NZ6ztmghOfE4gUBz5a4zF5Lak2IrIQ+6o=; b=JT0jp13B5DQnwHb5h8gM1lh0mo6io3twc3k0mwG0d3NK7KAihmUTGxVgikUxtvds/r U4iFIWwV7PuprTSIgdZlNGbln/h8wV47sPo26M9t26GJT/XZv24ubPbgUnE43hqukpyg LD1y3BSjd/enRjVgpbCzht3ifm9KTeu0J5C4oN0JDD6Nn24iiUvvP8N2JrHvZS/HqkHQ Qq4Vkjuuq3JQvPkHJdl9uxSd47D01Gx9tRlymrHXb1b+JUrA2iEhkRJsgC66BJDQ7NLk oeOHOWWjQcq5fYWRBPzrKwemdjQ3M54ASI6wD1f0pbCE2lwBFQzZKyzsaRnwybhx2U3d Bb+w== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a92-v6si3170666pla.107.2018.04.03.09.01.45; Tue, 03 Apr 2018 09:01:59 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751773AbeDCQAZ (ORCPT + 99 others); Tue, 3 Apr 2018 12:00:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59958 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751270AbeDCQAY (ORCPT ); Tue, 3 Apr 2018 12:00:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B6C576FBA; Tue, 3 Apr 2018 16:00:23 +0000 (UTC) Received: from ming.t460p (ovpn-12-99.pek2.redhat.com [10.72.12.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8951F215CDAF; Tue, 3 Apr 2018 16:00:11 +0000 (UTC) Date: Wed, 4 Apr 2018 00:00:05 +0800 From: Ming Lei To: Thomas Gleixner 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 Message-ID: <20180403160001.GA25255@ming.t460p> References: <20180308105358.1506-1-ming.lei@redhat.com> <20180308105358.1506-5-ming.lei@redhat.com> 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) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 16:00:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 16:00:23 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Ming