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 0DF8DC00140 for ; Mon, 15 Aug 2022 14:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242960AbiHOOU7 (ORCPT ); Mon, 15 Aug 2022 10:20:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243009AbiHOOUv (ORCPT ); Mon, 15 Aug 2022 10:20:51 -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 ESMTP id D04EC647F for ; Mon, 15 Aug 2022 07:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660573250; 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=sEuTlIc9D6exXishpGuOUy0Zpyin7rcQK73GQnhVdPw=; b=eFFDdc2QOIDyvBLbuL3+YvDRXLArchFfiHNSCrM9E5BP2UprZssp3EDfK3ErTYKw6Xu5QE 8FF0Tqw7LelSJ8l5WYjRZwBaLl/2CSgQi25JX04nQMqT6S5V3i3tcYdHi/b97pdkKJcBHp GPfj6KYDzf2YSpDY/7meU95x5PEt7wE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-214-oOWlM7hqMeWV7Dhw1ZiifQ-1; Mon, 15 Aug 2022 10:20:41 -0400 X-MC-Unique: oOWlM7hqMeWV7Dhw1ZiifQ-1 Received: by mail-wr1-f70.google.com with SMTP id v20-20020adf8b54000000b002216d3e3d5dso1235371wra.12 for ; Mon, 15 Aug 2022 07:20:40 -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=sEuTlIc9D6exXishpGuOUy0Zpyin7rcQK73GQnhVdPw=; b=oipsOn3Frl9IbgBp3dbc9J+gwHmiBhPQcTRcKSEWgaHBvwEAyptgjrjX7AfZ+aRNOp 6a9HtCzlFy/CUm25T+kYg6O11De79yjAKabk5Nmr33whIm5AWOZIKDcr2u0QWm/KcPyA MzvkXPR9EReoQF41SSDoOkqTQkcBw2bHlAO3b1+/g1CEMHyrEoRDU5rTfdcKJPXLjLKE CtvJbVea4TGIV2Bfpt7my225JjLV1/TZSGjivhPs2kAnSLbGkb4MYeCmcA+2XevpKSIm R6OBypftSSWr/O5rAsZnEVbVZTAs0QooVPlgX64F9Aq2n2vwgewMVuBcASyQbxtjxXQ1 rgDw== X-Gm-Message-State: ACgBeo0os4gK1TbMRumLpo5wQVFsVkJczG7XKrsTyQ5v0elDKCMkLR/l wWFGmVa0wg895LHjqWRIOoFbH8u/TdvTPr7DWn7tUaTzyU6iD7/k6Kgqdv+jLQhjcEA0XMpw+Bt xFJu8LM6ud0fi4EB3W5VlPX+g X-Received: by 2002:a7b:c851:0:b0:3a5:f211:45cd with SMTP id c17-20020a7bc851000000b003a5f21145cdmr3809014wml.156.1660573240050; Mon, 15 Aug 2022 07:20:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR5K+0BJFIv+aYiFq6fh9I9DjGQJGMk6v7lj9XQKf0lJDnlYFtrvurp8nf2kDJ76lAMQRk7Ndw== X-Received: by 2002:a7b:c851:0:b0:3a5:f211:45cd with SMTP id c17-20020a7bc851000000b003a5f21145cdmr3809000wml.156.1660573239855; Mon, 15 Aug 2022 07:20:39 -0700 (PDT) Received: from vschneid.remote.csb ([185.11.37.247]) by smtp.gmail.com with ESMTPSA id d15-20020a05600c048f00b003a601a1c2f7sm879909wme.19.2022.08.15.07.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 07:20:39 -0700 (PDT) From: Valentin Schneider To: Tariq Toukan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tariq Toukan , "David S. Miller" , Saeed Mahameed , Jakub Kicinski , Ingo Molnar , Peter Zijlstra , Juri Lelli , Eric Dumazet , Paolo Abeni , Gal Pressman , Vincent Guittot Subject: Re: [PATCH 1/2] sched/topology: Introduce sched_numa_hop_mask() In-Reply-To: <6a2dae6d-cbac-84ba-8852-dadd183fb77d@gmail.com> References: <20220810105119.2684079-1-vschneid@redhat.com> <03aaf512-3ac5-fdfe-da2d-3fecd24591e2@gmail.com> <6a2dae6d-cbac-84ba-8852-dadd183fb77d@gmail.com> Date: Mon, 15 Aug 2022 15:20:38 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/08/22 11:19, Tariq Toukan wrote: > The API is indeed easy to use, the driver part looks straight forward. > > I appreciate the tricks you used to make it work! > However, the implementation is relatively complicated, not easy to read > or understand, and touches several files. I do understand what you did > here, but I guess not all respective maintainers will like it. Let's see. > Dumping it all into a single diff also doesn't help :-) I think the changes to get a for_each_cpu_andnot() are straightforward enough, the one eyesore is the macro but I consider it a necessary evil to get an allocation-free interface. > One alternative to consider, that will simplify things up, is switching > back to returning an array of cpus, ordered by their distance, up to a > provided argument 'npus'. > This way, you will iterate over sched_numa_hop_mask() internally, easily > maintaining the cpumask diffs between two hops, without the need of > making it on-the-fly as part an an exposed for-loop macro. > That requires extra storage however: at the very least the array, and a temp cpumask to remember already-visited CPUs (the alternative being scanning the array every CPU iteration to figure out if it's been added already). I'm going to submit the cpumask / sched changes, hopefully I get to something by the time you're back from PTO.