Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp436009imu; Mon, 5 Nov 2018 03:25:24 -0800 (PST) X-Google-Smtp-Source: AJdET5ctY+3k64r/T3zozI99E2Jny35hVLB1FpMwGvofVOduU/qOX8JnlLwd05TlLK2i0NSvqlRG X-Received: by 2002:a63:2bc9:: with SMTP id r192mr20195679pgr.172.1541417124887; Mon, 05 Nov 2018 03:25:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541417124; cv=none; d=google.com; s=arc-20160816; b=vDcAfbovZKAIz0h8lZFwboRj0CiPbL6WaO0A+h1/+Q94snk5aTA0SIwPHBtf9BTGHh ca9io5LnHlE20eAIO/PEDJDBzzmoAA9Ij6i68M7nf95d/uoXuPKAQXnAZ0tgfzcsHn3f 1MTY3729fctTWZxml/nuVY7rYW5UerPgPnnMMVqq6N11JpoZ8/0GIdKAvRo7c23A68at QcGo2XCAHIl1RzlmVGIyVh1hiCZmrasWvQa00mAAGRWE48+P8oGsRHwf2vUCk1FSvbsy V1AwTBK2+UatoN1LCfc1JGo0/c6mliNSDJELUkXcflmm1ze8qTND9zeqd0sv69gtoPbs lPLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=8fi+KbKugTyBITsmCCRzNZi+3I8lu8SEBl4QSqznDXE=; b=TVRaiYnSi8jB6yImgi4bX0hFai5/vLLvNcjbu64EVsa/KhtJ6ByKv570mx1slAaVkQ bX0P2HmowvX8UOz5ieOtk5oxeV6scbDB5/dvaQQym4u1LQvkh9u3LV3lp3WzWU1jW4gj vjugs7lN6f0xzLk8F5DWf058+yxu4Jss3Hi+q+yOnOyUGeQWtg/qwnA5zphuEePKKFEc pQR01el/h9FvcYtkSCwEOc8+XZB4nwpE793m8H83LCVoVeawZVr1rPlhP5tLmdWexJR8 81Fi2tGERo97iIEcBa9kepV2fYeTh4b7KrIjTB9UHdAG76rM5ZMIYeG5ML3tCbyIkiEa s9DQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3-v6si1173056plt.412.2018.11.05.03.25.10; Mon, 05 Nov 2018 03:25:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729611AbeKEUmc (ORCPT + 99 others); Mon, 5 Nov 2018 15:42:32 -0500 Received: from terminus.zytor.com ([198.137.202.136]:39963 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727563AbeKEUmc (ORCPT ); Mon, 5 Nov 2018 15:42:32 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wA5BN4YW309802 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 5 Nov 2018 03:23:04 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wA5BN3WS309799; Mon, 5 Nov 2018 03:23:03 -0800 Date: Mon, 5 Nov 2018 03:23:03 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Ming Lei Message-ID: Cc: axboe@kernel.dk, hare@suse.com, linux-kernel@vger.kernel.org, ming.lei@redhat.com, sagi@grimberg.me, hpa@zytor.com, keith.busch@intel.com, mingo@kernel.org, tglx@linutronix.de Reply-To: sagi@grimberg.me, axboe@kernel.dk, ming.lei@redhat.com, hare@suse.com, linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, keith.busch@intel.com In-Reply-To: <20181102145951.31979-4-ming.lei@redhat.com> References: <20181102145951.31979-4-ming.lei@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] genirq/affinity: Pass first vector to __irq_build_affinity_masks() Git-Commit-ID: 060746d9e394084b7401e7532f2de528ecbfb521 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 060746d9e394084b7401e7532f2de528ecbfb521 Gitweb: https://git.kernel.org/tip/060746d9e394084b7401e7532f2de528ecbfb521 Author: Ming Lei AuthorDate: Fri, 2 Nov 2018 22:59:50 +0800 Committer: Thomas Gleixner CommitDate: Mon, 5 Nov 2018 12:16:26 +0100 genirq/affinity: Pass first vector to __irq_build_affinity_masks() No functional change. Prepares for support of allocating and affinitizing sets of interrupts, in which each set of interrupts needs a full two stage spreading. The first vector argument is necessary for this so the affinitizing starts from the first vector of each set. [ tglx: Minor changelog tweaks ] Signed-off-by: Ming Lei Signed-off-by: Thomas Gleixner Cc: Jens Axboe Cc: linux-block@vger.kernel.org Cc: Hannes Reinecke Cc: Keith Busch Cc: Sagi Grimberg Link: https://lkml.kernel.org/r/20181102145951.31979-4-ming.lei@redhat.com --- kernel/irq/affinity.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index 2f9812b6035e..e028b773e38a 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -95,14 +95,14 @@ static int get_nodes_in_cpumask(cpumask_var_t *node_to_cpumask, } static int __irq_build_affinity_masks(const struct irq_affinity *affd, - int startvec, int numvecs, + int startvec, int numvecs, int firstvec, cpumask_var_t *node_to_cpumask, const struct cpumask *cpu_mask, struct cpumask *nmsk, struct cpumask *masks) { int n, nodes, cpus_per_vec, extra_vecs, done = 0; - int last_affv = affd->pre_vectors + numvecs; + int last_affv = firstvec + numvecs; int curvec = startvec; nodemask_t nodemsk = NODE_MASK_NONE; @@ -119,7 +119,7 @@ static int __irq_build_affinity_masks(const struct irq_affinity *affd, for_each_node_mask(n, nodemsk) { cpumask_or(masks + curvec, masks + curvec, node_to_cpumask[n]); if (++curvec == last_affv) - curvec = affd->pre_vectors; + curvec = firstvec; } done = numvecs; goto out; @@ -129,7 +129,7 @@ static int __irq_build_affinity_masks(const struct irq_affinity *affd, int ncpus, v, vecs_to_assign, vecs_per_node; /* Spread the vectors per node */ - vecs_per_node = (numvecs - (curvec - affd->pre_vectors)) / nodes; + vecs_per_node = (numvecs - (curvec - firstvec)) / nodes; /* Get the cpus on this node which are in the mask */ cpumask_and(nmsk, cpu_mask, node_to_cpumask[n]); @@ -157,7 +157,7 @@ static int __irq_build_affinity_masks(const struct irq_affinity *affd, if (done >= numvecs) break; if (curvec >= last_affv) - curvec = affd->pre_vectors; + curvec = firstvec; --nodes; } @@ -190,8 +190,9 @@ static int irq_build_affinity_masks(const struct irq_affinity *affd, /* Spread on present CPUs starting from affd->pre_vectors */ usedvecs = __irq_build_affinity_masks(affd, curvec, numvecs, - node_to_cpumask, cpu_present_mask, - nmsk, masks); + affd->pre_vectors, + node_to_cpumask, + cpu_present_mask, nmsk, masks); /* * Spread on non present CPUs starting from the next vector to be @@ -205,8 +206,9 @@ static int irq_build_affinity_masks(const struct irq_affinity *affd, curvec = affd->pre_vectors + usedvecs; cpumask_andnot(npresmsk, cpu_possible_mask, cpu_present_mask); usedvecs += __irq_build_affinity_masks(affd, curvec, numvecs, - node_to_cpumask, npresmsk, - nmsk, masks); + affd->pre_vectors, + node_to_cpumask, npresmsk, + nmsk, masks); put_online_cpus(); free_cpumask_var(npresmsk);