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 3B09FC32771 for ; Fri, 19 Aug 2022 10:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348352AbiHSKYo (ORCPT ); Fri, 19 Aug 2022 06:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346861AbiHSKYh (ORCPT ); Fri, 19 Aug 2022 06:24:37 -0400 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 8372C7E018 for ; Fri, 19 Aug 2022 03:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660904674; 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=N/mHVSrbqdjC1aGVDhd/e9K2D4ML01uWyXVxjKqxQ38=; b=G6b1Uu1BBzHV9DjgrsVeIV7pIUfBP8p9qUe3dJTS6iU0Aubq7ghgGuLgwfOmjOvvyhJSp8 c78JHJPGVq2Oj6+fRQtfrWRYnxOIibRRLv+fO9MfERW2nrg04Ovs3nnnVqSwFAmeLruwb1 /ezCjwQhEQtC7+tPxYIs7Oc/kfPVJBM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-550-lbU4VtluPxyH3DSpoRfG0A-1; Fri, 19 Aug 2022 06:24:33 -0400 X-MC-Unique: lbU4VtluPxyH3DSpoRfG0A-1 Received: by mail-wm1-f72.google.com with SMTP id ay21-20020a05600c1e1500b003a6271a9718so2000616wmb.0 for ; Fri, 19 Aug 2022 03:24:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=N/mHVSrbqdjC1aGVDhd/e9K2D4ML01uWyXVxjKqxQ38=; b=FGgw6RzPfJWzOoM8fc6jaNpjkgrejEleo9iVWRr0lv7T0OyO5lB5MVraWLKqCuqBpG TohGmYCnMkTP4XydEeWVk2sSIk9Ot1tuAkliNs5GQp9g0LrvFqzpDP/aroI0prvQutkb WuB6u9tGVtE/JauhDcIygiCGgrxFkYRhvyGWcoQTA4xqQP/J2JEggvQGlZE/pPoMiCpt muYplMfzCBcgdoKGPPkmtmODyoI42izGUyJ2ZVeyNf2UBwdhnao985ZtClFAtikYHNiz tissvS/GQ6ZZBBOMVz2o0owC0z7bH3AgLDJ18RQhif3mh1yCfIuM6MNtJkmCf57HRfQl VRHw== X-Gm-Message-State: ACgBeo0adMnEozVCAcm0k1Q4s8Y3IHJn1EKEAiONa+ZucK8ETn9kpdLD gMzU9g8SlM9UGPlw9WUnk40op47AVPkhqSTCClUTmWZpN73Ch+7Cz88wKvaaKcVzStF1D520vMO qvndVLl6Nwga8QRzXSk68+ohN X-Received: by 2002:a5d:59a5:0:b0:222:c5a5:59c4 with SMTP id p5-20020a5d59a5000000b00222c5a559c4mr3791034wrr.656.1660904672331; Fri, 19 Aug 2022 03:24:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR4UobtwGkKhtvRtmvWs5RTtIa0uu+mihO6JQ7YoZdSMlNd0HYG8d+3BDeBwZzHjqohIks9ljg== X-Received: by 2002:a5d:59a5:0:b0:222:c5a5:59c4 with SMTP id p5-20020a5d59a5000000b00222c5a559c4mr3791015wrr.656.1660904672084; Fri, 19 Aug 2022 03:24:32 -0700 (PDT) Received: from vschneid.remote.csb ([185.11.37.247]) by smtp.gmail.com with ESMTPSA id m9-20020a7bce09000000b003a3442f1229sm7950701wmc.29.2022.08.19.03.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 03:24:31 -0700 (PDT) From: Valentin Schneider To: Yury Norov Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andy Shevchenko , Rasmus Villemoes , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Mel Gorman , Greg Kroah-Hartman , Barry Song , Heiko Carstens , Tony Luck , Jonathan Cameron , Gal Pressman , Tariq Toukan Subject: Re: [PATCH v2 2/5] cpumask: Introduce for_each_cpu_andnot() In-Reply-To: References: <20220817175812.671843-1-vschneid@redhat.com> <20220817175812.671843-3-vschneid@redhat.com> Date: Fri, 19 Aug 2022 11:24:29 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/08/22 15:38, Yury Norov wrote: > On Wed, Aug 17, 2022 at 06:58:09PM +0100, Valentin Schneider wrote: >> for_each_cpu_and() is very convenient as it saves having to allocate a >> temporary cpumask to store the result of cpumask_and(). The same issue >> applies to cpumask_andnot() which doesn't actually need temporary storage >> for iteration purposes. >> >> Following what has been done for for_each_cpu_and(), introduce >> for_each_cpu_andnot(). >> >> Signed-off-by: Valentin Schneider > > I'm concerned that this series doesn't give us real examples and tests > for the new API. If we take it as-is, we'll end up with a dead code for > a while, quite probably for long. > Tariq has at least two uses of for_each_numa_hop_cpu() (which uses for_each_cpu_andnot()) in net/mlx5e and net/enic). My plan here is to make sure the cpumask and sched/topology changes are OK, and then I'd let Tariq carry the whole set with actual users on top. I wouldn't want to see this merged without users, especially given the EXPORT_SYMBOL_GPL() in 3/5. > Can you please submit a new code with a real application for the new API? > Alternatively, you can rework some existing code. > > Briefly grepping, I found good candidate in a core code: __sched_core_flip(), > and one candidate in arch code: arch/powerpc/kernel/smp.c: update_coregroup_mask. > I believe there are much more. > Some of these look fairly trivial, I'll have a look around. > Regarding the test, I don't think it's strictly necessary to have it as soon as > we'll have real users, but it's always good to backup with tests. > That sounds sensible enough, I'll have a look at that. > Thanks, > Yury