Received: by 10.213.65.68 with SMTP id h4csp3598025imn; Tue, 10 Apr 2018 01:19:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx48WGfH2J8h2d4PDLHUS3IbTCwzpaz+IFwiqq716C4c6AeoTf47WSHnzcd+fcw3+N2lJHJQ2 X-Received: by 10.98.163.68 with SMTP id s65mr1933544pfe.13.1523348380830; Tue, 10 Apr 2018 01:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523348380; cv=none; d=google.com; s=arc-20160816; b=LI2Hif10K//w8m2ECZE4pxzEJubFlEGPh2ZVni1DatCW0CL+OznATxz5TYkbXcuQ2w fxHz1YrMbWHGBYj38phiFJf4u35bgBG0x7ZNaKMTWORJ4bANjLuVVaco3EAHdIkrp1Bd yjWD7JrSDrkKu+c8ISMaEEObjWbdG6bkSY1j/1GdGSrEAph6POLdTim/kmKV1leCqvF/ meYFl7reLrEelUldvU5PlLY7Z/5aFH47+rvzbZKdXfdhTayxsg6oG6uDGZ6M9CBOn+U6 SA+bwqjKTznuiJfCP4Jl/JfmCvu1FQzaNU9aYi4B1aDKuec/dlCXoyk37ARsJ0NQGIcP fK6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=md/Hu0lXmYFvveToy5l0SJh0PSLHl2RUscFLz6ENwac=; b=bkx9NYuTwrbAbsMsqdIgNx3YUjDojk2mHYtA2XC+cGixDCVyZv1yMvsmPY2hlcA8t8 TUvJ/XW0xCLIkN/7YIXmtG/0XsD57/vrYVg+Bg+Sg1EsNToLgdZgIMMh4whMBFFPxXl0 UGO9lXw9jHhwB/ji6K/sp04mjQcb61k9ikSnH4grD5iwvpNxIQOtc+IXvdf53qQ4LhEo WTRnpfx5U8HC9U3ZjP7AGjKgKAX1BMhyt1Tp3G3fhNqOfeJBnRD2/2jSOiKrYHAKJaaC HBCondZ3vsNUjUJkdvl0LKU2YTLGuhHCyJPVCUks0rqVgSl5uVzCUrz2LrIJV5tXIXly xXRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZA9NYw5D; dkim=pass header.i=@codeaurora.org header.s=default header.b=JCoN0o0g; 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 m1si1448161pgq.211.2018.04.10.01.19.04; Tue, 10 Apr 2018 01:19:40 -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=pass header.i=@codeaurora.org header.s=default header.b=ZA9NYw5D; dkim=pass header.i=@codeaurora.org header.s=default header.b=JCoN0o0g; 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 S1752735AbeDJIPI (ORCPT + 99 others); Tue, 10 Apr 2018 04:15:08 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55272 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752697AbeDJIPG (ORCPT ); Tue, 10 Apr 2018 04:15:06 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C193B60F6C; Tue, 10 Apr 2018 08:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523348105; bh=4l8OaPiit9UKMObBHWDpli8Hr67Frbx7eGf8ad95N9Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZA9NYw5DJgQUuf7FGJFEhGj5qHsMkvMr7F/ub9jAbEVDeFNGY9D/yyD/KQINbJDHa 1o5yrBnK9RPnPdIe80eDO2+6yJ1rQ4ijVCTph97GNmuNaw8GWYnjqTJxjpovTfr7iQ sl4l43v5yTOs947PvwMACVCBT/lFOqr7ttVnFnQ4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id B67AD602B6; Tue, 10 Apr 2018 08:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523348104; bh=4l8OaPiit9UKMObBHWDpli8Hr67Frbx7eGf8ad95N9Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JCoN0o0g0uDnHTE5y1bTybKeALsoQxYOBQR2rpQDRAsmdNT71kULunY3TQ3agp98C QwtfzxrhPG6J1oSFOdFVU3e5isQkb/QnSJfpzg8KCnCQgtwj7JiZWF+ygN2R+sVBRt NZetX4OjbVuZVO//dnRZvqE/hsWtCm/uBBuwVLN4= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 10 Apr 2018 16:15:04 +0800 From: yuankuiz@codeaurora.org To: "Rafael J. Wysocki" Cc: Linux PM , "Rafael J. Wysocki" , Frederic Weisbecker , Peter Zijlstra , Thomas Gleixner , aulmck@linux.vnet.ibm.com, Ingo Molnar , Len Brown , Linux Kernel Mailing List , linux-pm-owner@vger.kernel.org Subject: Re: Subject: [PATCH] [PATCH] time: tick-sched: use bool for tick_stopped In-Reply-To: References: <891d4f632fbff5052e11f2d0b6fac35d@codeaurora.org> Message-ID: X-Sender: yuankuiz@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-04-10 04:00 PM, Rafael J. Wysocki wrote: > On Tue, Apr 10, 2018 at 9:33 AM, wrote: >> From: John Zhao >> >> Variable tick_stopped returned by tick_nohz_tick_stopped >> can have only true / forse values. Since the return type >> of the tick_nohz_tick_stopped is also bool, variable >> tick_stopped nice to have data type as bool in place of int. >> Moreover, the executed instructions cost could be minimal >> without potiential data type conversion. >> >> Signed-off-by: John Zhao >> --- >> kernel/time/tick-sched.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/time/tick-sched.h b/kernel/time/tick-sched.h >> index 6de959a..4d34309 100644 >> --- a/kernel/time/tick-sched.h >> +++ b/kernel/time/tick-sched.h >> @@ -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". > > Thanks!