Received: by 10.192.165.148 with SMTP id m20csp484445imm; Fri, 20 Apr 2018 09:53:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+gXcwNHEL2vDIFkRL9vdtQLxMsS8YFlCchKu3vNeZCnNP6N3cS/wOn1tgTT1SV53YIs/rV X-Received: by 2002:a17:902:3f83:: with SMTP id a3-v6mr10990710pld.279.1524243223628; Fri, 20 Apr 2018 09:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524243223; cv=none; d=google.com; s=arc-20160816; b=NoOCHuqNkfbJc+h2Nov+EcTzyh2q7Cfr2gHSmkbv+c9Gewk9V26S39gLhOHS2NHMR6 zVPmVyvlUFcnFS1ODCDPcy4hzeW8WmPFMFSYqGJi449dTfHcIL9NIRrCgw3RY+4TUGIG 59D9ZSTV5/MHAtIwkLS/S6CE6bC4XBNCir/XJnRGvOgDXJLhQUbIBeKhgGbOF9IYnNqk CbgKkeuXFWXGxL6QUao6XaBHMKNC3feZpeeSXfxzyiz3waXQR0btwekvofbN/ivz1K/b QYmrzWX1Mb8ttN0PnsSncOzijJg2LzxxzU251ENkwhP9Y5egY7uplp7r79vZqA4CnBqa G/Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=akwTtYSL9kUe/ErFejBsW1VNw3ldkWvLHSaX/3HHxBE=; b=ogzg3IGf+UhKRc1kwaklxZQXon55TLprXwC5jMqNBpraPb3h3QeoPuLUqrdLJfZSyN OE++mYHsHuPJs4I+czm16XfMFk3u7Tmc5gFBDeGC6IxgcHQISbPS0bEHOQWM+moULs0j NkvtnxWyvY1t7Bap2TgMxk++NKAhGp5Uzh3inpKMQSCsrppafEA/YXSUE0b1TYe118Dv GtfMMlr9R7XERrWXaVxKxFa4hGYc0GHnOrTuWLbkOtJlpFgwJPr+IwF4xH/kqYFuwwgm ehcZ9CBB1Qm/EQk+BSSzuuTDgBfjQrw8HipepWpb+USsKhudvyrINHW4ZILf1k9Q4eFp MnzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=nYhv9pwY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w61-v6si5950732plb.155.2018.04.20.09.53.29; Fri, 20 Apr 2018 09:53:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=nYhv9pwY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753340AbeDTQv7 (ORCPT + 99 others); Fri, 20 Apr 2018 12:51:59 -0400 Received: from merlin.infradead.org ([205.233.59.134]:54280 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751168AbeDTQv5 (ORCPT ); Fri, 20 Apr 2018 12:51:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=akwTtYSL9kUe/ErFejBsW1VNw3ldkWvLHSaX/3HHxBE=; b=nYhv9pwYN04VL2SQLbvRCxKKY heD7yWdN5FFEdf8/6lhvf4PChc3bTodUX5YHa6sJkmyTT4hpnHoP0/G8725r3YBW2/hGYHhSSNOJz cS0Umh//k1UilW8tbeE+XMDOjVGxhOo5ZSmjzhfpZ/pecNlLXHe8go72rNH3nmh6A3OEArECHWay/ 8uTjF6ncnalDkmpeW3+x+UGrJiuIqwJoPQdkluiZu9dOxencAp+3kgjAPS+faItq6koR0BvnlY0wt V8SuJtSZiLaf2uauUDgHG+WChBSlCW30lOb6Xi7jHUEbJUTpHkk0ur0qLOSsYl+rsyZOrFglTOaNY xJBPRmmxA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9ZG9-0006PK-0s; Fri, 20 Apr 2018 16:51:41 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5EE8C2029F883; Fri, 20 Apr 2018 18:51:39 +0200 (CEST) Date: Fri, 20 Apr 2018 18:51:39 +0200 From: Peter Zijlstra To: Philipp Klocke Cc: lukas.bulwahn@gmail.com, kernelnewbies@kernelnewbies.org, llvmlinux@lists.linuxfoundation.org, sil2review@lists.osadl.org, der.herr@hofr.at, Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/fair: Change sched_feat(x) in !CONFIG_SCHED_DEBUG case Message-ID: <20180420165139.GP4064@hirez.programming.kicks-ass.net> References: <20180416085426.24157-1-Phil_K97@gmx.de> <20180420075717.GB4064@hirez.programming.kicks-ass.net> <34572fee-36d0-36e1-ba6d-f098b145aba4@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34572fee-36d0-36e1-ba6d-f098b145aba4@gmx.de> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 06:29:07PM +0200, Philipp Klocke wrote: > The gain is stopping a warning that clutters the output log of clang. Well, you should not be using clang anyway. It is known to miscompile the kernel. > To improve readability, one can drop the ifdef-structure and just keep > the right shift version, like Nicholas suggested. This will have a (very > small) > impact on performance in CONFIG_SCHED_DEBUG case, but when > debugging, performance is no problem anyways. See that is two bad choices. > > Also, if sysctl_sched_features is a constant, the both expressions > > _should_ really result in a constant and clang should still warn about > > it. > No, because clang only warns if the constant is neither 1 nor 0. > (These being the 'best' integer representations of booleans) Then won't something like so work? #define sched_feat(x) !!(sysctl_sched_features & (1UL << __SCHED_FEAT_##x)) That forces it into _Bool space (0/1) and per the above rule will no longer warn.