From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6273719F48D for ; Mon, 24 Feb 2025 21:19:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740431942; cv=none; b=ma7YMvjjz4InpOnql0ljNP+saZp34kVb8mcA/E0rBBUjJ70lC2krg9vll25yhHFvZrpOk2+fq/M2LQtBukaNjgcfz9+DK4pjUjdF5SLYIHtAelwT5abOJEIIBvUbTQrrEXDAFAa1zIqEQlmY0ITZbs0MFPgT9SUp4vOE2lBu8Jg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740431942; c=relaxed/simple; bh=/PQO7ZUzimjU555KfQCQmRzVBItJMZqfMDY7mblzjks=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=la/cNfgsW7wJpKX2+UVbvYnYFLFIzmbUN1EIC0V5ahwMdbD2TEktWPPnnnDFvtD7aQRF8wwMwzDqBeWfLYNnaagXpu5r25ZK0Qd1gPZKr9waDUIy27/+AUTX41k4fbH2wy9WRlAKrh6TGwG8SgmRzrHJHVBjrmdmSeAnZvfil0E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=LqNDiC82; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LqNDiC82" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740431939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b4ChK7d4tTnyUI2qkV4nzn6rGiBQ0dJ69F8Ua/liB9M=; b=LqNDiC82vdKj1lUIj1FS67vvq8PZ5rplEr6vO1z6gyh/KpT6vwmkrV9Jgm5oGjlVUFEuKr mlHM0YPZY4UBNxw/fzWxblNHAdc4m2hbuHAHPnThiMrv0eLVsRUm2+qzrWC/xfd+N4kzUQ D4ZGHDulm68HHC1rOUnm7SFruY5cOWw= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-39PIt6DXN-SO_uNd7IyN9A-1; Mon, 24 Feb 2025 16:18:57 -0500 X-MC-Unique: 39PIt6DXN-SO_uNd7IyN9A-1 X-Mimecast-MFC-AGG-ID: 39PIt6DXN-SO_uNd7IyN9A_1740431937 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-abb9d1c8113so367214366b.0 for ; Mon, 24 Feb 2025 13:18:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740431937; x=1741036737; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=b4ChK7d4tTnyUI2qkV4nzn6rGiBQ0dJ69F8Ua/liB9M=; b=hZ8+Wa25jSix1nQSX9PON27An8FqRUY2UbdFONG5jLO4S50YW0AtLieMU6CBy6xLVR pTVGKCTBOaM22vRYa4UFAesRHW1R94Kg2BO2ZSVg3r+uI2FoPadDLtS0DejyITb3vkdb b4IQPR+YQgOCu5gPZLUO8EH2QyI+sM3IPEfXuMU8ZoDGO6Dz3AjrJ1EGr3mL9JfYtJ4i BWfxOJT4i70M66T6cewWCr1xneQvoMHwwSlOwCoTTvaPH9Jp2bQ6CCCQ/NE1m1fFxB8N hfUab6hJKis7UNXWbz7kXspWHrUwRCKNIFUPuTdCG7/9XxaCsj+QNUjmEU5XKyXYYura BQaQ== X-Forwarded-Encrypted: i=1; AJvYcCWmiHroiw0xtZTtORBN7bEKklPpSEgs6UYVQczrEyzkcaNlZ977+mtae1tAfboVQauPvK8/YjU=@vger.kernel.org X-Gm-Message-State: AOJu0Yzi9WwVHSRmeYTnRT81n6Pti1lsPOQV0kbSXYHlGK+8ehG6lqWa 9DasH/jIWbYzZfcsj6SE+TDNeDv0yoJ+EALxyNER65mH0ckW2TW/A0AivRdGW+l3A7we/Mr1ZFL d30IcXl6GOyOAjfGC21VE2VKKhU5aVmnHuk5M7yY+Ja3RMQ3awA+f0g== X-Gm-Gg: ASbGncufDofTJQKqWdHd/0Fd8M0ZlwxPDw+UYdKMlVl+XBm9JcSaGJ77LUK7EYfy8Uh FgrhclG9u65dYaat1+pOwA4wW7K9RZwm/lrowy9uOyYBw/8DfyfJ/s71DrnTXyZxqZg/2JdJDWm lQAjbgUPrsLrhEPIE1pv8wOALs7v3z4X0XfdUJo05a88gsHw+POLQu3RbPi5HrdNv5dFEx6yow3 dsogNs5y5IanzIDliwyqcfocOormw28A2DEjPqzXlBnCM9WqFOqa7VxWG3fo9NWELR97ek8W5uJ MnvWsDB1uA== X-Received: by 2002:a17:906:3151:b0:aba:5e50:6984 with SMTP id a640c23a62f3a-abc099ead3amr1385573166b.2.1740431936617; Mon, 24 Feb 2025 13:18:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYEBC44CLKnEsK0LbK9e6zpwdED/WRkdl8e2EWDOlyh5Ynisvb1G99K7KkazLO1N5pYn2zMA== X-Received: by 2002:a17:906:3151:b0:aba:5e50:6984 with SMTP id a640c23a62f3a-abc099ead3amr1385570066b.2.1740431936166; Mon, 24 Feb 2025 13:18:56 -0800 (PST) Received: from redhat.com ([2a0d:6fc7:441:1929:22c5:4595:d9bc:489e]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abed20134fdsm23497166b.94.2025.02.24.13.18.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 13:18:55 -0800 (PST) Date: Mon, 24 Feb 2025 16:18:47 -0500 From: "Michael S. Tsirkin" To: Yury Norov Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, virtualization@lists.linux.dev, linux-nvme@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org, linux-crypto@vger.kernel.org, Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Haren Myneni , Rick Lindsley , Nick Child , Thomas Falcon , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Rasmus Villemoes , Matt Wu , Steffen Klassert , Daniel Jordan , Andrew Morton , Greg Kurz , Peter Xu , Shrikanth Hegde , Hendrik Brueckner Subject: Re: [PATCH v2 00/13] cpumask: cleanup cpumask_next_wrap() implementation and usage Message-ID: <20250224161832-mutt-send-email-mst@kernel.org> References: <20250128164646.4009-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250128164646.4009-1-yury.norov@gmail.com> On Tue, Jan 28, 2025 at 11:46:29AM -0500, Yury Norov wrote: > cpumask_next_wrap() is overly complicated, comparing to it's generic > version find_next_bit_wrap(), not mentioning it duplicates the above. > It roots to the times when the function was used in the implementation > of for_each_cpu_wrap() iterator. The function has 2 additional parameters > that were used to catch loop termination condition for the iterator. > (Although, only one is needed.) > > Since 4fe49b3b97c262 ("lib/bitmap: introduce for_each_set_bit_wrap() > macro"), for_each_cpu_wrap() is wired to corresponding generic > wrapping bitmap iterator, and additional complexity of > cpumask_next_wrap() is not needed anymore. > > All existing users call cpumask_next_wrap() in a manner that makes > it possible to turn it to a straight and simple alias to > find_next_bit_wrap(). > > This series replaces historical 4-parameter cpumask_next_wrap() with a > thin 2-parameter wrapper around find_next_bit_wrap(). > > Where it's possible to use for_each_cpu_wrap() iterator, the code is > switched to use it because it's always preferable to use iterators over > open loops. > > This series touches various scattered subsystems and To-list for the > whole series is quite a long. To minimize noise, I send cover-letter and > key patches #5 and 6 to every person involved. All other patches are sent > individually to those pointed by scripts/get_maintainers.pl. > > I'd like to move the series with my bitmap-for-next branch as a whole. virtio-net changes are straight-forward, so Acked-by: Michael S. Tsirkin > v1: https://lore.kernel.org/netdev/20241228184949.31582-1-yury.norov@gmail.com/T/ > v2: > - rebase on top of today's origin/master; > - drop #v1-10: not needed since v6.14 @ Sagi Grinberg; > - #2, #3: fix picking next unused CPU @ Nick Child; > - fix typos, cleanup comments @ Bjorn Helgaas, Alexander Gordeev; > - CC Christoph Hellwig for the whole series. > > Yury Norov (13): > objpool: rework objpool_pop() > virtio_net: simplify virtnet_set_affinity() > ibmvnic: simplify ibmvnic_set_queue_affinity() > powerpc/xmon: simplify xmon_batch_next_cpu() > cpumask: deprecate cpumask_next_wrap() > cpumask: re-introduce cpumask_next{,_and}_wrap() > cpumask: use cpumask_next_wrap() where appropriate > padata: switch padata_find_next() to using cpumask_next_wrap() > s390: switch stop_machine_yield() to using cpumask_next_wrap() > scsi: lpfc: switch lpfc_irq_rebalance() to using cpumask_next_wrap() > scsi: lpfc: rework lpfc_next_{online,present}_cpu() > PCI: hv: Switch hv_compose_multi_msi_req_get_cpu() to using > cpumask_next_wrap() > cpumask: drop cpumask_next_wrap_old() > > arch/powerpc/xmon/xmon.c | 6 +-- > arch/s390/kernel/processor.c | 2 +- > drivers/net/ethernet/ibm/ibmvnic.c | 18 +++++--- > drivers/net/virtio_net.c | 12 ++--- > drivers/pci/controller/pci-hyperv.c | 3 +- > drivers/scsi/lpfc/lpfc.h | 23 +++------- > drivers/scsi/lpfc/lpfc_init.c | 2 +- > include/linux/cpumask.h | 69 ++++++++++++++++++++--------- > include/linux/objpool.h | 7 ++- > kernel/padata.c | 2 +- > lib/cpumask.c | 37 +--------------- > 11 files changed, 81 insertions(+), 100 deletions(-) > > -- > 2.43.0