Received: by 10.192.165.148 with SMTP id m20csp569493imm; Fri, 20 Apr 2018 11:22:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx493jPBRV2xv6/DFnJK3nWqMap2+iH7Gg5Q3K3pmCXeGEOAcgq3zVKoVLg/mZ4e1jRF/oQZu X-Received: by 10.101.75.74 with SMTP id k10mr7392384pgt.227.1524248543884; Fri, 20 Apr 2018 11:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524248543; cv=none; d=google.com; s=arc-20160816; b=bAUc9CCswjfRGZ+FL3OMrOBXzDXlDHavdPx1zYN8D+hrkUfhLBA8b1h9VtHnYzmWvX bUmAMowR8eM3vlswHJzRDmKueTYEJ4HlYVf/Aiq1qfP902Jk4+Ep0gLE58CBpBtkE+Mb 8UU8ed5UbD0mwtUfk/p13MA8v6kF7A+wnbKiLJAkZrmpuvffl7ZLWjacVpBypR525mA1 rtrYHwYYTyclLDbmwHmE/PZ+6xI+F5bV+ORCWKp5CjnvcN/8pbnM4qvDaqCj752la5/b IYe5nQzf1ifaTMvm9dr62D4ivwEu33nmq+RXT6AzETrW+VnyphsfjpEeh/XGodfRQZ76 Un/w== 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:dkim-signature :arc-authentication-results; bh=JNO6WMuefugrVSj9aRHYDcNnHYy74as3tc0jjqLfik0=; b=mFCVscuzhn2WxV5dOTMkrwBIWldbbFibo2lJdgsaTiN+cvuxFfUl/hMBPyj31Lz7q5 0O0B4ye8+DajKMjhqEDzZD8YraKp3eQ4XPcXl0qDQizzdI2eIN0GWbuu5iv73OOX+/2f +VxCTYS61K5E8llnbHf54p55CF5RlviRBIBIWal3xLBHi1qj8LypSCRds2S7bROMqSH1 DZVoAvgQmmytcN9T4I8QbbMOfZCawEEUV4uViLF1oLHSNyiOpWj/aAoJ2PH7E5ZuvyzZ jhNR9c0I6pldySaBGN1xw4uA+QDEe7+OTGt59XxwGbx0kh8Z+odPKULguBwj/cfcZmsb v+lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=e/fPv1OP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15si5969778pfh.281.2018.04.20.11.22.09; Fri, 20 Apr 2018 11:22:23 -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 header.i=@google.com header.s=20161025 header.b=e/fPv1OP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753911AbeDTSTa (ORCPT + 99 others); Fri, 20 Apr 2018 14:19:30 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:35848 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753566AbeDTST1 (ORCPT ); Fri, 20 Apr 2018 14:19:27 -0400 Received: by mail-wr0-f182.google.com with SMTP id m26-v6so7380145wrb.3 for ; Fri, 20 Apr 2018 11:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JNO6WMuefugrVSj9aRHYDcNnHYy74as3tc0jjqLfik0=; b=e/fPv1OPIFJ0JZrXODocxbcVwvE1kBbbycisxkM7dvYsq00SDvGAgwWDzfiHN+8sTV +kNAEM7xl86kofpxP0JEJ69sYyeswIiIKNAZxM/1UYzP7SNlDSNW5cMFv4gisaiM6tVb wezvyrc92dpMWJVi1eqHKQc0SoUely9II5QfdtfO4IwOwrzpLcFyuOLhUbM/CO9wxMG6 P/5aMOYK+mha40PZcbKs0Ae+bYpLGJOOsC1SFEHzNACKcHadwIsseJIwroDdvozMEYP8 kdRsuecWOlkAL9tKa4L05EJv+ZheQ5tWpM00Cg9KIHsjM941DjN561fipCPCqjSlCUIK btKQ== 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=JNO6WMuefugrVSj9aRHYDcNnHYy74as3tc0jjqLfik0=; b=f7BZve5x96tT1GSIMSX1EkJ67/hKHuEzkFAqgWbswf9q7JIwVB3InbNDfRDeI6iwvI 74zAOxByNRughZX18khWyieaVpjXPk0GE3Vxva6Y+G+MgUgtgBsbBQPfX3J3fzD46D+J Ynmpfe1y4LS1/tJl7B9KMXNm2lTJWt6WKq7yo5p48LSPMgSuKuQxibvF/S1rRh9Mwey2 zROCF0hzP+jY0hvYWqHsnDBcy5fk65VjvrMVwdLBUaGKSqNorf4rU6E9OPqNWr3qJ4KD x8abH0tx8i+rH9URBRruSNDcECYTxevdWB95GfZaPh4Ogg6Lgb1yLE/sxqZtV3wK31FB 6jLQ== X-Gm-Message-State: ALQs6tAVW3TeRtVhhxAY5I6vCwfZcDITlSoFp1+TVGSrA7Efpo4s10f8 k8oMu1PC6Vrj88zpEiBWGKviqpQx+xvefAAzpGd5Ag== X-Received: by 2002:adf:c412:: with SMTP id v18-v6mr5714758wrf.20.1524248365906; Fri, 20 Apr 2018 11:19:25 -0700 (PDT) MIME-Version: 1.0 References: <20180417062010.GA2052@krava> <20180420083607.GG4064@hirez.programming.kicks-ass.net> In-Reply-To: From: Stephane Eranian Date: Fri, 20 Apr 2018 18:19:13 +0000 Message-ID: Subject: Re: [RFC] perf/core: what is exclude_idle supposed to do To: Vince Weaver Cc: Peter Zijlstra , Jiri Olsa , LKML , Arnaldo Carvalho de Melo , mingo@elte.hu, Andi Kleen 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, Apr 20, 2018 at 9:51 AM Vince Weaver wrote: > On Fri, 20 Apr 2018, Vince Weaver wrote: > > > AFAICT it works on Power and possibly ARM. > > > > at least some ARMs are a bit more honest about it than x86 > > > > ivybridge: > > Performance counter stats for '/bin/ls': > > 1,368,162 instructions > > 1,368,162 instructions:I > > > > pi2/ARM cortex-A7 > > Performance counter stats for '/bin/ls': > > 1,910,083 instructions > > instructions:I > > > > I'd fire up my Power8 machine to see but not sure it's worth the hassle > > and/or having to get out the ear protection. > I did power up the Power8 machine in the end: > power8: > perf stat -e cycles,cycles:I sleep 5 > Performance counter stats for 'sleep 5': > 14,271,273 cycles > 14,271,273 cycles:I > ??? > But then if I try again on power8 > perf stat -a -e cycles,cycles:I sleep 5 > Performance counter stats for 'system wide': > 1,238,772,322,327 cycles > 1,238,674,771,713 cycles:I > there is a difference. > But then on ivybridge > perf stat -a -e cycles,cycles:I sleep 5 > Performance counter stats for 'system wide': > 589,598,104 cycles > 589,537,190 cycles:I This may be noise. The way the flag is named leads me to believe its goal is to not count when executing in the context of the idle task (pid 0 on each CPU). However, it does not seem to be implemented that way. If you were to implement this, then in system wide mode you'd have to check the incoming task on ctxsw, very much like we do in cgroup monitoring. So it would not be totally free. One can argue, in sampling mode you can eliminate the samples coming from PID=0 in the tool. But there would be nothing to cover counting mode. Interestingly, there is also code in perf tool to exclude known idle routines from reporting. But this is targeted to only some routines that the idle task may end up executing. so it is not quite the same. > So maybe exclude_idle does do something on x86? Or am I completely > misunderstanding what the flag is supposed to be indicating? > Vince