From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F0F3C4167B for ; Thu, 7 Dec 2023 21:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231690AbjLGVqS (ORCPT ); Thu, 7 Dec 2023 16:46:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231766AbjLGVqO (ORCPT ); Thu, 7 Dec 2023 16:46:14 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C5AA10D8 for ; Thu, 7 Dec 2023 13:46:21 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82810C433C8; Thu, 7 Dec 2023 21:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1701985580; bh=+fl5qkjwkyyMabRO9KAPlA6pbDn3eiAn7N0EPxruPWI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iCpHFd8ZdxULNz4m+zE/TMzDhAC7/t5yV6DaYENPwXY/O//QuIkZOn84nL13ML8KU QbSJQRL5Ea7aSsINp7jfXo+xVS5wGrXoGxY/d5FOG+jtmij58UyluG50yyrooBAZby odvViUpFceH5v//h1j0T4YyottgJWklRLznYE9sQ= Date: Thu, 7 Dec 2023 13:46:19 -0800 From: Andrew Morton To: Yury Norov Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, Ming Lei , Andy Shevchenko , Rasmus Villemoes Subject: Re: [PATCH v2 0/6] lib/group_cpus: rework grp_spread_init_one() and make it O(1) Message-Id: <20231207134619.52545aaf4e5f393618a92c41@linux-foundation.org> In-Reply-To: <20231207203900.859776-1-yury.norov@gmail.com> References: <20231207203900.859776-1-yury.norov@gmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 7 Dec 2023 12:38:54 -0800 Yury Norov wrote: > grp_spread_init_one() implementation is sub-optimal because it > traverses bitmaps from the beginning, instead of picking from the > previous iteration. > > Fix it and use find_bit API where appropriate. While here, optimize > cpumasks allocation and drop unneeded cpumask_empty() call. Thanks. This isn't my playground, but I'll grab the patches to at least get them some testing. Review from those who have worked on this code would be appreciated.