Received: by 10.213.65.68 with SMTP id h4csp3694619imn; Tue, 10 Apr 2018 03:15:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+D/DjNuxliVPTrND5k6neSbbTeWKgXwgQgGtW50cnzDbuq48/k/nsS9fQEiz1tpZ2kMjj2 X-Received: by 10.99.146.83 with SMTP id s19mr6680985pgn.104.1523355301132; Tue, 10 Apr 2018 03:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523355301; cv=none; d=google.com; s=arc-20160816; b=o8bBxUzhmyYYg9zcKrMS4n/JbhkpOtrdLo7ihIFGQyBM8VI/orB5Lg2oX5sqBUk1Kf 712qSgg1N1fS1WkUfHkKozcB2+VZUhnXnusTPvn1Rm17iQzWB5lvgZX4Tj/0xZIeC7My xGCLm40Qdo4T1vEvRI6H+9IDFkRrYy4ba4ETgPd8jouPXcH7M40U7KREUOqgy6g6zIr3 jNdXG+qTB8b+cmm2qrAxha/0dqVcvEuHrL4I5N1WwOeCrWu9BuPYewv6YLmeAb7hNUfk 91YVe9d9R6sFaW+e+poL83SBauuXXV1/Z1WN3epwmf85kwueUPQEBq9SZ+JyEDEPDnwx v7Bg== 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=T9wV85ZujOQ+ZRKgiYeDJyZbeqr2x6NrpaDCM0gom1I=; b=u4POv+9LyKeXhPMTZ8fnyVlW0U+uhR5R1ew6J+Es/kr7i+Gg8JstJJjLhsV4r9JOXB db2xhLHFhu1HZ/irMRqus0d3nxHsaVsR8IEtAb6bAIExE1+xBNJOK5CE8fnLwdIjqen2 J0UhmvpjkecREGQzHvMWW1+el6kjEjvuERjHyV6Z//81pDGHgucxg4/YwIA0TkGaHQb3 pv8yG/x1ajhsQM+Ay/Vg6ASX8Hur9ViR5oRk/slk/uj/GGJ+d40UqD1wJZDovD1Wz43h FgPwAb0xIz+JeYycgm7o6oakM5ydgiMDTgHMWU9zSmGiEzxiKZwX1karMwjgbXIj5FN6 lKXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=YnwHdffV; dkim=pass header.i=@codeaurora.org header.s=default header.b=Ph6VDlgw; 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 w9-v6si2200461plp.304.2018.04.10.03.14.24; Tue, 10 Apr 2018 03:15:01 -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=YnwHdffV; dkim=pass header.i=@codeaurora.org header.s=default header.b=Ph6VDlgw; 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 S1752611AbeDJKHV (ORCPT + 99 others); Tue, 10 Apr 2018 06:07:21 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:34946 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752258AbeDJKHT (ORCPT ); Tue, 10 Apr 2018 06:07:19 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0F94460C64; Tue, 10 Apr 2018 10:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523354839; bh=mOIM4V/FWPmRvGPEgUdLMVZFa7SZvRLohfXz+2rESfE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YnwHdffVjEBjq1KROct54EgEIO9rHg/pPCqFovg+GS+0MrQvd8cX55NtebpIv5wI/ SDE1h1yHXxvA3e2Fmn314zgBPRwASyvKET8jCvla1AfdCa4MHTmz5jK4MUslc1Y79V teU+DM/74rHom9W5UUY4ltFTnbuWI0JdIC9wmaNM= 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 77A656079B; Tue, 10 Apr 2018 10:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523354837; bh=mOIM4V/FWPmRvGPEgUdLMVZFa7SZvRLohfXz+2rESfE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ph6VDlgwssB+gAhPyeHvaHVLZip2BbjBGFYL0qd/Da+92wQCf6DgmhQTbjVWco3tp l1ZSucTTyqE0XP10gZat7JyCGJftYZ1//pwDkP9Yv2fh5iQR2rVtKUAyZKg3dITwH+ gyRPiQWwI8wVWA7rxFpYd9e3zOXieestqNfB3KHs= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 10 Apr 2018 18:07:17 +0800 From: yuankuiz@codeaurora.org To: Thomas Gleixner Cc: "Rafael J. Wysocki" , Linux PM , "Rafael J. Wysocki" , Frederic Weisbecker , Peter Zijlstra , 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: 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 Hi Thomas, On 2018-04-10 05:10 PM, Thomas Gleixner wrote: > On Tue, 10 Apr 2018, yuankuiz@codeaurora.org wrote: >> 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 / false 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 unsigned 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". > > This patch falls into the case 'pointless' because it adds extra > storage [ZJ] 1 bit vs 1 bit. no more. > 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. > > Thanks, > > tglx