Received: by 10.213.65.68 with SMTP id h4csp3585726imn; Tue, 10 Apr 2018 01:04:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/HxC2dQr92QZSL8Xi8jWMvWt+hbBZdbKq3flkkOC/1hLK08+OC3WI3MzP8kZ+usk+kR4AZ X-Received: by 10.98.152.217 with SMTP id d86mr1939438pfk.18.1523347473859; Tue, 10 Apr 2018 01:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523347473; cv=none; d=google.com; s=arc-20160816; b=PsJNvPjLfZMVzT5xrddlZrMIk/yOU1BkEuRmadeAkOJuh/BxaJJIoMo0hC1eg4IPM8 qwtZKWsclx2F2xgl3KrEGcdcFO8jIejsotp/oIXy9/0nXbEgPCtQwaBST6/rylhnNymZ NqRgH6VsLspE2DWjvBve9Vj7hRGSgCqLRnH9aRRLr/rKAKMlrzpRDUIdGeKJe/WwxLDG dv6nE72oGkWX80CiCX6NxacVIAvL2YKJaBP3lOEsuos6a1G9gbOcOhyD3TPVbkQp6SXl rUuvRNKgCQEmDB6skBcs/+x/jMxVJeDJIX+R4xQIEPsbdWPMP79h7mJxYWCiiuDd+YHQ h2Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=h1ywMhjFgOtfHXPJotPp/ATe+EC2IkCjgQjI0vHPAow=; b=m3D1TQULDnnq/Edys5jJXbXFj0Jt8Hr+QDXyncfjUHySOdlXXYlXPE6NxYQu0B2wbs FEz35lc7ZEeYnql7ueHPopNRNasa6W5EIjaT9eF64cFADh+zHIh93oZnYy9hEo7JipUl Rdj5DAXaPVlTejAU/2mrtY+IpUMZvyRMEy6bL8oVkjZA26ozKWi2VvXp/FNlT4NySiCh kLET19iEvKVVm8TPPifn4YHpXDLtzRgFQgxhEbxB6gVBhNGfSv9B7jbFmBqAQHKFccsQ M7A3gUWwfz64J8N/mI+aqZ0nW8r+suSmtGxjzxbJ2BQyG1lRarF6gan8TBwxzeSeCE9/ vt2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=PWRPct9x; 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 p12si1581882pff.280.2018.04.10.01.03.56; Tue, 10 Apr 2018 01:04:33 -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=@gmail.com header.s=20161025 header.b=PWRPct9x; 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 S1752415AbeDJIAD (ORCPT + 99 others); Tue, 10 Apr 2018 04:00:03 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:35750 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbeDJIAC (ORCPT ); Tue, 10 Apr 2018 04:00:02 -0400 Received: by mail-oi0-f67.google.com with SMTP id z8-v6so10282790oix.2; Tue, 10 Apr 2018 01:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=h1ywMhjFgOtfHXPJotPp/ATe+EC2IkCjgQjI0vHPAow=; b=PWRPct9xIkCT1Hmb0jwrCZt3SUyJau30gvi3LwSdjn/s+ZDSDR4V/byXm8To0dN9nk UWoYiAZL0nxgSW7LAqJhPFkD4aD+a0U+ZTFP3p+n4WMgtZ/X48sa1dJhrSU+KU8T85b4 KArUDuTmIb20IDB30M9YDC54ePkZPpSR+I/bPdyGg7nJAPgnpHfy1yTosaqTJUpOxg1Q nQZCCE7ICTTOsANvLV4Y7uxvNj5xGs4lzlj10hfeAyiVvzRSK88lmXPXfJIUz+ww5umT JloZMsDPWLv+0M30DRxkAduvtLxJTouNlbEp2xAGdkqowCnRanPBEXRHCM5sCC9i1Haq mESQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=h1ywMhjFgOtfHXPJotPp/ATe+EC2IkCjgQjI0vHPAow=; b=QFm7Q5bbb2k+3/TPIFWetjKZkKwwaZka3NrjKlRkcfHhbfuwmIL7vp9moC51WDQOJl ifzttBlsU7Q85oMeWPoD4w6ENNrnFO/JLtDP/0is9GG9SxJxslKlrWLsS02YeKbfEBM5 DgUwxwrYQp9djKgQ3jBEc8UtvAliVgbPqm8Hnx6c4iIBMTvqPWe8cJ92KaJQnNl1uHQn 8Xqgny3INxOJbw3bwAMlYele35hEAJePzHR4g/vJ09jrZPQEnzh9a3ijUIGrVVCDtSRT 6SUYdyVslrXdWKVlmwmVigsKv1Emz8J2/PJ6AOq3HN0OVhUH0QRrGawK8AV90upigKdm JSoA== X-Gm-Message-State: ALQs6tBf/BRpiHWpt765zW/bVHWrO+MJ1beJdN4IJhn+NQKup7xEs9JE +pldZtiVUX34QHo4QpZHTmnJdLyuQI5wFxEzA9M= X-Received: by 2002:aca:478a:: with SMTP id u132-v6mr1396536oia.227.1523347201466; Tue, 10 Apr 2018 01:00:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:9f7:0:0:0:0:0 with HTTP; Tue, 10 Apr 2018 01:00:01 -0700 (PDT) In-Reply-To: <891d4f632fbff5052e11f2d0b6fac35d@codeaurora.org> References: <891d4f632fbff5052e11f2d0b6fac35d@codeaurora.org> From: "Rafael J. Wysocki" Date: Tue, 10 Apr 2018 10:00:01 +0200 X-Google-Sender-Auth: b9ciASoCtUd7BuJ6c9PMwYuKnzY Message-ID: Subject: Re: Subject: [PATCH] [PATCH] time: tick-sched: use bool for tick_stopped To: yuankuiz@codeaurora.org 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 Content-Type: text/plain; charset="UTF-8" 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 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. Thanks!