Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7588920rwb; Tue, 15 Nov 2022 14:49:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf7oj5FtWt/PCYxaFnbUtMWylp94W967P4xJNDoDq4TcT3K2B/vl3JLDn23bRcXqS3r9iXiU X-Received: by 2002:a17:906:3e55:b0:7ad:dd43:5d18 with SMTP id t21-20020a1709063e5500b007addd435d18mr14944232eji.389.1668552559709; Tue, 15 Nov 2022 14:49:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668552559; cv=none; d=google.com; s=arc-20160816; b=ljAbxmh88U/yWosLxg/NQjz4b9pntTv6bIZILSy0jXtQt7Cm2qhdUvttO7WzSMSc/s AASZLwvsVtp/AQBIe9//zUOIOnq4fJH+49etY4EtjYGLTS+ts7LbO8FQzylO/dKoHWye lbPgbmyY6s4SYfRvNhkd8FMOoUwdgzm3aUhghcPiOnT2xo+aKTsZUMtvg2Izok1jnMLN 9CGXFSr+5EzdDY4W26LsKl9prHXpW6HwC9pXUEbWlhweJVrKkEuEp/fZDFK4Mnc/VVvo 33H/dPvQcAALmAcuZmuqTZkBG4kqS/gECeCmWWu9VOVb8gB+RC3Iu4KxheRXmKtGgWIJ cOUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1ySoNkDzpjpG+PGzliTMgnSc8ulhtJKr+ctFAbGLHSE=; b=XNondFItraQrEoblEeYFRDsdxYl+f1fNJPhHEIkuGSWbFDiLnJjEEGZ4axZPvp8iDn MVs3VoSh5L0AgwdvwYR6emHF2xLWorjSBMpGvo9Ek3gCIuBTszfdf54GTembYFuiP6oo 8vsrb69CrvtAA/kTJaDebRbMDis3fbeCa22TLNI/QGlNjPWl3TjuxsrlkV6bacSG1ovh RXYiiib0vQP+lqEgVXfCf+JSk+xfcKcLF+i2ylg+Ho6LibiM3+gGq3DLdpobaoJogc8A Cm8Vk/Z/ZZ//r/msLSxTwdeLlVrsVC38WrxsnEsCsOs0Ymnwi+1UJG3F7PVkzwNeImKr u9OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="RgnCDi/E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga33-20020a1709070c2100b0073dcb2ec4d2si6942048ejc.889.2022.11.15.14.48.56; Tue, 15 Nov 2022 14:49:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="RgnCDi/E"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231510AbiKOWps (ORCPT + 90 others); Tue, 15 Nov 2022 17:45:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231439AbiKOWpo (ORCPT ); Tue, 15 Nov 2022 17:45:44 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1E3D175BE for ; Tue, 15 Nov 2022 14:44:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668552287; 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=1ySoNkDzpjpG+PGzliTMgnSc8ulhtJKr+ctFAbGLHSE=; b=RgnCDi/EIaHGFxsPIPzeBWpiILO8RRsb9iUSPlMAjLMEg/coKiFIQlrpmjn0IISbPV5ajk F+5/bqNRRF3jkaAGkFd9Lpit8ZsehcNjrG1L6VKCo+IZycxuajxYqy8TRWYSp44eeQumaH cQjk2LC4zUcBE4r8V+G94n38K6mNpvw= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-213-hhuQPXVaPv-6EUlReJhB_g-1; Tue, 15 Nov 2022 17:44:46 -0500 X-MC-Unique: hhuQPXVaPv-6EUlReJhB_g-1 Received: by mail-wm1-f72.google.com with SMTP id c5-20020a1c3505000000b003c56da8e894so168737wma.0 for ; Tue, 15 Nov 2022 14:44:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1ySoNkDzpjpG+PGzliTMgnSc8ulhtJKr+ctFAbGLHSE=; b=d1pt+MCrnLGS/lAUXablRdHmdBzpKDRbTGMv3HDyUf1IlOynDx5UcLUg8wNmagtANJ S1xSTg239Zgz0ES9SBceRowfSy7g4ZUENUGUVTelJsLd1LAt4cdFd8u39pGburSdHQqq rytsoj54SWBk0YJo2dsBhl6znePfHRmcN9oG6cpKAqO2u75IgWZv0PiVS5Jvac9Mvv9K u1oBgBygakJ+SDutF5UGlauNRfPxA3oA3bIwojWZfIayfqFgaasP2X0aeWpXZuivPkHc URl4A1knCIStkw9yWZQxfTVR552Yn1YAJRReeUDLc94ZXkxaNqhnLKVt5/fNNtapMuQa djDQ== X-Gm-Message-State: ANoB5pl2B3++QVFixJwpGOrF9us9BDmMlkFTSlQYUa9OQXc8yKfgfRtq /WvVrdBB0YPq9pizVqwC9Ds7T51CnDX48jyJBz5iwIpWohNEq0skq95soP8RcSvfRa6Ni2d3o48 VegsA69tRDb4O1ELN/PY+kEov X-Received: by 2002:a1c:7308:0:b0:3cf:cf89:90f with SMTP id d8-20020a1c7308000000b003cfcf89090fmr222362wmb.186.1668552285425; Tue, 15 Nov 2022 14:44:45 -0800 (PST) X-Received: by 2002:a1c:7308:0:b0:3cf:cf89:90f with SMTP id d8-20020a1c7308000000b003cfcf89090fmr222349wmb.186.1668552285068; Tue, 15 Nov 2022 14:44:45 -0800 (PST) Received: from redhat.com ([2.52.131.207]) by smtp.gmail.com with ESMTPSA id c17-20020adffb11000000b002417f35767asm10192296wrr.40.2022.11.15.14.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 14:44:44 -0800 (PST) Date: Tue, 15 Nov 2022 17:44:41 -0500 From: "Michael S. Tsirkin" To: Thomas Gleixner Cc: Angus Chen , "linux-kernel@vger.kernel.org" , Ming Lei , Jason Wang Subject: Re: IRQ affinity problem from virtio_blk Message-ID: <20221115174152-mutt-send-email-mst@kernel.org> References: <87v8nfrhbw.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v8nfrhbw.ffs@tglx> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Thomas, I have a question: On Tue, Nov 15, 2022 at 11:19:47PM +0100, Thomas Gleixner wrote: > On Tue, Nov 15 2022 at 03:40, Angus Chen wrote: > > Before probe one virtio_blk. > > crash_cts> p *vector_matrix > > $44 = { > > matrix_bits = 256, > > alloc_start = 32, > > alloc_end = 236, > > alloc_size = 204, > > global_available = 15354, > > global_reserved = 154, > > systembits_inalloc = 3, > > total_allocated = 411, > > online_maps = 80, > > maps = 0x46100, > > scratch_map = {1160908723191807, 0, 1, 18435222497520517120}, > > system_map = {1125904739729407, 0, 1, 18435221191850459136} > > } > > After probe one virtio_blk. > > crash_cts> p *vector_matrix > > $45 = { > > matrix_bits = 256, > > alloc_start = 32, > > alloc_end = 236, > > alloc_size = 204, > > global_available = 15273, > > global_reserved = 154, > > systembits_inalloc = 3, > > total_allocated = 413, > > online_maps = 80, > > maps = 0x46100, > > scratch_map = {25769803776, 0, 0, 14680064}, > > system_map = {1125904739729407, 0, 1, 18435221191850459136} > > } > > > > We can see global_available drop from 15354 to 15273, is 81. > > And the total_allocated increase from 411 to 413. One config irq,and > > one vq irq. > > Right. That's perfectly fine. At the point where you looking at it, the > matrix allocator has given out 2 vectors as can be seen via > total_allocated. > > But then it also has another 79 vectors put aside for the other queues, What makes it put these vectors aside? pci_alloc_irq_vectors_affinity ? > but those queues have not yet requested the interrupts so there is no > allocation yet. But the vectors are guaranteed to be available when > request_irq() for those queues runs, which does the actual allocation. > > Btw, you can enable CONFIG_GENERIC_IRQ_DEBUGFS and then look at the > content of /sys/kernel/debug/irq/domain/VECTOR which gives you a very > clear picture of what's going on. No need for gdb. > > > It is easy to expend the irq resource ,because virtio_blk device could > > be more than 512. > > How so? virtio_blk allocates a config interrupt and one queue interrupt > per CPU. So in your case a total of 81. > > How would you exhaust the vector space? Each CPU has about ~200 (in your > case exactly 204) vectors which can be handed out to devices. You'd need > to instantiate about 200 virtio_blk devices to get to the point of > vector exhaustion. > > So what are you actually worried about and which problem are you trying > to solve? > > Thanks, > > tglx >