Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1972830rdb; Thu, 7 Dec 2023 14:20:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgtWZYDVYrJVYWgWfg7LKRB1iMj3jsgr/FaoJ+a3c9EQy/kg0bL/Ooeh2BTVgSyZHQupEl X-Received: by 2002:a05:6a21:149a:b0:153:78c1:c40f with SMTP id od26-20020a056a21149a00b0015378c1c40fmr2519279pzb.15.1701987605454; Thu, 07 Dec 2023 14:20:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701987605; cv=none; d=google.com; s=arc-20160816; b=B5bYpFNetHAcBCHbWS95qeMhLBaKzy7TCMwQwFyYt7UfNUHwVISx5P1S+vYDsLpd4h rcspuKal4w+4ilDzoJJaUIykx1e2LTvNd/Zk0c8JhnT3gG5t0XdcdM/w8KPQ2y9bCGd9 3EDv0UUYbhE5NvMg1wFUqAz9BrM4iran4AJwl7IxN2XOfvFFyeIuNZioqTjmmKdxDvVr WWzhSIKlQj9iAYP34RskgVtFMGMVNNjpf0r2yPpdksrkfrSwlQ3MDTE5RWvxDEtxbHaI lnni3JCxUpWxKM1soMuU/O8wsKJzy9L1GMAWfJt+3uV48xK2YrtEXvMF57gxFou1e1ad tLcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=n29wcNbg5W2ULSKtYxVWR9CYTbMdnhOAqjz6tEmiHCQ=; fh=p4A/Ja5GBPDvrmawjBJ3SKQ0qfgYIq+zX4zZWlTdgEo=; b=bxP6C0uSDoDPfO4V0tSAQRnMjAqy1qKgEK4LAGs7vGuq1EH4nTC+o5kpuUMlY9Ni+F JOoaKu+kYl9fer09VCrIP+PTr8yQV+sIvHG51b5s3reExzhybSoRrZXWD48d8SaiLIqa VbDhVU/Y4RupdeUVqJosmFLUq+D1VL3FmTUzhamc0HdndFDgt+ZNnhoFeKF77qna6Orp GG5Jqw2QEvOBkSm9Dz/hyUU7WEdQ350nec0E+ZSCsVCgn5VCW6mh1TinXCc+bU26cNCX fMl+zeau90NhFi5ADwrTGVTgN/RhL+5dWK8adceQgjwXCZ7fmE0rMHLEyCUTfmqES+OD h79w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=k+xxLbsl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id j3-20020a170902c08300b001d0050e246bsi421157pld.43.2023.12.07.14.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 14:20:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=k+xxLbsl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B1108822719D; Thu, 7 Dec 2023 14:20:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444088AbjLGWTn (ORCPT + 99 others); Thu, 7 Dec 2023 17:19:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444099AbjLGWTk (ORCPT ); Thu, 7 Dec 2023 17:19:40 -0500 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A817E1713 for ; Thu, 7 Dec 2023 14:19:46 -0800 (PST) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-5d3758fdd2eso13671317b3.0 for ; Thu, 07 Dec 2023 14:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701987586; x=1702592386; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=n29wcNbg5W2ULSKtYxVWR9CYTbMdnhOAqjz6tEmiHCQ=; b=k+xxLbslQTaDIzoJg++ZLHevAw53dtwUOkntQWtvUWrXoN1IxzgsTCRzBn7Jtw9gZH F5x6tsc7kA30e7CdOE9LYdAvgJuWSMStNO5LT9L8cTmjY+fHdiJFICcBYgin5+Yl8L+n LMgGonyveA66woAy/GQ/a/isPT9AlQZ8vgyPyQNT/EDwY+ru2tJn4IlgrhLxFXiY97oa PSSZ4v2qLljknsGTicOS6OR+IPzhD7TMQXXvN5rAQFsGt73GHsWm2pk6Tv1UmNx3QTTo O969n7Zd0qbCldAlciGgeSx0Sctof3uYKuX+WpQk9ra365cfePEs8vmQibHnUODoCny6 4Jvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701987586; x=1702592386; 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=n29wcNbg5W2ULSKtYxVWR9CYTbMdnhOAqjz6tEmiHCQ=; b=bF1B5uawkpOBvdy5YOy5DHLFawVhnuyWvufdTM+iEyYAfiKGcQluLw6sysriAJGmjR qxiFVmDWenoCSJWVV9hAxs2YiMWl8lFi7YejJ1jPJY9ig1n8xXH8Sa0R5OT23tNQ41NM +KUuv31RhNP5q6AR6AVzNuOnRnW2yyfxOlujHWHkXjYNdWbG/XFjERQ3fDaXOs2zCR+/ DN7FQ7SObQ4Lv3Y9s3WJvWcySslsdJumhi1iUHVIzCX/IQP3AsJh8oGs6CJ5Nc/gYMU7 3mw0zJBGPfIKiPAFSBeSnUnZF0W2fRmTA593Ls01wIeN92+Z5ZUznMGCDF5ed/59ulyi mckA== X-Gm-Message-State: AOJu0YxLBYQDm+USscQ6asTeiKo1VMJkNMaOLIAXZHcPcwNZmEITAXxp aEoSblVfHOcAp3r6aABqs18= X-Received: by 2002:a0d:ea88:0:b0:5d7:1941:356f with SMTP id t130-20020a0dea88000000b005d71941356fmr3180366ywe.86.1701987585799; Thu, 07 Dec 2023 14:19:45 -0800 (PST) Received: from localhost ([2601:344:8301:57f0:8f7f:efcd:5388:af4f]) by smtp.gmail.com with ESMTPSA id u134-20020a0deb8c000000b005d3f531a37asm204223ywe.85.2023.12.07.14.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 14:19:44 -0800 (PST) Date: Thu, 7 Dec 2023 14:19:43 -0800 From: Yury Norov To: Andrew Morton 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: References: <20231207203900.859776-1-yury.norov@gmail.com> <20231207134619.52545aaf4e5f393618a92c41@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231207134619.52545aaf4e5f393618a92c41@linux-foundation.org> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 14:20:02 -0800 (PST) On Thu, Dec 07, 2023 at 01:46:19PM -0800, Andrew Morton wrote: > 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. Thanks you!