Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1676929pxj; Wed, 19 May 2021 11:14:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwInl6sruiLEOzQtVf8IX2WXk2+XtRaQGQa55CVSHXRiOGQwab1dDgF2EiUWTLxqA1P2i8d X-Received: by 2002:a05:6e02:527:: with SMTP id h7mr292030ils.93.1621448042383; Wed, 19 May 2021 11:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621448042; cv=none; d=google.com; s=arc-20160816; b=Sn49CsTv8p0HDhadsEdgH43UXeCZKLcvz2VTSkQXggnZg2Yh3d9MNp/fKna5AqmCZx 3nfPzMLlvDCIxrBg57hXmfgwa8TWA+UFGlw4NNwOClTFGpmUH4v0ekUNBqF3KoJIVvlV Qyuwt0CNE+2g5kyEAYeJR7+R/1fynw/dn6fEYT4qyOMf3NAmhQgnae1PRd3vpMIFn377 VM2+M8RYmT3Nrj+Kn3bBzjgKPu+KHROYGbJ/nNqKyDWv/66ppymqHc3IGYt9+Chs54dT uxSctZmV2O8xAUOLkLk7nQQpWxk+hmoEmDVyFnmFE6V38mimooTrPIXlaYe3q1JY6Qav wtFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=7DNJV9dkGFE+bl3WtdlpG22XkOrM4vntnpkOti8lyu0=; b=NqiibddukJsvfGfAwXs6g335xPWSQP9dKX0vsOIgWRuVK7Wc0Zow3wNMm50nn3Vsug +RtQD14hQZYe4/whphVFkSvWt/4b9JTvrpG+1y/3bGGM2iUqp8U7InjQmU7btjTDOgSq tnlVuSqR1b+lL0EhljSPsz/nWe+Y28JHPYN4AdFHl4I76WA74djCGfxwKDJxoVB2o80P DmP0SUfvXSb5lNgkp303epbRrlEUe2ix1/jHis0HXjEpcUai8B8YGYChN7GuxAHaLSAE hUlZlBX4gie19TqdwxICclxhNsbqQlRMPQGQXTPWFsJaxK06dGbp0SU30ZdKUxF+ENO5 yuPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k64si26958684iof.43.2021.05.19.11.13.50; Wed, 19 May 2021 11:14:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234992AbhERNtc (ORCPT + 99 others); Tue, 18 May 2021 09:49:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:45650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245330AbhERNt1 (ORCPT ); Tue, 18 May 2021 09:49:27 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 92B1961185; Tue, 18 May 2021 13:48:08 +0000 (UTC) Date: Tue, 18 May 2021 09:48:07 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Yejune Deng , mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, Yejune Deng Subject: Re: [PATCH] sched: simplify is_cpu_allowed() code Message-ID: <20210518094807.57cb7fb7@gandalf.local.home> In-Reply-To: References: <1621342486-9643-1-git-send-email-yejunedeng@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 May 2021 15:27:46 +0200 Peter Zijlstra wrote: > On Tue, May 18, 2021 at 08:54:46PM +0800, Yejune Deng wrote: > > Combine multiple if statements that return the same value. > > This patch is not a nop; You now deny cpu_dying() for everyone, while we > explicitly allow it for kthread_is_per_cpu(). Right. The patch is flawed in many ways. You don't combine if statements just because they return the same value, if you are messing with the order of the checks. if (A) return false; if (B) return true; if (C) return false; is not the same as if (A || C) return false if (B) return true; Please don't do that. -- Steve