Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2543265lqo; Tue, 14 May 2024 01:43:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYHtW1gsdW4Ek6PyW9HTD9UzhEAXUC/761dsOlgxFWhJB0XFbtYLML8mvc+/63DnP0ppCTYAfPF1Plw/5kE5DylQ3Rtsuy2RfKqn7dxg== X-Google-Smtp-Source: AGHT+IFfgESBBEEfOcnNI4bCMBFRBbIeet+WZoETg4NuFO0skzIK+tk4jXEonWhEQ0uThxTxAkRU X-Received: by 2002:a05:6a20:918f:b0:1b0:58e:1b9a with SMTP id adf61e73a8af0-1b0058e1e69mr3754479637.4.1715676196038; Tue, 14 May 2024 01:43:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715676196; cv=pass; d=google.com; s=arc-20160816; b=l8la+0OCQ/UgQonPNFdHwYD9O9en7CIwUvavAlA9eshtc4JPSg1A25PWVJQog7aUXa rQ7H5yaBbkm+zH2Qyrl9OCsHfGYV73ehsKKY+4KCJtbj6MJ06Nnbb7/R82sHpgEdVvsb iqHZSqydqiTnk6XEjH1fN0pO/SJvn2AZTlSvSo+GmUxNexItiXF9aDFsxKXdYtJ1rOTl mPGFlwU15xJXfYn5Egpk9/hUnsID6WRw667XEWCYctJLjXjE63Rca5ixYS04qtJmlwmM /JjmfJFy2kbFdoVi84FSDQ3HLCWWOC542G19Jpg1LMoaFydGcwcOTR4GujBm36go73HJ eElw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:to:dkim-signature :dkim-signature:from; bh=BKDRuc1srV9gybrmHs64Jn+lPZhJpy610DEDeydMnhA=; fh=SlbWHRj+gLOrlvL53ns/nI+gY3x1SHKz8fepAhc9mLo=; b=F2zlNSjHSuGzceelClF7AjugkRh1vaEqDJM2N3paCFrJgcSUK2ADbmszfeeqR9LdWu WdZ91B3R/JQJAVP2ZZRq1IwNJiXElAtUaeoNGCzJso6q25Uyl7GfljWotSOWcDd4t3TC 9wG8mqG1rJ2gJx3/WeTOIFxYSLHqntow19+swhtBK1VwUhKFg4egrHSetfN0HATOTdWZ Ka/R74b5TQVTg/K89q1AxMkD6KsywqidFFXKshzcT63PYBs8EuKImvJfPNis26Hsp+4+ t6cb9OhKdsNAUTaoL8jWB1GrLgoP4G5J+aJiB21tGOHTF1IzoV2CcZmxlZSVeFtvR62c 3thw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iz6tzHlZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-178447-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178447-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-634103f6fb8si11044987a12.347.2024.05.14.01.43.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 01:43:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178447-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iz6tzHlZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-178447-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178447-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 44D28282952 for ; Tue, 14 May 2024 08:43:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92F261CD06; Tue, 14 May 2024 08:42:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iz6tzHlZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TaePvhSw" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 600991799B; Tue, 14 May 2024 08:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715676169; cv=none; b=Og6vJVBgTIYOs1BGbW2bHxtS1tMUhXvelPUnXP4+N1aXOV0mbUgN7LiPlAKlC2CAPeimRirEiJtnS7nEBBJllPHQAnD1RweuBVHK+TZvyzkreqVVC/HluHqpxSZYg0ioseg6gi1YLsZvgG/uht4dFR83UyMqULH0/SuzuTItIeE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715676169; c=relaxed/simple; bh=LTyvoXyrXlLqUbyp8anKtFEOFWbs9dtC7E/LhYcNvA8=; h=From:To:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=YQhaWcImVvXkGpmgmRnbqhbKsSeRzruyJOAr613u78keoE0u705zJtEue7tWe61jcFHfG/P6i0ve7XTqQE7vvf7293W4Avv+ll16lNnoMQ8ZdttOKW6WxTQqpcZUfra4FZuD+wY4jY14zfbH9V79H2rjq3PEaYST/BHjOZW/BHI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=iz6tzHlZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TaePvhSw; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1715676166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BKDRuc1srV9gybrmHs64Jn+lPZhJpy610DEDeydMnhA=; b=iz6tzHlZq+DeelfFJI3qyULE+4TJG9X6+b76gAkxetCvGY+PxHJeOerrsUxaT6Qln9CjWk 5pEYnzPLt6cWovYNYGsyJSq1YhZoivaHkziYGz86YRv2wCoh3yXpO1cJU5I4t0fLOytMx7 nZOyNLcX7Ef0nA9MwzL9iJf2SUcZnySwPuoCRkCmu00LLAeaB8JfB7+cpsUsJAPBSfZOQZ QnGiQ0X/4Mp5kkaWr/mxplrtrkVASBluNQCR4ToqAJcPEHg7fBU5b9U6h7mI+Ib/jYmi6z 4uNtPdK0y+NkI8kFyQmnspW/KZkUyAIcVsvIewxPaxTVFZlggOug8ivjRlInpw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1715676166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BKDRuc1srV9gybrmHs64Jn+lPZhJpy610DEDeydMnhA=; b=TaePvhSwMtq2SSjRgSe/F8xG4t68FPylVxhieZghkpnQWCu8MaiQfwSjq6NizUx40Xd24g cbTUu+yY0iz5FSDw== To: Yury Norov , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Paul E. McKenney" , "Rafael J. Wysocki" , Anna-Maria Behnsen , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Frederic Weisbecker , Imran Khan , Ingo Molnar , Johannes Weiner , Juri Lelli , Leonardo Bras , Mel Gorman , Peter Zijlstra , Rik van Riel , Steven Rostedt , Tejun Heo , Valentin Schneider , Vincent Guittot , Waiman Long , Yury Norov , Zefan Li , cgroups@vger.kernel.org Subject: Re: [PATCH 6/6] tick/common: optimize cpumask_equal() usage In-Reply-To: <878r0cn6a5.ffs@tglx> References: <20240513220146.1461457-1-yury.norov@gmail.com> <20240513220146.1461457-7-yury.norov@gmail.com> <878r0cn6a5.ffs@tglx> Date: Tue, 14 May 2024 10:42:46 +0200 Message-ID: <874jb0n5rt.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Tue, May 14 2024 at 10:31, Thomas Gleixner wrote: > On Mon, May 13 2024 at 15:01, Yury Norov wrote: >> Some functions in the file call cpumask_equal() with src1p == src2p. >> We can obviously just skip comparison entirely in this case. >> >> This patch fixes cpumask_equal invocations when boot-test or LTP detect >> such condition. > > Please write your changelogs in imperative mood. > > git grep 'This patch' Documentation/process/ > > Also please see Documentation/process/maintainer-tip.rst > >> Signed-off-by: Yury Norov >> --- >> kernel/time/tick-common.c | 15 +++++++++++---- >> 1 file changed, 11 insertions(+), 4 deletions(-) >> >> diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c >> index d88b13076b79..b31fef292833 100644 >> --- a/kernel/time/tick-common.c >> +++ b/kernel/time/tick-common.c >> @@ -253,7 +253,8 @@ static void tick_setup_device(struct tick_device *td, >> * When the device is not per cpu, pin the interrupt to the >> * current cpu: >> */ >> - if (!cpumask_equal(newdev->cpumask, cpumask)) >> + if (newdev->cpumask != cpumask && >> + !cpumask_equal(newdev->cpumask, cpumask)) >> irq_set_affinity(newdev->irq, cpumask); > > I'm not seeing the benefit. This is slow path setup code so the extra > comparison does not really buy anything aside of malformatted line > breaks. Instead of sprinkling these conditional all over the place, can't you just do the obvious and check for ptr1 == ptr2 in bitmap_copy() and bitmap_equal()? Thanks, tglx