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 E44C7E7B5E2 for ; Wed, 4 Oct 2023 09:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242073AbjJDJoE (ORCPT ); Wed, 4 Oct 2023 05:44:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242069AbjJDJoC (ORCPT ); Wed, 4 Oct 2023 05:44:02 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B50CFA for ; Wed, 4 Oct 2023 02:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=bC4URj9HssgP3HuoZwUSqV1NBIXkZYdW64Lwc9hHIho=; b=Gqbdwf67CniLERE4c8IGtyLqqO ilZAB+7PVrKb8/ujO1YTrSQ1c7n96DNnCAY5wL5hp54+Ay6QBIwKxZGzjVaAlDnQ2KURMvmWXlX39 TA0B+d87YgqWPrQus34CwDxYBLalWiENvk6E5sYmJUJzudza5jKVA4Di3OEQ19Mj26tVYVjS9tCWY 4R3mTWX4C7bZdWj5BRShxfudlvQY6tAgZZe+wZzLHUxW1YHHahaVYVTyRpZ9+jM/KYEqz8YeYwJ8m rxuySG0osm3820Fc5xMBZfdXPDSaZ8liH9Dhal6766fD8blO5oCOyFKOaYINUXrytQreO09BBpwxQ 9PSZTbKw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qnyPh-00Ag0G-08; Wed, 04 Oct 2023 09:43:30 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 2A1B0300365; Wed, 4 Oct 2023 11:43:30 +0200 (CEST) Date: Wed, 4 Oct 2023 11:43:30 +0200 From: Peter Zijlstra To: Ingo Molnar 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 , Florian Weimer Subject: Re: [PATCH v4] sched/core: Use zero length to reset cpumasks in sched_setaffinity() Message-ID: <20231004094330.GL1539@noisy.programming.kicks-ass.net> References: <20231003205735.2921964-1-longman@redhat.com> <20231004083648.GI27267@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 04, 2023 at 11:23:41AM +0200, Ingo Molnar wrote: > > if (user_mask) { > > - cpumask_copy(user_mask, in_mask); > > + /* > > + * All-set user cpumask resets affinity and drops the explicit > > + * user mask. > > + */ > > + cpumask_and(user_mask, in_mask, cpu_possible_mask); > > + if (cpumask_equal(user_mask, cpu_possible_mask)) { > > + kfree(user_mask); > > + user_mask = NULL; > > + } > > Question: is there any observable behavioral difference between current > (old) all-set cpumask calls and the patched (new) one? Very little I think -- the main difference is that we no longer carry the ->user_cpus_ptr mask around, and that saves a little masking.