Received: by 10.223.176.5 with SMTP id f5csp595232wra; Tue, 6 Feb 2018 04:19:35 -0800 (PST) X-Google-Smtp-Source: AH8x224eJSP9s8qgBSduIKlYaR/QG1vWBrW4yT+edYj9tn/LDUcgN960cqPA4XAzLrBjwIj/juHV X-Received: by 10.99.107.73 with SMTP id g70mr1841232pgc.38.1517919575639; Tue, 06 Feb 2018 04:19:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517919575; cv=none; d=google.com; s=arc-20160816; b=PGXALywU8MY+kTKDdd5oGi0QJny1libMJMlao+M9J6RCGfwV2fNTUYYD4jEvChRV/M Ki3RqbV3rtrqmAgkcYeB2EbGnjpJKcvIk8ubXCvMTZB+e2riWBroMW57k+shdwv1u4oY N8OgaGs6ZlEPpG5m0rcEluaAQIyB/EviADYTGe+O29HnG+wkFFeau5OfnGfK2mPpAkYs 6s+mYl9FFOHuHLAKsHQpjnHiMg8pSICPqhkVG6pW+TRLBdg2Jk0wQ9H8H5d2v85iNjqw 9TjXjPB8QMZvGen02Q3YcQpy7nttRO04naXV0QW9iogcHvkv08Tmr7I7kZlU5gTGAdhw 58sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=5YSF0jCD9FO3O3tJk4Tak9n1q4+need3l1QZVoT1gqs=; b=R9ZqlL7k2MVXwWwTi1waKyibHO3SoXv6t6YQ6giNC9hS+tOgeZFtC7mt4Ng8lx/L4B +TfTq9NYO5s8lh9QR5trylZhqDF8IMH9OUxwfAvqowyfawwERp26/anfOtCaOFs3JKyu ubgKMlogQ1rxDKuPYHPWqrTZbHMtcjSHYgMzWLdi5g4abITEgPe4aOXKB+jDmO+1LgTH FhigzAWiS/muh9R0WcbX94qVm1K3AhsFf/mSGBTu3BpYtq52EC4S9k8RsCf88e5F0007 grzfVhiN92c0YE7GShhAmtlvcw2GaqJ/ygCaUWu8iPtDN7VMjBKKAADSubCelpaRHchI cZSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f69si1257400pgc.490.2018.02.06.04.19.21; Tue, 06 Feb 2018 04:19:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752862AbeBFMSr (ORCPT + 99 others); Tue, 6 Feb 2018 07:18:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54754 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246AbeBFMSk (ORCPT ); Tue, 6 Feb 2018 07:18:40 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CA532821C; Tue, 6 Feb 2018 12:18:40 +0000 (UTC) Received: from localhost (ovpn-12-136.pek2.redhat.com [10.72.12.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3096560BE0; Tue, 6 Feb 2018 12:18:28 +0000 (UTC) From: Ming Lei To: Jens Axboe , Christoph Hellwig , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Laurence Oberman , Ming Lei , Christoph Hellwig Subject: [PATCH 1/5] genirq/affinity: rename *node_to_possible_cpumask as *node_to_cpumask Date: Tue, 6 Feb 2018 20:17:38 +0800 Message-Id: <20180206121742.29336-2-ming.lei@redhat.com> In-Reply-To: <20180206121742.29336-1-ming.lei@redhat.com> References: <20180206121742.29336-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 06 Feb 2018 12:18:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following patches will introduce two stage irq spread for improving irq spread on all possible CPUs. No funtional change. Cc: Thomas Gleixner Cc: Christoph Hellwig Signed-off-by: Ming Lei --- kernel/irq/affinity.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index a37a3b4b6342..4b1c4763212d 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -39,7 +39,7 @@ static void irq_spread_init_one(struct cpumask *irqmsk, struct cpumask *nmsk, } } -static cpumask_var_t *alloc_node_to_possible_cpumask(void) +static cpumask_var_t *alloc_node_to_cpumask(void) { cpumask_var_t *masks; int node; @@ -62,7 +62,7 @@ static cpumask_var_t *alloc_node_to_possible_cpumask(void) return NULL; } -static void free_node_to_possible_cpumask(cpumask_var_t *masks) +static void free_node_to_cpumask(cpumask_var_t *masks) { int node; @@ -71,7 +71,7 @@ static void free_node_to_possible_cpumask(cpumask_var_t *masks) kfree(masks); } -static void build_node_to_possible_cpumask(cpumask_var_t *masks) +static void build_node_to_cpumask(cpumask_var_t *masks) { int cpu; @@ -79,14 +79,14 @@ static void build_node_to_possible_cpumask(cpumask_var_t *masks) cpumask_set_cpu(cpu, masks[cpu_to_node(cpu)]); } -static int get_nodes_in_cpumask(cpumask_var_t *node_to_possible_cpumask, +static int get_nodes_in_cpumask(cpumask_var_t *node_to_cpumask, const struct cpumask *mask, nodemask_t *nodemsk) { int n, nodes = 0; /* Calculate the number of nodes in the supplied affinity mask */ for_each_node(n) { - if (cpumask_intersects(mask, node_to_possible_cpumask[n])) { + if (cpumask_intersects(mask, node_to_cpumask[n])) { node_set(n, *nodemsk); nodes++; } @@ -109,7 +109,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) int last_affv = affv + affd->pre_vectors; nodemask_t nodemsk = NODE_MASK_NONE; struct cpumask *masks; - cpumask_var_t nmsk, *node_to_possible_cpumask; + cpumask_var_t nmsk, *node_to_cpumask; /* * If there aren't any vectors left after applying the pre/post @@ -125,8 +125,8 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) if (!masks) goto out; - node_to_possible_cpumask = alloc_node_to_possible_cpumask(); - if (!node_to_possible_cpumask) + node_to_cpumask = alloc_node_to_cpumask(); + if (!node_to_cpumask) goto out; /* Fill out vectors at the beginning that don't need affinity */ @@ -135,8 +135,8 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) /* Stabilize the cpumasks */ get_online_cpus(); - build_node_to_possible_cpumask(node_to_possible_cpumask); - nodes = get_nodes_in_cpumask(node_to_possible_cpumask, cpu_possible_mask, + build_node_to_cpumask(node_to_cpumask); + nodes = get_nodes_in_cpumask(node_to_cpumask, cpu_possible_mask, &nodemsk); /* @@ -146,7 +146,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) if (affv <= nodes) { for_each_node_mask(n, nodemsk) { cpumask_copy(masks + curvec, - node_to_possible_cpumask[n]); + node_to_cpumask[n]); if (++curvec == last_affv) break; } @@ -160,7 +160,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) vecs_per_node = (affv - (curvec - affd->pre_vectors)) / nodes; /* Get the cpus on this node which are in the mask */ - cpumask_and(nmsk, cpu_possible_mask, node_to_possible_cpumask[n]); + cpumask_and(nmsk, cpu_possible_mask, node_to_cpumask[n]); /* Calculate the number of cpus per vector */ ncpus = cpumask_weight(nmsk); @@ -192,7 +192,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) /* Fill out vectors at the end that don't need affinity */ for (; curvec < nvecs; curvec++) cpumask_copy(masks + curvec, irq_default_affinity); - free_node_to_possible_cpumask(node_to_possible_cpumask); + free_node_to_cpumask(node_to_cpumask); out: free_cpumask_var(nmsk); return masks; -- 2.9.5