Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1400418

Re: [PATCH v4] x86/hpet: Reduce HPET counter read contention

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Waiman Long <waiman.long@hpe.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4] x86/hpet: Reduce HPET counter read contention
Date Fri, 13 May 2016 01:30:02 +0200
Message-ID <ry8dk-7SC-5@gated-at.bofh.it> (permalink)
References <rnbxT-3BX-5@gated-at.bofh.it>
Authentication-Results hpe.com; dkim=none (message not signed) header.d=none;hpe.com; dmarc=none action=none header.from=hpe.com;
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12
MIME-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding 7bit
X-Originating-IP [72.71.243.221]
X-Clientproxiedby BY1PR14CA0042.namprd14.prod.outlook.com (10.161.91.52) To TU4PR84MB0318.NAMPRD84.PROD.OUTLOOK.COM (10.162.186.28)
X-Ms-Office365-Filtering-Correlation-ID c545df8a-c630-421d-60a6-08d37abc0f85
X-Microsoft-Exchange-Diagnostics 1;TU4PR84MB0318;2:tWXcqPN0rT6ocB2FdR4qTMnbigSjebPqUHpToFPv54K5lXv/gnxMtdJR7hS2I8v1sBrxC4npcyhWPc4DtRnQR52lZ6maEiFMXqojYPVE86+m1rGmeJOKISV2sCQWtUhb4I4ssGEtxcK6uPAi6pi/SnFjCnrWwPmBXNKaSxsG1H/Si2vdh20cutirtnLif8as;3:3zNZBrxpbM9Y5O+7mZUx8zEwje2XnRk9rStnF4hW+PYQDABjmgveCYuubRHmUV/2zwFDsrfQUroB94FMvmHyX3Yfw8qzqUy96pMeCUdhGjTupUPrBdlhfFkIfRnRMI9I;25:BVv3ehQS+UwLkp8ZMscW4IE7bdbj72f03gsJ6UMxHT+umKLLi8qk/+NqQ5saCG7a+MR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ciPbeTSLy2i0yaEHIjWfnehIKArdL35dDo9zX2pMzgICNJ+v4ypEd87slRi/pyWldutS9apyfXl1U5C3Eh8FBQvYeqOluiGq/PW1Z0WuT94YLF8kK12bxov1H705M5aT71NY4aGDgAGOvZozvIC31FI1UfAOc
X-Microsoft-Antispam-Prvs <TU4PR84MB03180727B13D5D5ABA2BD238F1730@TU4PR84MB0318.NAMPRD84.PROD.OUTLOOK.COM>
X-Exchange-Antispam-Report-Test UriScan:;
X-Exchange-Antispam-Report-Cfa-Test BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:TU4PR84MB0318;BCL:0;PCL:0;RULEID:;SRVR:TU4PR84MB0318;
X-Forefront-Prvs 0940A19703
X-Forefront-Antispam-Report SFV:NSPM;SFS:(10019020)(4630300001)(979002)(6049001)(6009001)(377454003)(24454002)(87266999)(36756003)(76176999)(65816999)(83506001)(54356999)(50986999)(3846002)(5008740100001)(6116002)(50466002)(99136001)(230700001)(86362001)(8676002)(64126003)(33656002)(5004730100002)(586003)(77096005)(2950100001)(23756003)(42186005)(6200100001)(117156001)(4001350100001)(59896002)(92566002)(4326007)(189998001)(110136002)(80316001)(19580395003)(81166006)(65956001)(66066001)(47776003)(65806001)(19580405001)(2906002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:TU4PR84MB0318;H:[192.168.142.129];FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en;
X-Microsoft-Exchange-Diagnostics 1;TU4PR84MB0318;23:GRvCCutWMeQ5vaffYAL3nWy8IGpWqoP4JmxLF4X148MUW7WAGEOugSev2is5BsbXHhfwz9XFUIHSWxexQVZLVzKtN9XN6V3jNgPaRu5b9COHBj6XTBgq1RBGdsvsansCupWbJy11mcWaZHf9y2a+IQ0mo1XP13kmPE+rLlbRoY0xmf/6ITVkCPwWxosLIhXSicHiLlxJCKybRPziXN0xPblznn9NVU3KlKOfj8m3qB40R6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B0318;5:c0FIz490Rvqgfv70PP2fNKmxYYSknGB8bxXz8om77z34DyrZ1VVITDndVIxVG2rb1/Nm2Lk8YiF79MABKI4a1cW882ph97jnPqxWQibWHRB3Wn5bCFouVXvrIKEXFj4B7wOw9tIdSBYLlbcLMtnEcg==;24:vhWOafPeheUtv2oVi/a5WMsyepjR3/njkbgmGyvQkkZu/B/R8utw4wqWEOg1rkbQIZz+PuTofN+gIrQCeINC34IGOTQU4AWOgmxtjaOPIHk=;7:MAAwl9GZ49fjdy7UceFK91YFHt0qsPSlFANspLXFbqT8pS9N7+Zr7bpSBRLbJc5ZHz62UZ5Riox0MVwjLnqkKwECIwHd87niVd15PQ6ThXD5xxzmY2vHGPDqH/4JTi0rAKsxPIwW3IqT5BhEwys3enVUH/b4C+c/5CtPQ7lFj4VrOkToxutrrLBYp3oNGsYY
Spamdiagnosticoutput 1:23
Spamdiagnosticmetadata NSPM
X-Originatororg hpe.com
X-Ms-Exchange-Crosstenant-Originalarrivaltime 12 May 2016 23:20:47.4240 (UTC)
X-Ms-Exchange-Crosstenant-Fromentityheader Hosted
X-Ms-Exchange-Transport-Crosstenantheadersstamped TU4PR84MB0318
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 76
Organization linux.* mail to news gateway
X-Original-Cc Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>, <linux-kernel@vger.kernel.org>, <x86@kernel.org>, Jiang Liu <jiang.liu@linux.intel.com>, Borislav Petkov <bp@suse.de>, Andy Lutomirski <luto@kernel.org>, Scott J Norton <scott.norton@hpe.com>, Douglas Hatch <doug.hatch@hpe.com>, Randy Wright <rwright@hpe.com>
X-Original-Date Thu, 12 May 2016 19:20:31 -0400
X-Original-Message-ID <57350FBF.9060807@hpe.com>
X-Original-References <1460486768-34024-1-git-send-email-Waiman.Long@hpe.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1400418

Show key headers only | View raw


On 04/12/2016 02:46 PM, Waiman Long wrote:
> On a large system with many CPUs, using HPET as the clock source can
> have a significant impact on the overall system performance because
> of the following reasons:
>   1) There is a single HPET counter shared by all the CPUs.
>   2) HPET counter reading is a very slow operation.
>
> Using HPET as the default clock source may happen when, for example,
> the TSC clock calibration exceeds the allowable tolerance. Something
> the performance slowdown can be so severe that the system may crash
> because of a NMI watchdog soft lockup, for example.
>
> This patch attempts to reduce HPET read contention by using the fact
> that if more than one CPUs are trying to access HPET at the same time,
> it will be more efficient if one CPU in the group reads the HPET
> counter and shares it with the rest of the group instead of each
> group member reads the HPET counter individually.
>
> This is done by using a combination word with a sequence number and
> a bit lock. The CPU that gets the bit lock will be responsible for
> reading the HPET counter and update the sequence number. The others
> will monitor the change in sequence number and grab the HPET counter
> accordingly. This change is enabled on SMP configuration.
>
> On a 4-socket Haswell-EX box with 72 cores (HT off), running the
> AIM7 compute workload (1500 users) on a 4.6-rc1 kernel (HZ=1000)
> with and without the patch has the following performance numbers
> (with HPET or TSC as clock source):
>
> TSC		= 646515 jobs/min
> HPET w/o patch	= 566708 jobs/min
> HPET with patch	= 638791 jobs/min
>
> The perf profile showed a reduction of the %CPU time consumed by
> read_hpet from 4.99% without patch to 1.41% with patch.
>
> On a 16-socket IvyBridge-EX system with 240 cores (HT on), on the
> other hand, the performance numbers of the same benchmark were:
>
> TSC		= 3145329 jobs/min
> HPET w/o patch	= 1108537 jobs/min
> HPET with patch	= 3019934 jobs/min
>
> The corresponding perf profile showed a drop of CPU consumption of
> the read_hpet function from more than 34% to just 2.96%.
>
> Signed-off-by: Waiman Long<Waiman.Long@hpe.com>
> ---
>   v3->v4:
>    - Move hpet_save inside the CONFIG_SMP block to fix a compilation
>      warning in non-SMP build.
>
>   v2->v3:
>    - Make the hpet optimization the default for SMP configuration. So
>      no documentation change is needed.
>    - Remove threshold checking code as it should not be necessary and
>      can be potentially unsafe.
>
>   v1->v2:
>    - Reduce the CPU threshold to 32.
>    - Add a kernel parameter to explicitly enable or disable hpet
>      optimization.
>    - Change hpet_save.hpet type to u32 to make sure that read&  write
>      is atomic on i386.
>
>   arch/x86/kernel/hpet.c |   84 ++++++++++++++++++++++++++++++++++++++++++++++++
>   1 files changed, 84 insertions(+), 0 deletions(-)
>
>

I haven't received any feedback on this patch since mid-April. I would 
like to know if the current patch is good enough or some additional 
changes are still needed to make it merge-able upstream.

Thanks,
Longman

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v4] x86/hpet: Reduce HPET counter read contention Waiman Long <waiman.long@hpe.com> - 2016-05-13 01:30 +0200

csiph-web