Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2230469ybx; Fri, 8 Nov 2019 01:46:25 -0800 (PST) X-Google-Smtp-Source: APXvYqwS+5RdE6i3sfFfeKmwEtG7tVMG8kYdMvbd/ICJfM2FtgsVA/tRJmSvmdeFZ35fqPkwvwEJ X-Received: by 2002:aa7:cad0:: with SMTP id l16mr9144720edt.82.1573206384893; Fri, 08 Nov 2019 01:46:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573206384; cv=none; d=google.com; s=arc-20160816; b=Ww0tvx2wrhHl81YetUbgJHg0U/6yYq5BVoUzk6ueOvqvKB5uP1j0jVuaMoynZtVP2K YjQ8aNkigvh6Br9dkZaC5u4K4Ir0UX/IT0q4SfmdqLMDTyVlxrSmA+PqSAcM8AbUg4V6 2bVIUeNFgLFWIpOLQblQrBq+J/dtx4kOi28rh6RqUqrhm0T7iGVj4Yj3kSakHAaRQN7h Kn0kkdnt1JavAPDB2OepVl9ZtwSX6vUSh4QRnpbj2gE4dMPVPcP/HM5XUq5S/TN8Owi4 0/3ZVwA+bPU6NEcUZX3wMn3KbSAIZlaZixkQnCgQXOACzlGf4TkWf/uqR+evSFh4tDxO UixA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=2UcYEqpXM4Ks5cSeDXBgcT+UaloVWs40SjYreEdd2/E=; b=sMMPGYO7DeiBMHxhvkaXql9RmvxNkAx9rY1szxJ7GPcLPbViKSSgTY6i8HD27H3+Hy tSWwEFzsyQRxmGTQF20S/dHBa6iMFlCXDs3PqdRFqNzsKK160gDStaHoWnrdgceeBVGU 9GN59pKS+nq4UTFaA13hQtFUi6Id+LjJbNcp/8aMWRP7BQTjjOA1DlcpKpAoUT8S0thL wgk2/RA+l3+g1l0BzHt5r4bhHgO1Z74McTAL+Jj2r+IOuPfuSpwJzVks7yIHPPDEZBDm EXvdR0zvT+IK7YRCFN5iNdUnUv+ATA/GOG625fXiBTEmUoG9KO6i29absqWcKVC5ND18 Sj1A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h56si3261244eda.356.2019.11.08.01.46.00; Fri, 08 Nov 2019 01:46:24 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730907AbfKHJpS (ORCPT + 99 others); Fri, 8 Nov 2019 04:45:18 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:44062 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730069AbfKHJpS (ORCPT ); Fri, 8 Nov 2019 04:45:18 -0500 Received: by mail-oi1-f195.google.com with SMTP id s71so4683939oih.11; Fri, 08 Nov 2019 01:45:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2UcYEqpXM4Ks5cSeDXBgcT+UaloVWs40SjYreEdd2/E=; b=eOeheU5Y+zTGOcagb5GAR6eBrbWUVjyYDLhBA5gs7wKhGjEtVoE/h+5lToDnmximL0 +UaXOdrCXR2ee5qecn5o7AP7rkHvzvbWT5fLDc8dB8m9s9ixKLk9eEmiF+LwOW3FNjhP UK7YxckIwB4+XieYMA2VVL3OzXopD7WxcgAJgE1iPYKt0U9/LvWIgtpojh/L75ClP18K vxUHqx8u2AkGY6LsrjmpXGKKx+pjcnBWDEuI8T6R0AAa13Tvtmxa555p1cqkHjJbbAFN cDwyt0XKAC86qJxjHIKK7FNTm53ke59x5VlcP/JFU6csT7rq6o43a+22hxfnnbKIcyrk cQfA== X-Gm-Message-State: APjAAAXFQjwOu4+hRXrXOPi0m0DooRvpbdZizc8QTQ6oiOeIa1N+tw4d 2XJ2QD/qT85Vid64bIHOTx5vffs4MoxNHvW5sD4= X-Received: by 2002:a05:6808:8c5:: with SMTP id k5mr8874416oij.57.1573206315744; Fri, 08 Nov 2019 01:45:15 -0800 (PST) MIME-Version: 1.0 References: <10494959.bKODIZ00nm@kreacher> <3269796.AzLOQfDnpo@kreacher> <000701d59610$e0b3caa0$a21b5fe0$@net> In-Reply-To: <000701d59610$e0b3caa0$a21b5fe0$@net> From: "Rafael J. Wysocki" Date: Fri, 8 Nov 2019 10:45:03 +0100 Message-ID: Subject: Re: [PATCH v2] cpuidle: Use nanoseconds as the unit of time To: Doug Smythies Cc: "Rafael J. Wysocki" , Peter Zijlstra , Daniel Lezcano , LKML , Giovanni Gherdovich , "Rafael J. Wysocki" , Linux PM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 8, 2019 at 9:45 AM Doug Smythies wrote: > > On 2019.11.07 17:44 Rafael J. Wysocki wrote: > > On Thu, Nov 7, 2019 at 3:25 PM Rafael J. Wysocki wrote: > >> > >> From: Rafael J. Wysocki > >> > >> Currently, the cpuidle subsystem uses microseconds as the unit of > >> time which (among other things) causes the idle loop to incur some > >> integer division overhead for no clear benefit. > >> > >> In order to allow cpuidle to measure time in nanoseconds, add two > >> additional fields, exit_latency_ns and target_residency_ns, to > >> represent the exit latency and target residency of an idle state > >> in nanoseconds, respectively, to struct cpuidle_state_usage and > >> initialize them with the help of the corresponding values in > >> microseconds provided by drivers. In addition to that, change > >> cpuidle_governor_latency_req() to return the idle state exit > >> latency constraint in nanoseconds. > >> > >> With that, meeasure idle state residency (last_residency_ns in > >> struct cpuidle_device and time_ns in struct cpuidle_driver) in > >> nanoseconds and update the cpuidle core and governors accordingly. > >> > >> However, the menu governor still computes typical intervals in > >> microseconds to avoid integer overflows. > > > > Since this addresses all of the comments received by the RFC version > > that was posted over a month ago and I don't see any more issues with > > it, I'm tempted to simply queue it up for 5.5 unless somebody sees a > > good enough reason why that would be a bad idea. > > Could I please have another day or two? Sure, it won't go straight into linux-next anyway. :-) > I did try the RFC version, but not much as I went off on those > teo issues and backtracked pretty quickly. > > I have been running this v2 today, with both menu and teo > governors. Acquiring some baseline reference data to compare > to now. The menu governor response seems different (Supporting > information/graphs will come later). That may be good or bad, depending in what way it is different. :-) > teo just started. > > I lost a bunch of time due to being somewhat linux-next challenged. No worries, please take your time! I very much appreciate the testing work you are doing. Cheers!