Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1731770rwb; Fri, 28 Jul 2023 14:08:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlFBsecaJy4DxhYaeCfrrrGolGcj7+s/hPXpUUhMEYj7a7n7Ii6GH0+MLch4z7xW0klvkov9 X-Received: by 2002:a05:6a20:428e:b0:134:2e3c:7d06 with SMTP id o14-20020a056a20428e00b001342e3c7d06mr4113157pzj.37.1690578486631; Fri, 28 Jul 2023 14:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690578486; cv=none; d=google.com; s=arc-20160816; b=uowZp7wJzyWnODxKXJsL9PxlJW8zDd3cXodDNM9iW+5eljzV9WPZ7LNSxxlsiWy6eD j50dTQnlEhm1tjZkh/fd+9s2jOIjARDaQ7jCkg6wAGF3e/0kPDjKHAyAgPJ9d0PN4/eU 8nFla91l1Ag0OULN5xsLJQ+NzhGFEm8anUbVBd6TJN+hyZYdOCO8U3L7BVftdIqLxsxC zimT2UkBifoSbYvBwwdnRR607fgxveCDmd/g713z0kx+MifCMP0pHB6BVrTBxBIEAf+o l64kMANcdMixgvEB0UgcUGafpc8CkIB/OtviRa7yPcyB8KaEaWjGhs6zlZZVozcWkGsp H50Q== 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=fR+1Ln/VcvVHWAwZyFEWuwdn/SQKZI7/b06t3zJQLos=; fh=XxLm/NPoEew+fSWZKOqk6AsEq2tEzpFUEandXkOBknI=; b=yCmj9OiqESmjgGiJjTpnUviYKLuc043lz0pkoeaL2BJZJjzS+WoOBDeT3aEJ8fLScw lZ7sj+2FA1YaT//+WccURlfQoE4sd1xL+/zJgzgpjjK4fZcGuATkkP3XPxUaZRnVQhOH qIDOkUn8uafbGMYt1HAWltwERt0YyGgtPZRt8FujLR/M9pQ2Gh8ej2GrJ2boF5b4egwa bzRyMqCPY565qvuQNsN8gIttQPHYyOtCJm8FicZa3KBNY3DrTzTaUFVxmyrNdU+Q81mo V5YH4Gh74IQ6YVtvnQA9Dwr/6d+RM6DsSFq4VC7K3nOH/UiZryjchtGyh5jOZMecTLwX 8dbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jJtVHE1o; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 8-20020a630f48000000b00563de9d4edasi3507765pgp.366.2023.07.28.14.07.54; Fri, 28 Jul 2023 14:08:06 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=jJtVHE1o; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233412AbjG1Tes (ORCPT + 99 others); Fri, 28 Jul 2023 15:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233020AbjG1Teq (ORCPT ); Fri, 28 Jul 2023 15:34:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 477E330D3 for ; Fri, 28 Jul 2023 12:34:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D6397621D3 for ; Fri, 28 Jul 2023 19:34:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB423C433C7; Fri, 28 Jul 2023 19:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690572884; bh=j8jNcmTYYntq9pAVo2UzJdRoU3x1ihUFJCes2YsaF/E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jJtVHE1oCeKXFQ2YOPpEvTEVZW6WSuvjT+4P7eaX6T5Uf5dTTbHVJFaiA9BFwPTaS H9IMeFpMevEQQKjqRFGvrvkwAtQC+gb4b3p5ee3vHF+fiIwycWYCCjDsoXzYgH9xBm 63X7w/U3dkPG09uiHZUbwMxBo0v+ySrscND2ZbTGFMN3kx4P+kbpXEm6Zu8jsqt8pW rFXgI97jdb/6sEFGxM14NkB1Dgnge/dDvmuoqKndSuOE7w0n1d6pRGBzIWC3lWdIMd m99opBLE4qgS7OJaJ/Ea+s1YVPCTZl3zpC86thlNo0TmUaUe9PsMMj4zETHc+Gs1S0 qkeA6dhtaxEmQ== Date: Fri, 28 Jul 2023 13:34:41 -0600 From: Keith Busch To: Pratyush Yadav Cc: Christoph Hellwig , Sagi Grimberg , Jens Axboe , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme-pci: do not set the NUMA node of device if it has none Message-ID: References: <20230725110622.129361-1-ptyadav@amazon.de> <50a125da-95c8-3b9b-543a-016c165c745d@grimberg.me> <20230726131408.GA15909@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Fri, Jul 28, 2023 at 08:09:32PM +0200, Pratyush Yadav wrote: > > I am guessing you are looking at irq_create_affinity_masks(). Yeah, It > does not take into account the NUMA information. In fact, even if it > did, the NUMA node associated with the IRQ is NUMA_NO_NODE > (/proc/$irq/node == -1). > > I did some more digging over the week to figure out what is going on. It > seems like the kernel _does_ in fact allow all CPUs in the affinity. I > added some prints in set_affinity_irq() in > drivers/xen/events/events_base.c (since that is the irqchip for the > interrupt). I see it being called with mask: ffffffff,ffffffff. > > But I later see the function being called again with a different mask: > 00000000,00008000. The stack trace shows the call is coming from > ksys_write(). The process doing the write is irqbalance. > > So I think your earlier statement was incorrect. irqbalance does in fact > balance these interrupts and it probably looks at the NUMA information > of the device to make that decision. My original reasoning holds and > irqbalance is the one picking the affinity. > > With this explanation, do you think the patch is good to go? irqbalance still writes to the /proc//smp_affinity to change it, right? That's just getting I/O errors on my machines because it fails irq_can_set_affinity_usr() for nvme's kernel managed interrupts (except the first vector, but that one is not used for I/O). Is there another path irqbalance is using that's somehow getting past the appropriate checks? Or perhaps is your xen irq_chip somehow bypassing the managed irq property?