From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03AC9FC6182 for ; Fri, 14 Sep 2018 12:41:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A646E20881 for ; Fri, 14 Sep 2018 12:41:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A646E20881 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728095AbeINR4E (ORCPT ); Fri, 14 Sep 2018 13:56:04 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:49545 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbeINR4D (ORCPT ); Fri, 14 Sep 2018 13:56:03 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1g0nPo-0005lb-DC; Fri, 14 Sep 2018 14:41:40 +0200 Date: Fri, 14 Sep 2018 14:41:40 +0200 (CEST) From: Thomas Gleixner To: "Rafael J. Wysocki" cc: mika.penttila@nextfour.com, "Rafael J. Wysocki" , Linux PM , ACPI Devel Maling List , Linux Kernel Mailing List , Mika Westerberg , Peter Zijlstra , Srinivas Pandruvada , Vitaly Kuznetsov Subject: Re: [PATCH] PM / suspend: Count suspend-to-idle loop as sleep time In-Reply-To: Message-ID: References: <9611469.2z7W9akjOQ@aspire.rjw.lan> <767e9ec4-cc35-9255-360a-4d12736aa4de@nextfour.com> <1831106.CYv9dyYV15@aspire.rjw.lan> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1763824608-1536928900=:10480" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1763824608-1536928900=:10480 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Fri, 14 Sep 2018, Rafael J. Wysocki wrote: > On Fri, Sep 14, 2018 at 11:53 AM Mika Penttilä > > >> But doesn't injecting sleep time here make monotonic clock too large > > >> by the amount of sleeptime? tick_freeze() / tick_unfreeze() already > > >> injects the sleeptime (otherwise delta would be 0). > > > > > > > > > No, it doesn't. > > > > > > The delta here is the extra time taken by the loop which hasn't been counted > > > as sleep time yet. > > > > I said incorrectly monotonic clock, but > > timekeeping_inject_sleeptime64() forwards the wall time, by the amount > > of delta. Why wouldn't some other cpu update xtime when one cpu is in > > the loop? And if all cpus enter s2idle, tick_unfreeze() injects > > sleeptime. My point is that this extra injection makes wall time wrong, > > no? > > OK, you're right. I got that the other way around. > > So, the patch is withdrawn. I just tried to wrap my brain around that whole thing and utterly failed, so I can't give any recommendations right now. Rafael, could you please enable some lightweight instrumentation which lets me see the longer sequence of events which are leading to this or tell me what I need to do to reproduce that myself? Thanks, tglx --8323329-1763824608-1536928900=:10480--