Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4534imm; Tue, 14 Aug 2018 12:53:03 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwNIhShBb1I6wbI6HUaI5azWMLmkNHOPBY7dOkhEoDaQE5eeNBAto7HYHzPl9OWogH4QCWr X-Received: by 2002:a63:7007:: with SMTP id l7-v6mr22277431pgc.206.1534276383315; Tue, 14 Aug 2018 12:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534276383; cv=none; d=google.com; s=arc-20160816; b=Z1b6uCcO2ckPJCq4w8AafzQsL2vVsyoVvWadqZb7BV7A9sWtSsAyScCuv8wkqksMSe rYECmiX6j0chkgXUdD8Wu79FL4tWXjBr67oZnY9i3nEyLPlhSF/se/cBtc1XeY4O7Ssh Ksig12cUYsmYISf6BjlGFkmtJdZuf1eHxK7gEsYX5bj4c87X0fYK3TYE0NJtXhzodBQr YXX6DO4kTf+2WIXo/h8NU+BSKJ9vkV3FLQ/ynqnQbeXy0wkZqA4umNWmRKYxO+maDsSZ hyM3xbb55nAgsldELN3UGbxXt2V/aJwzSiRJ+cQjlOLxGKrwzOhn4J8tRC2VFnp2zHg4 o/hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=EqfdEHqwOfdx5CiM/mdIlydr86iHsM2yHx+MmXbqfSU=; b=Hw1/FVbkqiK7pFppHf6JDGDwD4BnaS56X/CAC52NVdW1dHPwZFDq4whYWMnRfo0c0d 3lSGX3UiAH7/gwKW7CoN2XZZWf5f6rkYcidJXQWc+5sC0N4K3srEm/WyhsDWdAmq3bOC MsWBPD7tBip2+yUTM/LFyRG3CrsnrhcR17B5eD8n0SmZZ39+LQMbPZI13lW34dBr8jvb AQHomL9bQgSoCvbaABFtq/l8p6QKeHjzdJUmlY3ZSlCDBwY4w494YCd+FlbRV1QxpVGs hfTderuswfzTfjB11wGKIwhTkZ6v8HyHKhTQr2U9JIccmKyC/udWyAI0NfAIEqqdOHzg Oz6g== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v71-v6si24636636pfj.354.2018.08.14.12.52.47; Tue, 14 Aug 2018 12:53:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729157AbeHNWki (ORCPT + 99 others); Tue, 14 Aug 2018 18:40:38 -0400 Received: from mga02.intel.com ([134.134.136.20]:40043 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727982AbeHNWki (ORCPT ); Tue, 14 Aug 2018 18:40:38 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2018 12:51:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,239,1531810800"; d="scan'208";a="80279867" Received: from ssarabia-mobl7.amr.corp.intel.com ([10.24.10.183]) by fmsmga004.fm.intel.com with ESMTP; 14 Aug 2018 12:51:52 -0700 Date: Tue, 14 Aug 2018 12:51:52 -0700 From: Solio Sarabia To: mingo@kernel.org, peterz@infradead.org, frederick@kernel.org, tj@kernel.org, wanpeng.li@hotmail.com Cc: linux-kernel@vger.kernel.org, ak@linux.intel.com, shiny.sebastian@intel.com, amy.l.leeland@intel.com, jun.nakajima@intel.com, sainath.grandhi@intel.com Subject: Time accounting difference under high IO interrupts Message-ID: <20180814195102.GA8568@ssarabia-MOBL7.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Under high IO activity (storage or network), the kernel is not accounting some cpu cycles, comparing sar vs emon (tool that accesses hw pmu directly). The difference is higher on cores that spend most time on idle state and are constantly waking up to handle interrupts. It happens even with fine IRQ time accounting enabled (CONFIG_IRQ_TIME_ACCOUNTING). After playing with timer subsytem options (periodick ticks, idle tickless, full tickless), time and stats accounting, and jiffie values, the issue persists. Cycles lost are not accounted on other cores as 'extra' util. Example with linux 4.15.18 baremetal, xeon v4 broadwell, driving network traffic: sar emon emon-sar intrs/sec core12 5.00 11.70 6.70 29,302 core17 19.07 23.16 4.09 17,345 core20 19.41 23.11 3.70 16,578 Based on how kernel accounts time: Do you have an idea why a high number of intrs affect time accounting? Thanks, -Solio