From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1CC13E3C48 for ; Fri, 26 Jun 2026 13:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782479891; cv=none; b=MloYQ0jb/Tg0fK53xjvde+b2GfSMZloDKxiga0XDbcP1QmrYbPJrPvuGZfKqrg2pc+yyue3P7oDKSc6i6NFS+GWlPOMrlyhTyHwPJYQzunMOgDJ00RKyOUOjaW4AQASBqGtfxgXMiWqtG/arJYNNIJFSjkbYxSv7WEThSusNOQA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782479891; c=relaxed/simple; bh=2go8tLsemrVF9QHB7Woqcbs5lO6ciMBQ+JmmMaNzJ+E=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=boHNqz2MjWscYI7FBBdbQ1Ml9fe2k3LQ8zq6mSbs/6xeKu4FrI368euxAgqH9vB/X3TtGf2n6YLpaUd0k+7VNluB7fBohk/tgGKn6YkjHNzzuyvGQCOBIsO7yUGGWXUatDexPY863OzYYHQ3k0qQpEi/DxZsxMthcEitnZHGETg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KOljbKj7; arc=none smtp.client-ip=74.125.82.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KOljbKj7" Received: by mail-dy1-f178.google.com with SMTP id 5a478bee46e88-30ca1b4b278so1443951eec.0 for ; Fri, 26 Jun 2026 06:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782479887; x=1783084687; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=i5i+CvOkHBeeX3a+TkIm9MbIlVbCj3+vQ7+Rec0FlPA=; b=KOljbKj7nuHeUJuT2+4Kd5fIWO8h0a63z8JWRxpNUPpCUz9bWZNC+bU37oVt9JYjR4 piqELX5j9BeXj19pF+KFLL6FPILjY7Ez9dmNOUQ0EYQvkOUGtlsfc1gkBrjFMl2wtJC0 AHdR3vnfkhXeSllDVsE0kNEaapa4KHWduaMilw/1gYg56xrbk/DvjGeJ4hmLhJSQc92z qbca0WKDg3MluJ2kUfg4Zcs45YB4rdeXN08ZzoKkGHDLZvN4+ORDl827EvBMWT/atBHi cdic7pPC5znVNIFvfbxGab36xA8q1Ipzxvlfbrk1DUuKViSfDw8F/r2/tLy/ciciB7Pb ONNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782479887; x=1783084687; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i5i+CvOkHBeeX3a+TkIm9MbIlVbCj3+vQ7+Rec0FlPA=; b=h1hIe07xG/72RymPtIKgnP1dsc15nk52XH4SanShiKUaMI5oYM8BUvA075kKYrUXp3 csN6A7X9P/BuDyLyMfu/x4bqunSwmdTrfGlFN8Oc85QT7F9l0qOADGB4Gzq4si6uNygE +g2sDAI+s0HM0cbG1iCKSKoevxeg46pUzfC20K1Rd/nL3NRcTzD5DwejRjUupeQFa4Qd IhfTYBB+t6f0spf7TGcZz7lnk5sBFwuN7X4f0IN4onhFDTqadDv5DfF2Yul5vFmuyocy ykB3lRIac3daFTPKEIJF3NfT6stk/1eWFcacmk6vb5YAY4Q9Y4aoIDMHiXjlT2frAKEZ BtNw== X-Forwarded-Encrypted: i=1; AHgh+RqEa6+LIgnIxlLH3h334UKCuIxE218WMTcBreJl2BuqiZ8S9URf0wqxuSN3uvjJM5MvAD3jXkEzTHCKlNQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzEpjgtMAQK1Ws08sEVwv5fLlDa9BPoIgGK3xP+r7f6T8wxwhoi 20QMzTGaVUwpiJ17bw5vzq94q4o9yrO+FbpcRwVhKiGjknUd4+nN6iK7 X-Gm-Gg: AfdE7cmGZepKYx5Ec8J4aox3CrEC62CQyqhbXelhnLvE03F52+oBbYDPevFBeIDIBaf bjJIQDYvgGxv3UfwemRK3Fxf+XDC9rEX4Ud05PoBz2FIKdiq9XHiBi9B36yX9awKQuzqqR+1WUf GH9TQfO4mWSbrKwVe9cpoYmWJUfWUd3hYXyfrUibY9vPcq2DodvVfeaJI2o70ebd79QvCqgHJQh GBXUVwr0CgYiTZAnu91DkNWSfwtor+6FtRlqfAmDIZ5HGrK036gHBxa9lAY/DZipiOjRXwXDY4C yGjfEvvdUWdH+mb6t5S4vT2h5W0tiTLjgKqjoOT6a0X6YjsSScU+UklC/O0qixgpBKUKuppZ/oH N40INa0WBhPeHuT6vUSzR0csgqLJWaf/npyiWTN7qhCKRMLM0rIloTPQCOcPkRKKdxxJtM/7ou7 oGlDUtRvH4 X-Received: by 2002:a05:7301:5f84:b0:307:37a4:15dd with SMTP id 5a478bee46e88-30c85009ea4mr8248003eec.26.1782479886899; Fri, 26 Jun 2026 06:18:06 -0700 (PDT) Received: from localhost ([216.228.127.129]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30c7ca87caasm17211867eec.27.2026.06.26.06.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 06:18:06 -0700 (PDT) From: Yury Norov X-Google-Original-From: Yury Norov Date: Fri, 26 Jun 2026 09:18:04 -0400 To: Shrikanth Hegde Cc: Peter Zijlstra , yury.norov@gmail.com, linux-kernel@vger.kernel.org, mingo@kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, kprateek.nayak@amd.com, iii@linux.ibm.com, corbet@lwn.net, tglx@kernel.org, gregkh@linuxfoundation.org, pbonzini@redhat.com, seanjc@google.com, vschneid@redhat.com, huschle@linux.ibm.com, rostedt@goodmis.org, dietmar.eggemann@arm.com, maddy@linux.ibm.com, srikar@linux.ibm.com, hdanton@sina.com, chleroy@kernel.org, vineeth@bitbyteword.org, frederic@kernel.org, arighi@nvidia.com, pauld@redhat.com, christian.loehle@arm.com, tj@kernel.org, tommaso.cucinotta@gmail.com, maz@kernel.org, rafael@kernel.org, rdunlap@infradead.org, kernellwp@gmail.com, linux-doc@vger.kernel.org Subject: Re: [PATCH v5 04/24] cpumask: Introduce cpu_preferred_mask Message-ID: References: <20260625124648.802832-1-sshegde@linux.ibm.com> <20260625124648.802832-5-sshegde@linux.ibm.com> <20260626093901.GN1181229@noisy.programming.kicks-ass.net> <20260626094153.GD2568396@noisy.programming.kicks-ass.net> <79e85557-719c-4fc8-98ad-7bdcc6add753@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79e85557-719c-4fc8-98ad-7bdcc6add753@linux.ibm.com> On Fri, Jun 26, 2026 at 06:39:48PM +0530, Shrikanth Hegde wrote: > Hi Peter, Yury. > > On 6/26/26 3:11 PM, Peter Zijlstra wrote: > > On Fri, Jun 26, 2026 at 11:39:01AM +0200, Peter Zijlstra wrote: > > > On Thu, Jun 25, 2026 at 06:16:28PM +0530, Shrikanth Hegde wrote: > > > > > > > diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h > > > > index 80211900f373..5a643d608ea6 100644 > > > > --- a/include/linux/cpumask.h > > > > +++ b/include/linux/cpumask.h > > > > @@ -120,12 +120,20 @@ extern struct cpumask __cpu_enabled_mask; > > > > extern struct cpumask __cpu_present_mask; > > > > extern struct cpumask __cpu_active_mask; > > > > extern struct cpumask __cpu_dying_mask; > > > > + > > > > +#ifdef CONFIG_PREFERRED_CPU > > > > +extern struct cpumask __cpu_preferred_mask; > > > > +#else > > > > +#define __cpu_preferred_mask __cpu_active_mask > > > > +#endif > > > > > > This is cure, but does it not result in set_cpu_preferred() changing > > s/cure/cute/ > > > active mask, and it that not somewhat unexpected behaviour? > > s/it/is/ > > > > Yes. I thought about this, but i didn't see anything bad happening apart from > setting it twice. But I do agree, it is an eyesore when CONFIG_PREFERRED_CPU=n. > > > Typing hard, clearly. Also hitting 30C before noon :-( > > > > Take care. Even we should have had monsoon by now. > But its bright sunshine :( > > > > > For this reason, i had it as a function instead of macro in v4. > Do you think we can still fallback to it? > > only caveat is it won't be a macro. But since it is still compile > time optimized due to IS_ENABLED, it should be relatively ok right? > > +void set_cpu_preferred(unsigned int cpu, bool preferred) > +{ > + if (!IS_ENABLED(CONFIG_PREFERRED_CPU)) > + return; > + > + assign_cpu((cpu), &__cpu_preferred_mask, (preferred)); > +} #ifdef CONFIG_PREFERRED_CPU #define set_cpu_preferred(cpu, preferred) assign_cpu((cpu), &__cpu_preferred_mask, (preferred)) #else #define set_cpu_preferred(cpu, preferred) {} #endif