Received: by 10.213.65.68 with SMTP id h4csp3766310imn; Tue, 10 Apr 2018 04:30:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+coJqupKS3+taawVMemPhXnjs6r+F0DwY4dcrNWwcyofWhLcNd4+gUSuXiWsucopym9ian X-Received: by 2002:a17:902:2a43:: with SMTP id i61-v6mr25737plb.54.1523359809113; Tue, 10 Apr 2018 04:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523359809; cv=none; d=google.com; s=arc-20160816; b=lLErcaUayh80gjxaDKKvpkanpQ8fIaSb4T2u8nFoPvzmmQUViBJCDwtloHtf/M/q2R IK2yJurzPUlb75tmFyKybngeCrfn55nVU2BQP+zVyvQmANTTIH5Anq/ADeHlFMzxbw7B aLueiphJ2WR8f4RhoAEm6n5ersBw98SxocbD+ZQ9F3UDJORCuN9ka8ZucLh4ig9Cvou+ dZbSqITWxAYcI78oxfjOuF3cSNBvdco87smbNv4MiyDEZR1Jiko7sBqmUNw3BWThe8O3 I89oVgOo74yXTCg2fRao0u9NCeNl6C7rYrynL7+2CF475XmbuSuIyY0ahPt9NPeyf6LV izng== 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=s0LvnyqrHrvfeV5F3NCr3vr1xZuix/bUYHwhRkI1gVg=; b=eYFRUlq7lOFGKNRgDttcUfQf2pilkfzLOCzq5tuqIrKUKti2ATnwDBa1Q+68xXgx/o xFFKXDt9bNFKvR2+hJsce145AhwzOLkVuOuec65VojKK8dl5eaxkG5zgHiqJYbwAQIa1 Szkmo24vh2g5jxrxoX7JZF5HUBAr3J636Wet8UO5B6kayd+Xo1Wxw0MNFPF4zQU+HXRF TM9fHr+qDO/OJ7wICE8GC4ubcHCqZGlmwqmsqbzoxjgeu525DiIgAGS1gkwnOL/FK45o 9LVH17YlreWJZD05uNmCIGZbgCL7z9G5Ltb/6UEx6hshSq+KSyVXyZh6j3mG6kY33KWW vdAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=yKBWSzgP; 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 34-v6si2354014plm.495.2018.04.10.04.29.32; Tue, 10 Apr 2018 04:30:09 -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=yKBWSzgP; 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 S1752402AbeDJL05 (ORCPT + 99 others); Tue, 10 Apr 2018 07:26:57 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33128 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751747AbeDJL04 (ORCPT ); Tue, 10 Apr 2018 07:26:56 -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=s0LvnyqrHrvfeV5F3NCr3vr1xZuix/bUYHwhRkI1gVg=; b=yKBWSzgP5MTAfFqrccjS8fUR0 yhRU69fQbt1+UI1OG2vOmqCaHEkpGsdfwilQczNktqafEU3/QUbZUNs5LISqK4awITXQiP+s67G+S mf5Gq7QUgFZyUb4i5XKVzjrEOdK8ampJ9uvDIh+jHpcP2fYIipsEwA8UF81lVwM3JJK8/i2HE06Pm +VYjeqFsy46Ql6nP2/LZNiwOng2xehSJE4DqqxJ6Zq6D5dIHJw1en/UOJ1I2FboYMqo5sK/J1htA9 QMEdEmhdgARQJen+iJ8xbLwqc5ktEAAFD1gh+czv4JTQLe0R/qhqO1CCrYORJaxIHC0Y6FFfTLou3 qNpxSONxg==; 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 1f5rQ8-0001s2-C3; Tue, 10 Apr 2018 11:26:40 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A66AD2029F86F; Tue, 10 Apr 2018 13:26:37 +0200 (CEST) Date: Tue, 10 Apr 2018 13:26:37 +0200 From: Peter Zijlstra To: yuankuiz@codeaurora.org Cc: Thomas Gleixner , "Rafael J. Wysocki" , Linux PM , "Rafael J. Wysocki" , Frederic Weisbecker , Ingo Molnar , Len Brown , Linux Kernel Mailing List , linux-pm-owner@vger.kernel.org Subject: Re: [PATCH] time: tick-sched: use bool for tick_stopped Message-ID: <20180410112637.GD4082@hirez.programming.kicks-ass.net> References: <891d4f632fbff5052e11f2d0b6fac35d@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Apr 10, 2018 at 06:07:17PM +0800, yuankuiz@codeaurora.org wrote: > > > > > @@ -48,8 +48,8 @@ struct tick_sched { > > > > > unsigned long check_clocks; > > > > > enum tick_nohz_mode nohz_mode; > > > > > > > > > > + bool tick_stopped : 1; > > > > > unsigned int inidle : 1; > > > > > - unsigned int tick_stopped : 1; > > > > > unsigned int idle_active : 1; > > > > > unsigned int do_timer_last : 1; > > > > > unsigned int got_idle_tick : 1; > > > > > > > > I don't think this is a good idea at all. > > > > > > > > Please see https://lkml.org/lkml/2017/11/21/384 for example. > > > [ZJ] Thanks for this sharing. Looks like, this patch fall into the > > > case of > > > "Maybe". > > > > This patch falls into the case 'pointless' because it adds extra storage > [ZJ] 1 bit vs 1 bit. no more. Since its a different type, the bitfields will not be merged. Also I'm surprised a bitfield with base-type _Bool is even allowed. > > for no benefit at all. > [ZJ] tick_stopped is returned by the tick_nohz_tick_stopped() which is bool. > The benefit is no any potiential type conversion could be minded. Do you have any actual evidence for that? Is there a compiler stupid enough to generate code to convert a bool to a 1bit value?