From patchwork Fri Sep 21 09:38:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 10609441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EB1B14DA for ; Fri, 21 Sep 2018 09:39:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EC3C2D8AC for ; Fri, 21 Sep 2018 09:39:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42BCD2D8CA; Fri, 21 Sep 2018 09:39:37 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30B962D8AC for ; Fri, 21 Sep 2018 09:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389434AbeIUP1g (ORCPT ); Fri, 21 Sep 2018 11:27:36 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:50831 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389264AbeIUP1f (ORCPT ); Fri, 21 Sep 2018 11:27:35 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180921093933euoutp02af40a42f69f6f6d819532816ee7137e3~WYNDucog60109301093euoutp02t for ; Fri, 21 Sep 2018 09:39:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180921093933euoutp02af40a42f69f6f6d819532816ee7137e3~WYNDucog60109301093euoutp02t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537522773; bh=IJgzdQ5LP5QPevSzk9/Ti60TEZjw0cyEj0If0bcnbZY=; h=From:To:Cc:Subject:Date:References:From; b=Uxjij8nXUQH5B/+eoCeILDCxxwrBsVuXny6aGrjnsN5SMJwfhXazy+ZCfgP8tdfx8 t1H4MqVZ4VykTqEl1GiGOOIAg+dMhjwFwIAt9kL6iSk9ri03gKHnh7u6DErYejZp2a YxDvDgU3ly5gJxlgg01UPsEpZ7PCIdpBiqAOB61A= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180921093932eucas1p2b9d566480c906b8767ed6d41215669d6~WYNDO4VXP3111831118eucas1p24; Fri, 21 Sep 2018 09:39:32 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 4D.26.04806.45CB4AB5; Fri, 21 Sep 2018 10:39:32 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180921093931eucas1p1608d4caa7723c960965151b1ca4f08c6~WYNCZlc4_3022830228eucas1p1g; Fri, 21 Sep 2018 09:39:31 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180921093931eusmtrp2d20a5f4f3046f5d9ead9b7e0f6e0d813~WYNCIGAxY3245832458eusmtrp2U; Fri, 21 Sep 2018 09:39:31 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-44-5ba4bc54a8bb Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E9.72.04128.35CB4AB5; Fri, 21 Sep 2018 10:39:31 +0100 (BST) Received: from AMDC3778.DIGITAL.local (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180921093931eusmtip16c243435eb1b26c87226de4711047c70~WYNBzCgFG1156311563eusmtip1R; Fri, 21 Sep 2018 09:39:31 +0000 (GMT) From: Lukasz Luba To: linux-pm@vger.kernel.org, eas-dev@lists.linaro.org Cc: mark.rutland@arm.com, will.deacon@arm.com, Lukasz Luba Subject: [RFC][PATCH 0/3] Strange hackbench speed-up Date: Fri, 21 Sep 2018 11:38:51 +0200 X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7djP87ohe5ZEG+w/IW6x4kScxa0GGYvP vUcYLZZev8hk8fLjCRYHVo8189Ywetz+95jZ4+C7PUwenzfJBbBEcdmkpOZklqUW6dslcGU8 2LOHraCDv2L5i7csDYxLeboYOTkkBEwk9vZtYOti5OIQEljBKHF0xVZGCOcLo8TfiS9ZIJzP jBIPNh1ggmmZfa+LHSKxnFFiwZtuJriWCY+XMXcxcnCwCehJ7FhVCGKKCJhJPNobDtLLLBAp sWnuYhaQsDDQnKM3AkHCLAKqEnvv7GWFGC8ncfNcJzPIRAmBPWwSJ+YvZwZJ8AqUSfx/858R oshF4vufJihbWOLV8S3sELaMxP+d86HuLJY427GKDcKukWg/uQOqxlri8PGLrCA3MAtoSqzf pQ8RdpRo//WQESQsIcAnceOtIMTFfBKTtk1nhgjzSnS0CUFUa0hs6bkAtUhMYvmaaewQJR4S U48mgYSFBGIldu1qYZrAKDcLYdUCRsZVjOKppcW56anFxnmp5XrFibnFpXnpesn5uZsYgRF+ +t/xrzsY9/1JOsQowMGoxMNrsHhxtBBrYllxZe4hRgkOZiUR3n1dS6KFeFMSK6tSi/Lji0pz UosPMUpzsCiJ8/JppUULCaQnlqRmp6YWpBbBZJk4OKUaGJepcU7Ujas+toRp+QRrMbZZWlvM 7Ba+YDc72/XA+/LRmdfyBSrlLv+0+3bj/sG5nYHVdw32bw/YFjXzeZn82r+61vM+6vspxO47 EMz56qzltyOXwmcyGaZunrbKeMniV2vtVgYaHxKOPp07fULqd1u5/CwHL6PgKvP0ybe/Fts/ m5Hhbbiv4o8SS3FGoqEWc1FxIgCWR0V97AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrELMWRmVeSWpSXmKPExsVy+t/xu7rBe5ZEG3yYLGOx4kScxa0GGYvP vUcYLZZev8hk8fLjCRYHVo8189Ywetz+95jZ4+C7PUwenzfJBbBE6dkU5ZeWpCpk5BeX2CpF G1oY6RlaWugZmVjqGRqbx1oZmSrp29mkpOZklqUW6dsl6GU82LOHraCDv2L5i7csDYxLeboY OTkkBEwkZt/rYu9i5OIQEljKKNHWto0FIiEmMWnfdnYIW1jiz7UuNoiiT4wSF3/OAnI4ONgE 9CR2rCoEqRERsJCYcugpG4jNLBAtcX3vaWaQEmGgBUdvBIKEWQRUJfbe2csKYvMKeElcmfCO FWK8nMTNc53MExh5FjAyrGIUSS0tzk3PLTbSK07MLS7NS9dLzs/dxAgMr23Hfm7Zwdj1LvgQ owAHoxIPr8HixdFCrIllxZW5hxglOJiVRHj3dS2JFuJNSaysSi3Kjy8qzUktPsRoCrR8IrOU aHI+MPTzSuINTQ3NLSwNzY3Njc0slMR5zxtURgkJpCeWpGanphakFsH0MXFwSjUw7j6mL2te PmHiPgMpDUe7Iyve105mOSxzds8y7gf7vPRij56/6uNtfFW6QFfivA/P/n8iKs0Lsq58W74j QMtfUtmPSz2SodTMWtB6g8xSj4Nl+U3XqybnMJauz3vGJdH/WvFO69N9T8WrZsqJa9++mlZi 3WG772Aof9kuY2l1aY65Tx4ZRMgpsRRnJBpqMRcVJwIAoR9rREUCAAA= Message-Id: <20180921093931eucas1p1608d4caa7723c960965151b1ca4f08c6~WYNCZlc4_3022830228eucas1p1g@eucas1p1.samsung.com> X-CMS-MailID: 20180921093931eucas1p1608d4caa7723c960965151b1ca4f08c6 X-Msg-Generator: CA X-RootMTR: 20180921093931eucas1p1608d4caa7723c960965151b1ca4f08c6 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180921093931eucas1p1608d4caa7723c960965151b1ca4f08c6 References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, I have noticed an odd behavior in hackbench test, when developing some enhancements for thermal subsystem. It is present on ARM64 big.LITTLE (4b+4l) SoC. When hackbench runs normally after system reboot, it takes ~11sec to finish. When the module (which has locking present) is loaded and unloaded, time-to-finish is around ~6sec. The module tries to mimic the thermal framework, so everyone can experiment on local system without the need of thermal configuration. The test scenario and results are described in patch 1/3. Patch 3/3 is to narrow down the issue - mutex_unlock() call. Please apply only patch 1 and 2 and give it a try. You should see the speed-up 11s -> 6s. Then apply patch 3, rebuild the module, reboot the system, load the module, and run the test again (there should not be any improvements 11s -> 11s). I have noticed that the sequence: load the module, unload, run the test, also gives the speed-up. So there is no need to constantly touch the mutexes in the background. Any comments are welcome, esspecially for Will or Mark who where implementing low-level atomic stuff for mutexes. Tested on a few kernels (tag 4.18-rc6, EAS-next-integration_20180817_0000, some stable 4.14.x) and all are affected. Ypu can experiment with this kernel: EAS kernel branch: eas/next/integration_20180817_0000 also check tag: v4.18-rc6 url: http://linux-arm.org/git?p=linux-power.git;a=shortlog;h=refs/heads/eas/next/integration_20180817_0000 Regards, Lukasz Luba Lukasz Luba (3): drivers: base: add test module hackbench speedup drivers: base: add hackbench_speedup as a module drivers: hackbench_speedup: remove locking drivers/base/Makefile | 1 + drivers/base/hackbench_speedup.c | 148 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 drivers/base/hackbench_speedup.c