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 EC25CE7B61D for ; Wed, 4 Oct 2023 13:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242702AbjJDNzL (ORCPT ); Wed, 4 Oct 2023 09:55:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232786AbjJDNzK (ORCPT ); Wed, 4 Oct 2023 09:55:10 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C2CDA1 for ; Wed, 4 Oct 2023 06:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ROXXtmAjPeh1/YOvRF7YUBJoz3uZzkoxIMFjJkaEIgA=; b=LMp2eJUXhNoxPnNl15qOA7dttV eiL9rXbQ4V70h9r97M8I4rB75OFVp+iKyJ0NemPyMXUVU5rmilRObapLZXLSXOrIVU/hz6ReFgZ9u qe6Fndpulog9JU1PCLLZetuzT8ZiLeegApS+is6WUGpo/luE1e4+V/aYJhmPaxXnrsqiBOXKqk/AG Iv9UX19H+j3aQ4PKsrOxWSkGLiFx5qpaUy6ua94t6LZkW+41yr5+9tO7A3tiIlst03nUzllAolG50 X65D5P0aOFmJD1Q3gcF0bEGnAJaz6FJtHozKqjfFsG4XbhTMb1Kyti77/LAKdHyZH1HrTseVXkpnp 9BJ8v+Jw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qo2L0-003i8m-2f; Wed, 04 Oct 2023 13:54:54 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id BAB8D300392; Wed, 4 Oct 2023 15:54:53 +0200 (CEST) Date: Wed, 4 Oct 2023 15:54:53 +0200 From: Peter Zijlstra To: Florian Weimer Cc: Waiman Long , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Phil Auld , Brent Rowsell , Peter Hunt Subject: Re: [PATCH v4] sched/core: Use zero length to reset cpumasks in sched_setaffinity() Message-ID: <20231004135453.GB6337@noisy.programming.kicks-ass.net> References: <20231003205735.2921964-1-longman@redhat.com> <20231004083648.GI27267@noisy.programming.kicks-ass.net> <871qeaefco.fsf@oldenburg.str.redhat.com> <20231004135236.GB19999@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231004135236.GB19999@noisy.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 04, 2023 at 03:52:36PM +0200, Peter Zijlstra wrote: > On Wed, Oct 04, 2023 at 02:34:15PM +0200, Florian Weimer wrote: > > * Peter Zijlstra: > > > > > Subject: sched: Add CPU_FILL() > > > > > > Add the CPU_FILL() macros to easily create an all-set cpumask. > > > > > > FreeBSD also provides this macro with this semantic. > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > My main concer is that obtaining the size of the mask, or at least an > > approximiation is not exactly easy. If there's an expectation that > > applications reset the mask more often than they do today (I don't have > > the full context here), Well, the only time a reset is useful, is if they first set an affinity. So on the whole, you need the mask size thing solved either way around, you need it for setting and then re-setting. > > then we'd some decent interface to get the > > approriate size. > > Isn't sysconf(_SC_NPROCESSORS_CONF) the right number ?