Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbbD3V5O (ORCPT ); Thu, 30 Apr 2015 17:57:14 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:34467 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750705AbbD3V5M (ORCPT ); Thu, 30 Apr 2015 17:57:12 -0400 MIME-Version: 1.0 In-Reply-To: <1430429035-25563-4-git-send-email-riel@redhat.com> References: <1430429035-25563-1-git-send-email-riel@redhat.com> <1430429035-25563-4-git-send-email-riel@redhat.com> From: Andy Lutomirski Date: Thu, 30 Apr 2015 14:56:49 -0700 Message-ID: Subject: Re: [PATCH 3/3] context_tracking,x86: remove extraneous irq disable & enable from context tracking on syscall entry To: Rik van Riel Cc: "linux-kernel@vger.kernel.org" , X86 ML , williams@redhat.com, Andrew Lutomirski , Ingo Molnar , bonzini@redhat.com, fweisbec@redhat.com, Peter Zijlstra , Heiko Carstens , Thomas Gleixner , Ingo Molnar , Paolo Bonzini , Borislav Petkov , Denys Vlasenko , "H. Peter Anvin" , Steven Rostedt Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1795 Lines: 48 [added some cc's] On Thu, Apr 30, 2015 at 2:23 PM, wrote: > From: Rik van Riel > > On syscall entry with nohz_full on, we enable interrupts, call user_exit, > disable interrupts, do something, re-enable interrupts, and go on our > merry way. > > Profiling shows that a large amount of the nohz_full overhead comes > from the extraneous disabling and re-enabling of interrupts. Andy > suggested simply not enabling interrupts until after the context > tracking code has done its thing, which allows us to skip a whole > interrupt disable & re-enable cycle. > > 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 This has two downsides: 1. It lengthens (slightly) the IRQs-off window at the beginning of syscalls. 2. It replaces an untraced irq disable with a traced irq disable. That's probably not quite free. Nonetheless, I'm okay with it in principle. Context tracking is useful and increasingly common, and I'd like to make it fast. This is a minimally invasive change that helps quite a bit. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/