Received: by 10.213.65.68 with SMTP id h4csp3816432imn; Tue, 10 Apr 2018 05:16:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/7IOUF9uaqslcedfJp/Ak/1B+CRaIyMFdM13FzrqUJjkQMVf2FhoqPoqUNK+vx4jbwkQ0n X-Received: by 10.98.58.75 with SMTP id h72mr115250pfa.209.1523362569909; Tue, 10 Apr 2018 05:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523362569; cv=none; d=google.com; s=arc-20160816; b=d0/82WlSHIpF/wJO2oP1PlV2qmocO3EC1s/Czx3kPQ9Qw5tSZUlz6P82w+3+txdM2x FbAkh33MSW1nLbRZVbtjpsmZ7OBGoEtc/s1OCBaKESEr6lLHR+QAah8GMcI3JyPhTRei 4Tf6RZIha9L1cAj2nF4mEvNjhwF97XHH3C45vmtJouyK/UgnDPZvWsRTf2XKW2S6uPmW cb5acDE6R/FcS7y1Pkhp/o7WJFME+94Vx81Ie+p0djPz9tgosNnPXowidFcaWlBax1D/ zKQK4wqGdnKwGGaIllSm0P9ggzzXG+HTIZE7we6uCwdvfJZE+svwHGebV7JIkmkwUTzP mkjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=+ge2eO5l+jeoiYsx5mFgFrI1MnxygpWX7OLeta6VPn4=; b=zh8oMpmER/7AhDQS/TKhg64W6fCfom1A+yKLctJ++1vZv7odX0OCjjo6RBuA5spGA2 rQ0SqahT+cQiwmESljWq25ETRHICvhvibeVLDTm73Rz2cofmFSOQR9OZJuBQVciJVHKL FNEoTZrtZ1ir8rXh9nn2arldQbLf+3qrrRvmjzPNdUlfXYIS4obxuEqzfQOnIFTmOx9F VCl/8QT1o9Q+hEgmX0BceillAYpkfnlk8dCR8KlK0vYqUBUmlYFOYkGK6eeG1r0IpIcE Nj/BjREz5CovYijiTHD1IkyFmSpCsfW/T7+x7kJIl6UhC4FMAHAd3WJm4juwWCKIbSgw 8HSg== ARC-Authentication-Results: i=1; mx.google.com; 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 v23si2044403pfk.116.2018.04.10.05.15.32; Tue, 10 Apr 2018 05:16: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; 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 S1752892AbeDJMHq (ORCPT + 99 others); Tue, 10 Apr 2018 08:07:46 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53617 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752408AbeDJMHo (ORCPT ); Tue, 10 Apr 2018 08:07:44 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1f5s3g-0000PW-P4; Tue, 10 Apr 2018 14:07:32 +0200 Date: Tue, 10 Apr 2018 14:07:32 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: yuankuiz@codeaurora.org, "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 In-Reply-To: <20180410112637.GD4082@hirez.programming.kicks-ass.net> Message-ID: References: <891d4f632fbff5052e11f2d0b6fac35d@codeaurora.org> <20180410112637.GD4082@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Apr 2018, Peter Zijlstra wrote: > 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? Sure, if you do: > > > > > > + bool tick_stopped : 1; which is stupidly allowed by the standard....