Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750910Ab3CWLvW (ORCPT ); Sat, 23 Mar 2013 07:51:22 -0400 Received: from mail.skyhub.de ([78.46.96.112]:43131 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750708Ab3CWLvU (ORCPT ); Sat, 23 Mar 2013 07:51:20 -0400 Date: Sat, 23 Mar 2013 12:51:15 +0100 From: Borislav Petkov To: Andi Kleen Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, x86@kernel.org, Andi Kleen Subject: Re: [PATCH 12/29] x86, tsx: Add a per thread transaction disable count Message-ID: <20130323115115.GA10821@pd.tnic> Mail-Followup-To: Borislav Petkov , Andi Kleen , linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, x86@kernel.org, Andi Kleen References: <1364001923-10796-1-git-send-email-andi@firstfloor.org> <1364001923-10796-13-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1364001923-10796-13-git-send-email-andi@firstfloor.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1636 Lines: 49 On Fri, Mar 22, 2013 at 06:25:06PM -0700, Andi Kleen wrote: > From: Andi Kleen > > For some locks that have a low chance of not aborting it's > best to just disable transactions. > > Add a counter to thread_info to allow to disable tranasctions > for the current task. > > I originally experimented with more complicated solutions, > like a magic spinlock type to disable with magic type matching, > but that was very intrusive in the locking code. > > This setup -- while adding a few more instructions -- is more > flexible and seems to work quite nicely. > > Signed-off-by: Andi Kleen > --- > arch/x86/include/asm/thread_info.h | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h > index 2cd056e..91bb84e 100644 > --- a/arch/x86/include/asm/thread_info.h > +++ b/arch/x86/include/asm/thread_info.h > @@ -39,6 +39,7 @@ struct thread_info { > */ > __u8 supervisor_stack[0]; > #endif > + unsigned notxn; /* transactions are disabled */ This surely can be a bitfield like the other two below. It is basically begging to be one. > unsigned int sig_on_uaccess_error:1; > unsigned int uaccess_err:1; /* uaccess failed */ > }; -- Regards/Gruss, Boris. Sent from a fat crate under my desk. Formatting is fine. -- -- 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/