From patchwork Wed Jun 17 09:37:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 11609497 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69BCD90 for ; Wed, 17 Jun 2020 09:37:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5059B208B3 for ; Wed, 17 Jun 2020 09:37:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OPihNtag" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726761AbgFQJhq (ORCPT ); Wed, 17 Jun 2020 05:37:46 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:25209 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725773AbgFQJhq (ORCPT ); Wed, 17 Jun 2020 05:37:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592386664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GALKjCyCx4yfJN/JVX3IxioyMG3hz4NRjecTTDpBoNE=; b=OPihNtagGpj2t0uwTpegTK3VDpr+CmFKEKijlAZgZcYloiKnRJeoAV8W8ZCDRromJkKZBL ep6q4OnbStIopSauAINmxEKeC5XyT9uv1hqThM8c/05jUM/wRW9yfrCYdoq4xFh7ogFBps VGV628V8JKDsSgZ1OGicEK8WI0WaKDY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-431-k6oO2ez3NvGoZWDkW1VHGw-1; Wed, 17 Jun 2020 05:37:43 -0400 X-MC-Unique: k6oO2ez3NvGoZWDkW1VHGw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6D41876EE2; Wed, 17 Jun 2020 09:37:41 +0000 (UTC) Received: from localhost (ovpn-114-151.ams2.redhat.com [10.36.114.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7731478EE1; Wed, 17 Jun 2020 09:37:34 +0000 (UTC) From: Stefan Hajnoczi To: linux-kernel@vger.kernel.org Cc: Marcelo Tosatti , linux-pci@vger.kernel.org, Thomas Gleixner , Bjorn Helgaas , "Michael S. Tsirkin" , Stefan Hajnoczi Subject: [RFC 1/2] genirq: honor device NUMA node when allocating descs Date: Wed, 17 Jun 2020 10:37:24 +0100 Message-Id: <20200617093725.1725569-2-stefanha@redhat.com> In-Reply-To: <20200617093725.1725569-1-stefanha@redhat.com> References: <20200617093725.1725569-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Use the device's NUMA node instead of the first masked CPUs node when descs are allocated. The mask may include all CPUs and therefore not correspond to the home NUMA node of the device. Signed-off-by: Stefan Hajnoczi --- kernel/irq/irqdesc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 1a7723604399..b9c4160d72c4 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -488,7 +488,8 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node, IRQD_MANAGED_SHUTDOWN; } mask = &affinity->mask; - node = cpu_to_node(cpumask_first(mask)); + if (node == NUMA_NO_NODE) + node = cpu_to_node(cpumask_first(mask)); affinity++; }