From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753984AbbEAPVZ (ORCPT ); Fri, 1 May 2015 11:21:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56924 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753386AbbEAPVY (ORCPT ); Fri, 1 May 2015 11:21:24 -0400 Message-ID: <554399D1.6010405@redhat.com> Date: Fri, 01 May 2015 11:20:49 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ingo Molnar CC: linux-kernel@vger.kernel.org, x86@kernel.org, williams@redhat.com, luto@kernel.org, fweisbec@redhat.com, peterz@infradead.org, heiko.carstens@de.ibm.com, tglx@linutronix.de, Ingo Molnar , Paolo Bonzini Subject: Re: [PATCH 3/3] context_tracking,x86: remove extraneous irq disable & enable from context tracking on syscall entry References: <1430429035-25563-1-git-send-email-riel@redhat.com> <1430429035-25563-4-git-send-email-riel@redhat.com> <20150501064044.GA18957@gmail.com> In-Reply-To: <20150501064044.GA18957@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/01/2015 02:40 AM, Ingo Molnar wrote: >> This patch builds on top of these patches by Paolo: >> https://lkml.org/lkml/2015/4/28/188 >> https://lkml.org/lkml/2015/4/29/139 >> >> Together with this patch I posted earlier this week, the syscall path >> on a nohz_full cpu seems to be about 10% faster. >> https://lkml.org/lkml/2015/4/24/394 >> >> My test is a simple microbenchmark that calls getpriority() in a loop >> 10 million times: >> >> run time system time >> vanilla 5.49s 2.08s >> __acct patch 5.21s 1.92s >> both patches 4.88s 1.71s > > Just curious, what are the numbers if you don't have context tracking > enabled, i.e. without nohz_full? > > I.e. what's the baseline we are talking about? It's an astounding difference. This is not a kernel without nohz_full, just a CPU without nohz_full running the same kernel I tested with yesterday: run time system time vanilla 5.49s 2.08s __acct patch 5.21s 1.92s both patches 4.88s 1.71s CPU w/o nohz 3.12s 1.63s <-- your numbers, mostly What is even more interesting is that the majority of the time difference seems to come from _user_ time, which has gone down from around 3.4 seconds in the vanilla kernel to around 1.5 seconds on the CPU without nohz_full enabled... At syscall entry time, the nohz_full context tracking code is very straightforward. We check thread_info->flags & _TIF_WORK_SYSCALL_ENTRY, and call syscall_trace_enter_phase1, which handles USER -> KERNEL context transition. Syscall exit time is a convoluted mess. Both do_notify_resume and syscall_trace_leave call exit_user() on entry and enter_user() on exit, leaving the time spent looping around between int_with_check and syscall_return: in entry_64.S accounted as user time. I sent an email about this last night, it may be useful to add a third test & function call point to the syscall return code, where we can call user_enter() just ONCE, and remove the other context tracking calls from that loop. -- All rights reversed