Received: by 10.213.65.68 with SMTP id h4csp695147imn; Fri, 6 Apr 2018 07:25:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+KPxLW/K1Aqtd9YOONRp2Min0Xmky1XbBLTclAi64kLQyVDkFWQ3qXrvSlSAYAqxnVPCKR X-Received: by 10.98.223.149 with SMTP id d21mr20520283pfl.160.1523024727093; Fri, 06 Apr 2018 07:25:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523024727; cv=none; d=google.com; s=arc-20160816; b=cbejmJ48hTawY72zepa9TEUhDsn2yzmRLygYLxBBsskJzVJEx1e8GLUBZeehd/aguC a9iZH8v6Ahx00M6c4vSl2Iczh2FjMI1ZLVARgb2TzAfzoRSTh3jyHC2seySed9U33E2Q e0CsF0UpY1RlJrlPrW48tyl5EKItFdmYadhguNLT/SJoOszol96+/v6dZMb9z3zJAR+5 xk9hug560VK1DbFXdwRNELBYirDKFAHb/9vXiP9QPej0leRno+3u/tSE0gvpiALFPBZK R7u8a+5vhKQuDuQmqLSWs9fXn9G95mnFHswdL3hGZFuJZ5pSaSb/eA+vw/QBD0O9bltc j/9Q== 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:dmarc-filter:arc-authentication-results; bh=w5NAlHXk+n+iU0TW728yroH8rAdum1/15Yr6zeKi/QQ=; b=GgroGjo5JbvPLuorWR5FdpvVWBc8wElX3l/9NLVmlPUa8TMp2xnNra8SkcctP/rzGa MX4cqhwDSCisLBNx9asqjW3so1BM9MDDOvrmk5VAnXLugOPy2kyy3iApA6chnUm8d896 v3lV+7ZxTkwInNSYdZ3qyBoDZGEl0u/SKPUCuedWXJsMZv+eQI3lOTqcSEBS/M0g8lnn Ylo9bilGE65J08cBi4yweyIuvM4QLRJtCjYVJZBRwD8FtNRrzuzU7xBneX+L85CXhPMD gGbJIagMk6Imp9n/6I9PYKE4KcFByO9hqMtLP+rfEUuGkqXkev+JDOjoo/3+wg3Y5Yx8 8cPw== 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 q29si8060055pfd.240.2018.04.06.07.25.13; Fri, 06 Apr 2018 07:25:27 -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 S1756030AbeDFOYD (ORCPT + 99 others); Fri, 6 Apr 2018 10:24:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:56654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752925AbeDFOX7 (ORCPT ); Fri, 6 Apr 2018 10:23:59 -0400 Received: from localhost (LFbn-NCY-1-193-82.w83-194.abo.wanadoo.fr [83.194.41.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AFA92217CE; Fri, 6 Apr 2018 14:23:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFA92217CE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=frederic@kernel.org Date: Fri, 6 Apr 2018 16:23:56 +0200 From: Frederic Weisbecker To: Peter Zijlstra Cc: "Rafael J. Wysocki" , Linux PM , Frederic Weisbecker , Thomas Gleixner , Paul McKenney , Thomas Ilsche , Doug Smythies , Rik van Riel , Aubrey Li , Mike Galbraith , LKML , Len Brown Subject: Re: [PATCH v9 05/10] cpuidle: Return nohz hint from cpuidle_select() Message-ID: <20180406142355.GD4400@lerouge> References: <1736751.LdhZHb50jq@aspire.rjw.lan> <5818594.T4StF86Hkt@aspire.rjw.lan> <20180406024413.GB4400@lerouge> <20180406075837.GH4082@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180406075837.GH4082@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 06, 2018 at 09:58:37AM +0200, Peter Zijlstra wrote: > On Fri, Apr 06, 2018 at 04:44:14AM +0200, Frederic Weisbecker wrote: > > You can move that to tick_sched_do_timer() to avoid code duplication. > > I expect the reason I didn't was that it didn't have @ts, but that's > easily fixable. > > > Also these constants are very opaque. And even with proper symbols it wouldn't look > > right to extend ts->inidle that way. > > > > Perhaps you should add a field such as ts->got_idle_tick under the boolean fields > > after the below patch: > > > @@ -45,14 +45,17 @@ struct tick_sched { > > struct hrtimer sched_timer; > > unsigned long check_clocks; > > enum tick_nohz_mode nohz_mode; > > + > > + unsigned int inidle : 1; > > + unsigned int tick_stopped : 1; > > + unsigned int idle_active : 1; > > + unsigned int do_timer_last : 1; > > That would generate worse code, but yes, the C might be prettier. Well, not too bad I think. MOV become OR/AND, the rest is just TESTs...