[V4,1/6] genirq/affinity: Remove the 'firstvec' parameter from irq_build_affinity_masks
Message ID | 20221227022905.352674-2-ming.lei@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1189668wrt; Mon, 26 Dec 2022 18:30:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXt9w4g2y3ZPOVrdG+KL8/zUeHeoGzbzGOdy6qXp5DrINoOEdLnbFSJGqLcGc9rdE5mAhySM X-Received: by 2002:a17:902:8f87:b0:189:b36a:5448 with SMTP id z7-20020a1709028f8700b00189b36a5448mr22782729plo.44.1672108255496; Mon, 26 Dec 2022 18:30:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672108255; cv=none; d=google.com; s=arc-20160816; b=MNGpMbJnAYLVNW3BEtojnQsqAql9+X4RT66tlmM8DEnkZYJr0pTl/WG0L3OTJDpVG5 nvIYfhImHvGvPJGsVUcK3UYdMDPnP+tevZwlHnx+bMVwpL9k+xi2+URmGmO1PKl4m8ic mGyNC8EEzOlJl+Ak7HJ/1VYT3aHyNx1zrxrTq52J/qhDIqmLsrgR76ATDzpH0+N3o6R1 qUcp1F+M1P0iEYGvqC7NnwjKw9c4Dih9nLMesHE0Ri/Xb0rh6ZUHHE5E94r1xK6EBh27 no8v2hE0uUdgoAnxNlqQtnxj8GVCLz2FyASGXnFLJRNWBGkGGMTO8xRb2NoiaxbqqfA3 YEXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZkiXXqGvaxrzURStopKYIY21GLdv3Aj4sQRrit16zm0=; b=M8Wp+iJCin+7hnASKy+33bAKWT4Y10mXL1r7ieYikFVBYRBX9lEafj9NZEmXd24Lrt oiz+PEcUtlnqcu28kX1C2d/YlP3tE6PprVdSAxlf9/Nvu8VJP7dFOG/TdvBeQzRqsAHF ck0q1j9EbcxqGU3/tLu9zDnVyMoJDJjd8Qzq+JnfB2VW8sbgmcmaKxtKPrTHJlvrY0Yr EgmFYu09o5anJPyqTRByrUgQia9Ho2A3vTuUUz8H2fSrXDm+Xc/+95OVEtntDmlCOJNM XCVAWODLm/z7YNnW5+uvaX0Fh1Zc37QVKpVYien3hnc1jC3DlqeXnOsouR5PftrYbwt3 WwZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Pr6G3bQn; 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=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a170902f78a00b00176db49b734si12624817pln.283.2022.12.26.18.30.43; Mon, 26 Dec 2022 18:30:55 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=Pr6G3bQn; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232671AbiL0CaV (ORCPT <rfc822;eddaouddi.ayoub@gmail.com> + 99 others); Mon, 26 Dec 2022 21:30:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbiL0CaO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 26 Dec 2022 21:30:14 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C73C6CCD for <linux-kernel@vger.kernel.org>; Mon, 26 Dec 2022 18:29:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672108161; 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=ZkiXXqGvaxrzURStopKYIY21GLdv3Aj4sQRrit16zm0=; b=Pr6G3bQnBRhKOd99skTEHcNFgDY1B15vVcBaEQi2a5dXXA0k+guc5kcfxCQ16CPrsSy7Jt 2HXyOL7qUrBESsXVAKINYZbWOkvk3HHEhbrHbT72arExioQ3jp3a1ftClX5toa91kBMmcc ewUrL4n1IOHz8BR7+MKKUItT+0T3v4E= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-180-cwoAp4vSOsyJyCDdAZiRug-1; Mon, 26 Dec 2022 21:29:17 -0500 X-MC-Unique: cwoAp4vSOsyJyCDdAZiRug-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3513B85CBE1; Tue, 27 Dec 2022 02:29:17 +0000 (UTC) Received: from localhost (ovpn-8-22.pek2.redhat.com [10.72.8.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BB46492B00; Tue, 27 Dec 2022 02:29:15 +0000 (UTC) From: Ming Lei <ming.lei@redhat.com> To: Thomas Gleixner <tglx@linutronix.de>, Jens Axboe <axboe@kernel.dk> Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>, John Garry <john.garry@huawei.com>, Ming Lei <ming.lei@redhat.com> Subject: [PATCH V4 1/6] genirq/affinity: Remove the 'firstvec' parameter from irq_build_affinity_masks Date: Tue, 27 Dec 2022 10:29:00 +0800 Message-Id: <20221227022905.352674-2-ming.lei@redhat.com> In-Reply-To: <20221227022905.352674-1-ming.lei@redhat.com> References: <20221227022905.352674-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753332586237347319?= X-GMAIL-MSGID: =?utf-8?q?1753332586237347319?= |
Series |
genirq/affinity: Abstract APIs from managed irq affinity spread
|
|
Commit Message
Ming Lei
Dec. 27, 2022, 2:29 a.m. UTC
The 'firstvec' parameter is always same with the parameter of 'startvec', so use 'startvec' directly inside irq_build_affinity_masks(). Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ming Lei <ming.lei@redhat.com> --- kernel/irq/affinity.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Comments
On 27/12/2022 02:29, Ming Lei wrote: > The 'firstvec' parameter is always same with the parameter of > 'startvec', so use 'startvec' directly inside irq_build_affinity_masks(). > > Reviewed-by: Christoph Hellwig <hch@lst.de> > Signed-off-by: Ming Lei <ming.lei@redhat.com> I also note that local variable firstvec == startvec always in irq_build_affinity_masks(), so may not need to introduce firstvec variable at all. However that code seems to be removed later, so FWIW: Reviewed-by: John Garry <john.g.garry@oracle.com> > --- > kernel/irq/affinity.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c > index d9a5c1d65a79..3361e36ebaa1 100644 > --- a/kernel/irq/affinity.c > +++ b/kernel/irq/affinity.c > @@ -337,10 +337,10 @@ static int __irq_build_affinity_masks(unsigned int startvec, > * 2) spread other possible CPUs on these vectors > */ > static int irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs, > - unsigned int firstvec, > struct irq_affinity_desc *masks) > { > unsigned int curvec = startvec, nr_present = 0, nr_others = 0; > + unsigned int firstvec = startvec; > cpumask_var_t *node_to_cpumask; > cpumask_var_t nmsk, npresmsk; > int ret = -ENOMEM; > @@ -463,8 +463,7 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) > unsigned int this_vecs = affd->set_size[i]; > int ret; > > - ret = irq_build_affinity_masks(curvec, this_vecs, > - curvec, masks); > + ret = irq_build_affinity_masks(curvec, this_vecs, masks); > if (ret) { > kfree(masks); > return NULL;
diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index d9a5c1d65a79..3361e36ebaa1 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -337,10 +337,10 @@ static int __irq_build_affinity_masks(unsigned int startvec, * 2) spread other possible CPUs on these vectors */ static int irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs, - unsigned int firstvec, struct irq_affinity_desc *masks) { unsigned int curvec = startvec, nr_present = 0, nr_others = 0; + unsigned int firstvec = startvec; cpumask_var_t *node_to_cpumask; cpumask_var_t nmsk, npresmsk; int ret = -ENOMEM; @@ -463,8 +463,7 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) unsigned int this_vecs = affd->set_size[i]; int ret; - ret = irq_build_affinity_masks(curvec, this_vecs, - curvec, masks); + ret = irq_build_affinity_masks(curvec, this_vecs, masks); if (ret) { kfree(masks); return NULL;