Received: by 10.213.65.68 with SMTP id h4csp351619imn; Fri, 6 Apr 2018 01:00:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Ok4WvzOMCfDHwSKhLwXKwyHSODDOTWxB8ObZ9wS7B3UsxPaNpNlYUJ/9jN7QpytXu7qQ/ X-Received: by 10.99.66.197 with SMTP id p188mr7065291pga.28.1523001640555; Fri, 06 Apr 2018 01:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523001640; cv=none; d=google.com; s=arc-20160816; b=b5aIfsspOS+KeINaIJ6qufvxH582AHG1D2fmDGw1BKcSKiG3Gf7hPTdA0Ku6QsQxwJ PgmnzAq/4gla3avmM1qiaiMW9ty1knVD69FCjvFqqM1M/kGfRjWz1b1lSF8IC02mfpuR xhkdVclsV/TQNttI9ESS/mJPjhlkqPA052z4IZeuTaIvoEbyfumEDGFShTyMTeTd3vOU jEdTyPH3Dcas6RVaIT/VA74X3clDkehjDvF+ubPYHfKa6sByg3AZOuTXSGNjMDKVLu1j nlQl4B283LYCRDilZg9stIaNcHKTilcEvV06I+aLDEs9dM0qaAA76cVtYapjHB57lQXn e0PA== 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:dkim-signature:arc-authentication-results; bh=FeEbjGbgG0EjK+fHp1H9STV8GxF9p6GxCuNU+m5mIsg=; b=Z2CX7oGKwfQfoXs/MEX9uJ+7APehszCp9RvWtDPuFEIcQiyz8Ru6UILos3N0F5jD+M t3Pn7Bmx4pnpzrBaTvbC1I8jdlr8rYYXYx2obyGYkG1l5eIQ+0SjjDNbFmC2H70hvmkq 0fBv8qNTkYehYY7KkxTIKE4sIIzDHutKL6Studio8/jgHElrIbzAObjzy9yS/yBn/ABz VRlXVBD7MTBcV9pFpXQQvcO2zQIFGGTq2HTFSmOQclZ+xUqk7R+0UdgIHI9nomTcJNix sscRJ009kYsubBv4PbjWnKJ5WIaXAEMI3mXm2trfFTE638cmFHYG41sifOoCCmrwmSTV UFFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=dQJ0VLz+; 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 w2si6768096pgt.485.2018.04.06.01.00.26; Fri, 06 Apr 2018 01:00: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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=dQJ0VLz+; 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 S1751982AbeDFH7M (ORCPT + 99 others); Fri, 6 Apr 2018 03:59:12 -0400 Received: from merlin.infradead.org ([205.233.59.134]:34922 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751461AbeDFH7L (ORCPT ); Fri, 6 Apr 2018 03:59:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FeEbjGbgG0EjK+fHp1H9STV8GxF9p6GxCuNU+m5mIsg=; b=dQJ0VLz+UQtSvqXXXQ5yuJDq+ tO6WhpbMS8fOAND+mB2nDAL+sZZ0vgictM3I6YA671/Sl4szggKNLR5D+wsJetJjJiPOc8ha6jSzA 4Hg7ospu54RUnfxkO2jSDs0horADhx0NVjC0aEGrEbhZr7wurCaHwHNsv3zO0WEs+Rfkstvq3e4a2 fQOjhJrt6TMk+jIZ28vJkiMFB57TKPOnZTcXwBl0qE+zTpZt08Kvn8AJPdnQtuYdVZJCplfVNs9MU mXkea+A6IDjKGTozkuXiTBJzEuicw2ZD//L9l400rO8y++C0NNev0IHu9+H2lazXwARUmRxv5tUGT IJM7rMihg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f4MGe-0006B4-UW; Fri, 06 Apr 2018 07:58:41 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D19E620298CF9; Fri, 6 Apr 2018 09:58:37 +0200 (CEST) Date: Fri, 6 Apr 2018 09:58:37 +0200 From: Peter Zijlstra To: Frederic Weisbecker 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: <20180406075837.GH4082@hirez.programming.kicks-ass.net> References: <1736751.LdhZHb50jq@aspire.rjw.lan> <5818594.T4StF86Hkt@aspire.rjw.lan> <20180406024413.GB4400@lerouge> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180406024413.GB4400@lerouge> User-Agent: Mutt/1.9.3 (2018-01-21) 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 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.