Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp353814ybt; Wed, 17 Jun 2020 02:41:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+gD4dakbifQ3xQZO6wpwUZ92agnc/QfUc4OhAL1HWK7uMv4YXEPcPJ53IgzKMx+Kg4foO X-Received: by 2002:a17:906:454b:: with SMTP id s11mr7093807ejq.546.1592386914675; Wed, 17 Jun 2020 02:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592386914; cv=none; d=google.com; s=arc-20160816; b=WP9sjnAMB8CuyHrHYWwVfeLCwq/JEkJu95ARjVTiwIr2mM5XWYC2UGII2NYM/uHitB rcXL4klTdSQJeheIrD0DKKqTb+avjP/eAtvlcrBFQTQd9H8RpDN5I1jXTuUJmeCdXYTp RNLInH+EKG2gVEBTNGfcCgelrlS/cl8Cb/wcpD3/45imj0+N3FxNNpT8zZFt1GaJET8n lOKeAtPf3Qw1iPa+1iSdA8R5p+P7dfD6c2ET1gAu5QphMC7DSrIOj1Z+gtLkMrjZXPcS 2f5HgWd221T22PdPKj0WEwtWdbfpnUyzStTFYZvrOHxxpwZFP7x8QQb2I64DHu9zLMKB XYYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7MAdMlImgumCZT3LfGm29F+L+iTUaSnuaS5P4ZPaAz4=; b=bOGQ7JR6yl3vbrGF/CmOd5g5ad8q4xGPIjnyX9t57WvQdKzKjuzIkXAbhdMz10DMWo UrEUFcdY1+k4ATLWtqh8Px4yxFebmvGjRXegD5/F2TJYnH4V3JKu2nHTXe/D+2naZmHA ihl4Oq5mpHd/Ere27Ce/DSfcSa42fkKAD6z7PZxlXEJ1S1y1PXx9LRLebGEV7KQepDOt smvj/NjN8YLgM8Ht/dCcWpLcf9U/++rYJd7a0bg6xN5HqJPxLROUrY6mRaiJeXpCwnbH Dkbbr8pMfohBO9Ii91f8T8BHts9amyoWsd82BMd7mrDfPKk6VuReH3MH4jHgmddePmEc WGfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q7LxzVB7; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i24si12098778eds.397.2020.06.17.02.41.31; Wed, 17 Jun 2020 02:41:54 -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=@redhat.com header.s=mimecast20190719 header.b=Q7LxzVB7; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726833AbgFQJhu (ORCPT + 99 others); Wed, 17 Jun 2020 05:37:50 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:38599 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725964AbgFQJhr (ORCPT ); Wed, 17 Jun 2020 05:37:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592386666; 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=7MAdMlImgumCZT3LfGm29F+L+iTUaSnuaS5P4ZPaAz4=; b=Q7LxzVB7N/xM1LPXjybncpZ7jTn1+wuI4h1M+YA8iDS68UVyLvqNqjOo1dYY134dT5E7hf ykg8BKcikSq6QORqppJhhHRxAyEECrK+Gt2C3/b5zi5r+60LUJ6u+ye6eRPUsKssUR57vo U6KsDGyBdBzAEwitkvrRIhI8dS5425A= 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-481-oikxqi3UO3CV5AoofoRoFg-1; Wed, 17 Jun 2020 05:37:45 -0400 X-MC-Unique: oikxqi3UO3CV5AoofoRoFg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3D6480B71D; Wed, 17 Jun 2020 09:37:43 +0000 (UTC) Received: from localhost (ovpn-114-151.ams2.redhat.com [10.36.114.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BA5D5C1D2; Wed, 17 Jun 2020 09:37:43 +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 2/2] genirq/matrix: take NUMA into account for managed IRQs Date: Wed, 17 Jun 2020 10:37:25 +0100 Message-Id: <20200617093725.1725569-3-stefanha@redhat.com> In-Reply-To: <20200617093725.1725569-1-stefanha@redhat.com> References: <20200617093725.1725569-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org U2VsZWN0IENQVXMgZnJvbSB0aGUgSVJRJ3MgTlVNQSBub2RlIGluIHByZWZlcmVuY2Ugb3ZlciBv dGhlciBDUFVzL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