From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757249AbcLORZX (ORCPT ); Thu, 15 Dec 2016 12:25:23 -0500 Received: from mail-vk0-f48.google.com ([209.85.213.48]:35603 "EHLO mail-vk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972AbcLORZV (ORCPT ); Thu, 15 Dec 2016 12:25:21 -0500 MIME-Version: 1.0 In-Reply-To: <20161215164240.736387680@linutronix.de> References: <20161215162648.061449202@linutronix.de> <20161215164240.736387680@linutronix.de> From: Andy Lutomirski Date: Thu, 15 Dec 2016 09:24:59 -0800 Message-ID: Subject: Re: [patch 1/3] x86/process: Optimize TIF checks in switch_to_extra() To: Thomas Gleixner Cc: LKML , X86 ML , Peter Zijlstra , Kyle Huey , Andy Lutomirski 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 Thu, Dec 15, 2016 at 8:44 AM, Thomas Gleixner wrote: > - if (test_tsk_thread_flag(prev_p, TIF_BLOCKSTEP) ^ > - test_tsk_thread_flag(next_p, TIF_BLOCKSTEP)) { > + tifn = task_thread_info(next_p)->flags; > + tifp = task_thread_info(prev_p)->flags; Minor nit, but I think that a sufficiently clever compiler could interpret this to mean "no one else is modifying these flags, so I can do clever crazy things". Wrapping these in READ_ONCE might be helpful.