From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934020AbbDUQMw (ORCPT ); Tue, 21 Apr 2015 12:12:52 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:36775 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932728AbbDUQMK (ORCPT ); Tue, 21 Apr 2015 12:12:10 -0400 MIME-Version: 1.0 In-Reply-To: <20150421124558.GA3483@gmail.com> References: <1429549782-12962-1-git-send-email-andrew.cooper3@citrix.com> <55359B57.3070008@kernel.org> <20150421124558.GA3483@gmail.com> Date: Tue, 21 Apr 2015 09:12:09 -0700 X-Google-Sender-Auth: jZElG-4uagtIGp3OzPD-z_w0V9Y Message-ID: Subject: Re: [RFC PATCH] x86/asm/irq: Don't use POPF but STI From: Linus Torvalds To: Ingo Molnar Cc: Andy Lutomirski , Andrew Cooper , Xen-devel , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "the arch/x86 maintainers" , Linux Kernel Mailing List , Konrad Rzeszutek Wilk , Boris Ostrovsky , David Vrabel , Rusty Russell , lguest@lists.ozlabs.org, Denys Vlasenko , Borislav Petkov Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 21, 2015 at 5:45 AM, Ingo Molnar wrote: > > Totally untested and not signed off yet: because we'd first have to > make sure (via irq flags debugging) that it's not used in reverse, to > re-disable interrupts: Not only might that happen in some place, I *really* doubt that a conditional 'sti' is actually any faster. The only way it's going to be measurably faster is if you run some microbenchmark so that the code is hot and the branch predicts well. "popf" is fast for the "no changes to IF" case, and is a smaller instruction anyway. I'd really hate to make this any more complex unless somebody has some real numbers for performance improvement (that is *not* just some cycle timing from a bogus test-case, but real measurements on a real load). And even *with* real measurements, I'd worry about the "use popf to clear IF" case. Linus