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 483FF1CEAB2 for ; Mon, 24 Feb 2025 21:19:01 +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=DXrG5xl5LK4cB/FXxQp/lb7146PPgpDEznvooBMqRULshZqC+TwO7ojQfV7iwQ/wSXYEOwSLi0abC3rAt2SB1CDP17SwMaBPs6PjT65sqQuhx5rqyz+pTL5jcQArohedQIAEQc5Tqva5sTw+ZhJ2irCG1ZmPWkdfJsbQTa5xyvk= 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: In-Reply-To:Content-Type:Content-Disposition; b=SZRWmRcAuOkCsZQpN6jZ3qK2eY3PJBgyy5j1NDA/+D0jw63lUSFf2Ewk4B+gMkRCgpYC6dcoBGycdUJnHVpgN8oVEdgg0J6IZRKKwLXhUtBM+x5NdcvxR2HAFpkTF9EHAnqGrlojI7A04F9gIE13kOkzlHl4IJokX8TcEZi1JHo= 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=OA6vU+Dp; 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="OA6vU+Dp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740431940; 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=OA6vU+DpQ5QFlPkhsXvUdfCi/a5Izx8aOLUZMgeeW4QroIhmONsw/SktqPGNu+DYsJmvEH 94LXojjmzsPJBvM6ejG78ck/68aJwS+ghkX3567LnfRTA4vCIDWWaS2wLdO/mwRXNYhxi1 TydZBVURawAbTHqRIJXFwpxUqN/IW5w= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-XQKoibRrMCa1rzghf5lbDA-1; Mon, 24 Feb 2025 16:18:57 -0500 X-MC-Unique: XQKoibRrMCa1rzghf5lbDA-1 X-Mimecast-MFC-AGG-ID: XQKoibRrMCa1rzghf5lbDA_1740431937 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5e0bff433cbso2823929a12.2 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=vEpwKv7AY0jgaVueaK/ShV6mOextitJpcDIIYmu/0cfKzthTo3ronFnCOAzYbx6MQd jm9E9f7XKkHjM9zv4t7ErlRfCUagH6BX/3OPaaKmVmamGXlEczyKpQBBqvpWApNYoYL4 963mi4Lxb0OeoxgFO435A4Uat5pZq4Sc+jysNVogSwihAMtlx/ze74fDoGJjwosZ2LYZ BWN/xVVm05pj62YQuo52dtFgKRUvhtoCgKCFgJ/93iEKfJkh7BltqNkQ8xgMAatGHfMK I/4SmC2Yq4GUsyjrpKoBQrQ0/LDWoZM1e/MIqfR8IgsOFrI94XCIFdaiP3Gk4n5IUa7Q jbuQ== X-Forwarded-Encrypted: i=1; AJvYcCUl7UHcdcvLcaCk94842norzCZRKE+oLiv1K2yzxZ/T5Y+Pym6j9X8Dxy4x9c0v4sRg19xFLCMWNHzbvKtVWg==@lists.linux.dev X-Gm-Message-State: AOJu0Yyymr1AjshHIy05mnC6kJnRNfScRPXyn8auOnAjQ+Wf2OVdZu3n Zl9UhWikRtEhQo1Mf7D9DXvAAxEaGZJjbps0cW61PVz9eNNe7N8uTJSjEPCcaaaN0JUBdIXx4dE Zlr8tgmMEkV3J0Ts3Ov6V40OS3UWzBz0UpBaubmdmTtURiNkd1byUicSLOlAzzoTB X-Gm-Gg: ASbGnct3U47DgU2D2rU5MRZ9BerqTK2oy56eNaI2G7VPTNtFVMWODCz1xyWBAKiw7RF EX32tg65xetRlW+L6Gg4hWGpWZScbk6mY0xOTLplAb6pMqQ3l0KF1I65lls8GIbk8hvn95FakY8 Q1hxkrlFqVsZdX10p3ZRF3UW6BqKTDvb/KqM+BsjMkKi4IDNfZl1nmHW8WqaA/SotCohhF3i1ye roL1kyVVHfsEcFhRhgcl4in7G6a+p7aWV+JqG5vDgs1F596KWEmTtEonltb5BDvA0s0hRtO5kvj ggVBqla2Gw== X-Received: by 2002:a17:906:3151:b0:aba:5e50:6984 with SMTP id a640c23a62f3a-abc099ead3amr1385574566b.2.1740431936621; 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: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20250128164646.4009-1-yury.norov@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: sjEyJnXxlm0JrOX5nAZIddWd5OeJwXp1sjygwdYAQpk_1740431937 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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