From patchwork Mon Jul 31 20:22:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 9873093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3DEC06038F for ; Mon, 31 Jul 2017 20:21:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DCCD285DE for ; Mon, 31 Jul 2017 20:21:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22B5A285E6; Mon, 31 Jul 2017 20:21:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2695285E3 for ; Mon, 31 Jul 2017 20:21:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=3So+GuKgmAc7IhCxUKzvnCwUCAx2UdKCP4tm7o1bb0w=; b=VAP MwlaYqXjVI96sHsxEO3tBnzR9CbTrnBxMKUZUttbLAguB+4a57FmX1Khz5vfjl05tQh+wbib2XlgR NeES/u/pmH/H7e0Smj0At8nyXVhGz3w+IL4evO/xqJ8SdPpiiY+XNyTZ1+JjKmpBGwnx2+W94InE7 CAX4gxxs2lXtIZcxsW2zgtsz6GSCg+Yrjaa1gqRQKEby1Q/oLIvdO55ejbLOnWcOzLBt3ddzZ30LM E5Sv0Hwuyf8MMXBB2/eQhp5beElWpF21YYxSyyR7dFSH+D6hofGEcKc3gl2zEAKn6WDrNPQXter1e sk9GwPNBKbSCPQ0b8081IJheVIjU8cw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dcHBz-0003FL-37; Mon, 31 Jul 2017 20:21:31 +0000 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dcHBa-0002xn-TB for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2017 20:21:08 +0000 Received: by mail-lf0-x230.google.com with SMTP id o85so58938683lff.3 for ; Mon, 31 Jul 2017 13:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=3FLoD81ofkMi3cNk9OK7F9cL1f4DVu8+UVkqHczfB4Y=; b=JlUag+LCU4I+9VAYadvIUhvybAPQFzdgFMAKS8+uYRkI3w0RbabpfUFp+GAW4zweyh XokZKr5mhq6cd0U9RjAg86bqT70isUJFTYTYKasKTBaU6HLUb+VpQUIj7+47hSeDcF2q lLZzWp73GPwokXQUWo7rljLh8Fq32WFEphC3o/4EoMb7gAVSKnOf6/RtSd5Fn2vIvebU Uto9JVEW/jSz7BNCRumZya9xaJ18DPIHmVJAgQxn6onm4d7HMXcsOcnU00FyuPIgs6ls D8/eVo908a+Fx5uBJHql8+M1Br6VPGoLc+gQiWLjJkmoqNgvpuqd1fpn/wTO0BYLRR6i g+WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3FLoD81ofkMi3cNk9OK7F9cL1f4DVu8+UVkqHczfB4Y=; b=Is4/e6uxrGJleiqUlnEoKDEYq1OLiBsOwH0UBP/M5lHWVOfndv6gFdhDdynACFwiNB 0D2s5I+S4duqn72hphn6aU7kkRQjWKs3HK2GmxhHmnuwN3CgbWj9LXt4xrCIjFMuZylt gBpa1NGOooWkuDZMfnrpjTy4u4d+RY1XeKyzzq2diZdA8gBbTDX3RjoOHakfJJFg7Dut PqXOIvfOyphMmdqB0RggdoY00l9t7MYd/IUxZqI8qmEm+PHns29kDtOzA+/dszoYXMUr f5HvxpXO/srmkYJDmiC14dNzYlWZXMEmswTrwDx6o+vNdexYAXbFPUKZz1TUmZsVv5Io ZsPQ== X-Gm-Message-State: AIVw112zwn8lFYruqBRl7VbpS5AhwRrBLwmqZLEdoNWeB7jR1KOOgmnE wz3UJl1VLA7d31F+ X-Received: by 10.25.213.83 with SMTP id m80mr5998376lfg.177.1501532443015; Mon, 31 Jul 2017 13:20:43 -0700 (PDT) Received: from enkidu.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id z1sm3625960lja.73.2017.07.31.13.20.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 13:20:40 -0700 (PDT) From: Marcin Wojtas To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: defconfig: enable fine-grained task level IRQ time accounting Date: Mon, 31 Jul 2017 22:22:11 +0200 Message-Id: <1501532531-4499-1-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170731_132107_162021_937E9683 X-CRM114-Status: GOOD ( 10.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thomas.petazzoni@free-electrons.com, andrew@lunn.ch, catalin.marinas@arm.com, will.deacon@arm.com, nadavh@marvell.com, neta@marvell.com, jaz@semihalf.com, gregory.clement@free-electrons.com, tn@semihalf.com, mw@semihalf.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Tests showed, that under certain conditions, the summary number of jiffies spent on softirq/idle, which are counted by system statistics can be even below 10% of expected value, resulting in false load presentation. The issue was observed on the quad-core Marvell Armada 8k SoC, whose two 10G ports were bound into L2 bridge. Load was controlled by bidirectional UDP traffic, produced by a packet generator. Under such condition, the dominant load is softirq. With 100% single CPU occupation or without any activity (all CPUs 100% idle), total number of jiffies is 10000 (2500 per each core) in 10s interval. Also with other kind of load this was true. However below a saturation threshold it was observed, that with CPU which was occupied almost by softirqs only, the statistic were awkward. See the mpstat output: CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle all 0.00 0.00 0.13 0.00 0.00 0.55 0.00 0.00 0.00 99.32 0 0.00 0.00 0.00 0.00 0.00 23.08 0.00 0.00 0.00 76.92 1 0.00 0.00 0.40 0.00 0.00 0.00 0.00 0.00 0.00 99.60 2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 Above would mean basically no total load, debug CPU0 occupied in 25%. Raw statistics, printed every 10s from /proc/stat unveiled a root cause - summary idle/softirq jiffies on loaded CPU were below 200, i.e. over 90% samples lost. All problems were gone after enabling fine granulity IRQ time accounting. This patch fixes possible wrong statistics processing by enabling CONFIG_IRQ_TIME_ACCOUNTING for arm64 platfroms, which is by default done on other architectures, e.g. x86 and arm. Tests showed no noticeable performance penalty, nor stability impact. Signed-off-by: Marcin Wojtas --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 44423e6..ed51ac6 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -3,6 +3,7 @@ CONFIG_POSIX_MQUEUE=y CONFIG_AUDIT=y CONFIG_NO_HZ_IDLE=y CONFIG_HIGH_RES_TIMERS=y +CONFIG_IRQ_TIME_ACCOUNTING=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y