From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753856AbaKCVMS (ORCPT ); Mon, 3 Nov 2014 16:12:18 -0500 Received: from mail-lb0-f170.google.com ([209.85.217.170]:48710 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752635AbaKCVMO (ORCPT ); Mon, 3 Nov 2014 16:12:14 -0500 MIME-Version: 1.0 In-Reply-To: References: From: Andy Lutomirski Date: Mon, 3 Nov 2014 13:11:51 -0800 Message-ID: Subject: Re: [tip:x86/asm] sched/x86_64: Don't save flags on context switch To: Andy Lutomirski , Jan Beulich , Ingo Molnar , Linus Torvalds , "H. Peter Anvin" , Sebastian Lackner , "linux-kernel@vger.kernel.org" , Chuck Ebbert , Anish Bhatt , Thomas Gleixner , Oleg Nesterov Cc: "linux-tip-commits@vger.kernel.org" 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, Oct 28, 2014 at 4:14 AM, tip-bot for Andy Lutomirski wrote: > Commit-ID: 2c7577a7583747c9b71f26dced7f696b739da745 > Gitweb: http://git.kernel.org/tip/2c7577a7583747c9b71f26dced7f696b739da745 > Author: Andy Lutomirski > AuthorDate: Wed, 1 Oct 2014 11:28:25 -0700 > Committer: Ingo Molnar > CommitDate: Tue, 28 Oct 2014 11:11:30 +0100 > > sched/x86_64: Don't save flags on context switch > > Now that the kernel always runs with clean flags (in particular, > NT is clear), there is no need to save and restore flags on > every context switch. Just to make myself a little more comfortable with this... There is one potentially relevant flag: AC. I think this is still OK. If we schedule with STAC set, then we've already screwed up, I think. Even preempt schedules from interrupt context, so if we schedule due to preemption or #PF in the middle of uaccess, AC should be saved and cleared by whatever interrupt caused the reschedule, right? And do we ever have TF set during a context switch? I hope not. Also, what's with 'jmp exit_intr' at the end of retint_kernel? Why isn't that 'jmp retint_kernel'? --Andy