Received: by 10.213.65.68 with SMTP id h4csp589061imn; Tue, 20 Mar 2018 10:16:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELvKK9WUgtTkTeWmsCyXTjugt7unSsrFBywQ8gn60rCbSWMdyPaAjkBC3/mOIxqtr3JnQdSa X-Received: by 10.99.173.7 with SMTP id g7mr12506353pgf.160.1521566194478; Tue, 20 Mar 2018 10:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521566194; cv=none; d=google.com; s=arc-20160816; b=By6gV0c4T9Poj9aAFaERnkQwp+x6Nu0W7Pw93krEMVycKLwdqYTiZ/hB/77iVe8oIO A6GWokg/C/D6nb4FPRY6iyq+NkOW4cjEassDAVyK/xUMGl5mMFiCir/x4NngfrYxECgw dp53MICVNGAXZmNO0tpxTxeXJMeIyWOAyGFYdmBh/L3o6R/hdu98LmN9L2WoTducHX2Y XjS5wmVyZsC9F07VvmGiyGySTRwFkSw2X717Mv4xxORJdV2Ns7zO2V88512pPEmXzoRD gLCEI6ChCyHmGaXZsa7UOIZPoWgwIr5UtjbEB1RF2oYGHdwb4SnwSrxnht9g9B4hckdd +OaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:content-language :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dkim-signature :arc-authentication-results; bh=ZwPL5dxz6gIE4Ecl+5kBof6Xg5vTP9UUQNMJ0d8ATl4=; b=YTv5PI7yWEX7G+4MJd/MGDO9nGsWaYHtDILgF4iFaud/QHpO/9XlyZTmttGGfT7svB vkVMXbToxwol2V2UC3AALGsHaPI0CpZlxEMAQRpo8YNjXSZ2Bnc8Es5oaNtySZWg/wrh 8YMTsb/yCheG8N3WDhAxpZwjSD3np4sZ6t+vHEjV8+GBYjGW13AWp8IF121WQ06jGu+S jTUj7n+PAB12ka1UNrvBJ+cGpvS9FM2X+b7tsJ6LHkJOYYR9zWkoqQC+GV5OdZdfsWAe XlKAb+9L+UATqn9QjM+6WI1IOSSYsCv0vuxYBB15brFJxA8y/HpSudsq1RoJhLT6jfVA 9SNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@telus.net header.s=neo header.b=C4H+lkPo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a190si1431248pge.436.2018.03.20.10.16.19; Tue, 20 Mar 2018 10:16:34 -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=pass (test mode) header.i=@telus.net header.s=neo header.b=C4H+lkPo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751531AbeCTRPM (ORCPT + 99 others); Tue, 20 Mar 2018 13:15:12 -0400 Received: from cmta17.telus.net ([209.171.16.90]:33460 "EHLO cmta17.telus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbeCTRPJ (ORCPT ); Tue, 20 Mar 2018 13:15:09 -0400 Received: from dougxps ([173.180.45.4]) by cmsmtp with SMTP id yKqke0scJ4xyuyKqme68zv; Tue, 20 Mar 2018 11:15:08 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=neo; t=1521566108; bh=ZwPL5dxz6gIE4Ecl+5kBof6Xg5vTP9UUQNMJ0d8ATl4=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=C4H+lkPo6Q8Dc0APgnO20as5y244IRYD2GFjC+x4HRin3+BPCQU8aS29JLdBfV04p VPMBJGAy/ZOuSSUdZ2iW7Les6RZkZPNNF1d94dqWPNx7geGNKrdiTwGsbg8eMPpyPj 5qTNMSm8gEV4W6cSh06s1TwuLgqZ5nxrYZ+8N9pXe1ljdxdZF9e9Go+2LIM4oZETyL 2r4LEFsNv2fdzvHDowhZ7DRyNQ21Wu4qDEBL6wtHRCtfrZtOCGe09lDklGP0BMdAll Tk5QahBbEPxrVqlw27d3JJNRTAocCEVGP3S+ouMRCq1QuAc1RYfaBtzitmuCVul8V9 NK/Yj1M9oJMtQ== X-Authority-Analysis: v=2.2 cv=StJ/0LG0 c=1 sm=1 tr=0 a=zJWegnE7BH9C0Gl4FFgQyA==:117 a=zJWegnE7BH9C0Gl4FFgQyA==:17 a=Pyq9K9CWowscuQLKlpiwfMBGOR0=:19 a=IkcTkHD0fZMA:10 a=QyXUC8HyAAAA:8 a=gu6fZOg2AAAA:8 a=FGbulvE0AAAA:8 a=fGE89Ioile8RqVmjMi4A:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=QEXdDO2ut3YA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=2RSlZUUhi9gRBrsHwhhZ:22 a=svzTaB3SJmTkU8mK-ULk:22 From: "Doug Smythies" To: "'Thomas Ilsche'" Cc: "'Rafael J. Wysocki'" , "'Thomas Gleixner'" , "'Paul McKenney'" , "'Rik van Riel'" , "'Peter Zijlstra'" , "'Aubrey Li'" , "'Mike Galbraith'" , "'Frederic Weisbecker'" , "'LKML'" , "'Linux PM'" , "Doug Smythies" References: <2142751.3U6XgWyF8u@aspire.rjw.lan> <2148754.TY7qXgFyZy@aspire.rjw.lan> xuDHe5JrTQdbpxuDMeg0da xyzzeKNZFlebYxzQ2eVyR7 In-Reply-To: xyzzeKNZFlebYxzQ2eVyR7 Subject: RE: [RFT][PATCH v5 7/7] cpuidle: menu: Avoid selecting shallow states with stopped tick Date: Tue, 20 Mar 2018 10:15:02 -0700 Message-ID: <002401d3c06e$fed035b0$fc70a110$@net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-ca Thread-Index: AdO/gJrvyo9eKq4lRGmNVPItTw3wKgAFzGIQADG0igA= X-CMAE-Envelope: MS4wfM6C7lXCIdZGFJFLmC+XiTv4aWHwN9nAua6fiyRpRrSWJwgGTlulxN6RIAIQ3Bbp2jP45bJKeYHIz5Bhnog+5oEJBgoVeVfRnVTbMMmXZN/ayLiE5pbA 4u/Hh8GIJ04cisPMfe4TN/3LdvQtNSGrgqHwcmnkUoi28ryc2SB/T42bBy1wNADZBc+gdg8Q1vxg3FvcoHBWLp8hhRB4yXHLQe7D2PQxW8Qr52czeSc1HUY5 WxBtJGsJOfHJ7qaQYiSEvxVB0i6F+WVi+ts1dMqSO+fsOv7tZniOOe207reDPd6xVWj2tx2QLJPiHKuoYWZtV+aagpZqarKantA4jXg/lY4kpgL8LiUMRJmO JrFklXMQZ2ZmvJ1skaMwqDspxGFzKRwl3LGOJYMxoHo6p8i6YpW9ATmuMDiBJD/UiNsLm2XybSK7ZgygP/UR/vNIcY5usJbPEwuRSaHyxLnP56rZ6FZBu27N e7cpst2Yq0URdUWWviWUYu46QIFE8eWpfr0EZmypZ8U12aCqB9AQkCMlz6Q= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018.03.20 11:22 Doug Smythies wrote: > On 2018.03.19 05:47 Thomas Ilsche wrote: >> On 2018-03-15 23:19, Rafael J. Wysocki wrote: >>> From: Rafael J. Wysocki >>> >>> If the scheduler tick has been stopped already and the governor >>> selects a shallow idle state, the CPU can spend a long time in that >>> state if the selection is based on an inaccurate prediction of idle >>> time. That effect turns out to be noticeable, so it needs to be >>> mitigated. >> >> What are some common causes for that situation? >> How could I trigger this for testing? > > It appeared quite readily with my simple 100% load > on one CPU test. Back then (V3) there only 6 patches in the set, > and before the re-spin there ended up being a patch 7 of 6, which > made a significant difference in both package power and the > histograms of times in each idle state. > > Reference: > https://marc.info/?l=linux-pm&m=152075419526696&w=2 I made a kernel (4.16-rc5) with only patches 1 to 6 of 7 (V6) and also with the poll fix. I took an old graph: http://fast.smythies.com/rjwv3pp_100.png and removed an obsolete line and added a line from this kernel: http://fast.smythies.com/rjwv6m_100.png I also acquired a trace during the test and observe: Report: Summary: Idle State 0: Total Entries: 699 : PowerNightmares: 0 : Not PN time (seconds): 0.031169 : PN time: 0.000000 : Ratio: 0.000000 Idle State 1: Total Entries: 3855 : PowerNightmares: 106 : Not PN time (seconds): 0.123759 : PN time: 43.511914 : Ratio: 351.585856 Idle State 2: Total Entries: 3688 : PowerNightmares: 181 : Not PN time (seconds): 1.303237 : PN time: 63.241424 : Ratio: 48.526418 Idle State 3: Total Entries: 528 : PowerNightmares: 115 : Not PN time (seconds): 0.276290 : PN time: 44.764111 : Ratio: 162.018571 Where "PowerNightmare" is defined as spending excessive time in an idle state, and arbitrarily defined for my processor as: #define THRESHOLD_0 100 /* Idle state 0 PowerNightmare threshold in microseconds */ #define THRESHOLD_1 1000 /* Idle state 1 PowerNightmare threshold in microseconds */ #define THRESHOLD_2 2000 /* Idle state 2 PowerNightmare threshold in microseconds */ #define THRESHOLD_3 4000 /* Idle state 3 PowerNightmare threshold in microseconds */ While this trace file was only about 15 megabytes, I have several 10s of gigabytes of trace data for V4 + poll fix and never see any excessive time spent in any idle state. ... Doug