Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp521018pxu; Tue, 6 Oct 2020 12:02:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9K+acDJr4XSw2lBblsdJqzFWx5nrQUXYxK1aGAolFRIpFvKym60WW9J7c0snAYLI6nqEF X-Received: by 2002:a05:6402:10d5:: with SMTP id p21mr7293256edu.14.1602010931903; Tue, 06 Oct 2020 12:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602010931; cv=none; d=google.com; s=arc-20160816; b=cK4HJIeRyXHDILfPuhlfhfz1lqDnU+e49SSAnSZbFuq4ZSdEtAZACSo3cefSZvBKwo JSZlU4xORaDAhTlYEDtDsGzQvMSicjNYiAdJsa7peAKvheWgrWlJiz7OAH9xNEkmF8zh fP+pOIi8/q5zDjl0GCOvpLLZrmTAKD/JGT4dTP8DDKItCrtC4e2rY6V45u5RD2UgS4y2 FpiW6UVN5PztSVLXM0pYRMh2Xeaj+DLrQmVAob6+xVLk/pcZKFx7gGAj+nylA7QCzfEb jlEjFIMGYVDFufwDTlpn9oyD+JOQFejRoi4CdBfoGagbCXRr4lbqI4FIYUevjjAG+cVY St6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=F8SQ0k7RLei+mK3UMQDWPVDraM3VGYk47tKS5XTJPEU=; b=KIHblpXafUGbkmbCRSbJJ+X2RjpGrIj2V5t8qjhmEfvwKz8zqj0DOura3CoaQalrHQ JrEjWj7kmdW1jkOllyukQ6WKpZo3CpWcEIvaaZuTXN3RWpHfBLrmulh2DfQ8r+SR3lwg G/JSP6R2Bfbp/1/mDpRLAovPO95tvQb26abJ/ND7Q26ODq9zurTqL2YWCbPNOQTNy3bk PU2GKRnWpZQOTl/P5ViI4Oa3VHUEznc4lymynDY3qzk/osXXefL1o35rYSFF409a/S22 Z20rCBSq36fxfwACL7AE36+IddrsT4UB+3hLLV2FZSPqG6Cab+5/bHhdWTnao+zWlJ7h 4iRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Uy5kBvdc; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m26si2606342eje.690.2020.10.06.12.01.47; Tue, 06 Oct 2020 12:02: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=@linutronix.de header.s=2020 header.b=Uy5kBvdc; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbgJFTA1 (ORCPT + 99 others); Tue, 6 Oct 2020 15:00:27 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:38288 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbgJFTA0 (ORCPT ); Tue, 6 Oct 2020 15:00:26 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602010824; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F8SQ0k7RLei+mK3UMQDWPVDraM3VGYk47tKS5XTJPEU=; b=Uy5kBvdctYZXM07+PHqZq72K/MYxqST8WcuVV2aJ7bI2RRp9+Hoo+hIbRMI2jNnG03EeJ/ dLXkIlnNQhHbLhbqBL/hVKRAn2kLwbwwQML3U8GrRvDa4EQjNe6+O9PpcMqb/h5iUwiKkL rpkZR4HWO+gZ16di3YP40M3SwIcAx3lPhg/X7wi65YMTbEQEEJW1HduZKlpYGRX9l5/bZE rLrtKoEgZsR5s1wTHeN4sTaEQZkuMAE+hnv65Eq2clUakVBKie1uKpRw2A/V6VQGtdgkMc MA2v11SXbE123QdWkpBls2Qm+NbSmEocGjFehwf+118WKPKCzfVh3yhUMiCMYQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602010824; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F8SQ0k7RLei+mK3UMQDWPVDraM3VGYk47tKS5XTJPEU=; b=wO0Hply58Utt7IDcUrnj83TDombhYB2nXAEbIe/4ZPkYf8T75Mg+FtxAoWDAEpUe6q/2Mb NCdqgR+aISo8BmCw== To: David Woodhouse , Dexuan Cui , Ming Lei , Christoph Hellwig , Christian Borntraeger , Stefan Haberland , Jens Axboe , Marc Zyngier , "linux-pci\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" Cc: Long Li , Haiyang Zhang , Michael Kelley Subject: Re: irq_build_affinity_masks() allocates improper affinity if num_possible_cpus() > num_present_cpus()? In-Reply-To: <65ba8a8b86201d8906313fbacc4fb711b9b423af.camel@infradead.org> References: <65ba8a8b86201d8906313fbacc4fb711b9b423af.camel@infradead.org> Date: Tue, 06 Oct 2020 21:00:24 +0200 Message-ID: <87h7r76uyf.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06 2020 at 09:37, David Woodhouse wrote: > On Tue, 2020-10-06 at 06:47 +0000, Dexuan Cui wrote: >> PS2, the latest Hyper-V provides only one ACPI MADT entry to a 1-CPU VM, >> so the issue described above can not reproduce there. > > It seems fairly easy to reproduce in qemu with -smp 1,maxcpus=3D128 and a > virtio-blk drive, having commented out the 'desc->pre_vectors++' around > line 130 of virtio_pci_common.c so that it does actually spread them. > > [ 0.836252] i=3D0, affi =3D 0,65-127 > [ 0.836672] i=3D1, affi =3D 1-64 > [ 0.837905] virtio_blk virtio1: [vda] 41943040 512-byte logical blocks= (21.5 GB/20.0 GiB) > [ 0.839080] vda: detected capacity change from 0 to 21474836480 > > In my build I had to add 'nox2apic' because I think I actually already > fixed this for the x2apic + no-irq-remapping case with the max_affinity > patch series=C2=B9. But mostly by accident. There is nothing to fix. It's intentional behaviour. Managed interrupts and their spreading (aside of the rather odd spread here) work that way. And virtio-blk works perfectly fine with that. Thanks, tglx