Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp464920ybh; Wed, 18 Mar 2020 03:17:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuyJ7iDgn5Ky+QWjMrGAGkv2JbLCFqGLxkDB5WVxW4sARNrvD1YdpIfAhP2sAPy8glJyS5s X-Received: by 2002:a9d:7d89:: with SMTP id j9mr2954526otn.47.1584526667990; Wed, 18 Mar 2020 03:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584526667; cv=none; d=google.com; s=arc-20160816; b=b2MJmvzoLf3CfOHNqmbWsvu08aVpmn7rTF4WXhMYb/cEOfP4r66/xyHLWkjFY2YtOy RQ6uzYjS7QI0Is54IrU8mebVbhBpJKC7dIPMxBL0joEu7rGBPaRUtIy+/qqmS6P/p/Yn dk0QKA5i36qYjliGJgkKw1rlZ9gOQcHlCRpN6a1F6c5tHCLCmPWLewJv2t/U2drNHgmB rJOSchfQJ+OxexkpxmOgVJOYY9n2R5m97q30nK98qbbg7hEB1JO0m12pFc8dawZmp0Bh It5/spqteQGgAryHywhkIjDdR9YQv5EIWJQBKLrP1QkPRem2ofaM0qgxC8A/2JEkvp8Y CvfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kxNRhDfgj70EWdmDcemrmjDRcudjEgHApFfQn6B57tU=; b=QZZYolUnyJCJ4/sykM+cr6RWI1Op5zIcWaxEK2eE6TmvZStA9haSwCVL7FDJNrw8Tn XeMXzpXIhFWNYaCrsftva1hqPuTloigFQJIFLUIkeNmt1Mm7RV8Flp9jOgaD5R0QA0Ah 17YEq3IkoODmZI47/9W7HrFbeqU+62J8trtxnAe8tvof9yK0sNI622HIWZEgJrYXNRQA 1DO+5O0cHRcOnFTzYtV8DGI75Ykpj7ltVzHBK9rXgZPHckFo1E0ZrwyQA/2FDVb+n09Y caa9GFOaAMa84CPh//K4nTPwB2OnO257rcCXD/twi0PwrNAj5HkqRkmm3cIe433ZVO/B 0YYg== 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 h23si3604001otk.315.2020.03.18.03.17.36; Wed, 18 Mar 2020 03:17:47 -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 S1727355AbgCRKRP (ORCPT + 99 others); Wed, 18 Mar 2020 06:17:15 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:41884 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbgCRKRP (ORCPT ); Wed, 18 Mar 2020 06:17:15 -0400 Received: from 185.80.35.16 (185.80.35.16) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id 8f5f7f5efe089b69; Wed, 18 Mar 2020 11:17:12 +0100 From: "Rafael J. Wysocki" To: Daniel Lezcano Cc: ulf.hansson@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@kernel.org Subject: Re: [PATCH RFC] cpuidle: consolidate calls to time capture Date: Wed, 18 Mar 2020 11:17:12 +0100 Message-ID: <2605374.f08NWHE4iP@kreacher> In-Reply-To: <20200316210843.11678-1-daniel.lezcano@linaro.org> References: <20200316210843.11678-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, March 16, 2020 10:08:43 PM CET Daniel Lezcano wrote: > A few years ago, we changed the code in cpuidle to replace ktime_get() > by a local_clock() to get rid of potential seq lock in the path and an > extra latency. > > Meanwhile, the code evolved and we are getting the time in some other > places like the power domain governor and in the future break even > deadline proposal. Hmm? Have any patches been posted for that? > Unfortunately, as the time must be compared across the CPU, we have no > other option than using the ktime_get() again. Hopefully, we can > factor out all the calls to local_clock() and ktime_get() into a > single one when the CPU is entering idle as the value will be reuse in > different places. So there are cases in which it is not necessary to synchronize the time between CPUs and those would take the overhead unnecessarily. This change looks premature to me at least. Thanks!