From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64B43C4727D for ; Tue, 6 Oct 2020 19:00:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0332C20870 for ; Tue, 6 Oct 2020 19:00:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Uy5kBvdc"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wO0Hply5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726920AbgJFTA1 (ORCPT ); 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