From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Date: Wed, 20 Apr 2016 22:29:30 +0000 Subject: Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable Message-Id: List-Id: References: <1460041951-22347-11-git-send-email-mhocko@kernel.org> <20160413090829.GB29579@gmail.com> <20160413091625.GF14351@dhcp22.suse.cz> <20160413091943.GA17858@gmail.com> <20160413102731.GA29896@gmail.com> <20160413124943.GH14351@dhcp22.suse.cz> <20160420134019.GX3448@twins.programming.kicks-ass.net> <91A11395-ACAA-4043-B770-2DF6CBAED54C@zytor.com> <20160420204501.GA6815@pd.tnic> <5717EF59.1030709@zytor.com> <20160420213637.GA4978@pd.tnic> In-Reply-To: <20160420213637.GA4978@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Borislav Petkov Cc: Peter Zijlstra , Michal Hocko , Ingo Molnar , LKML , Ingo Molnar , Thomas Gleixner , "David S. Miller" , Tony Luck , Andrew Morton , Chris Zankel , Max Filippov , x86@kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org, Josh Poimboeuf On April 20, 2016 2:36:37 PM PDT, Borislav Petkov wrote: >On Wed, Apr 20, 2016 at 02:06:33PM -0700, H. Peter Anvin wrote: >> Setting ret to sem doesn't make any sense. Just use "=a" and "a". > >Yeah, that's what Michal's patch ontop does. > >And to answer my own question: we need the "a" (sem) input for the fast >path. > >I guess we can still move "1" (RWSEM_ACTIVE_WRITE_BIAS) before the >asm(): > > long tmp = RWSEM_ACTIVE_WRITE_BIAS; > >One thing I'm still not clear on is why we need the output tmp operand: >"=d" (tmp) ? Since it is a fixed register we could just mark edx clobbered, but with more flexible register constraints it can permit gcc to allocate a temp resister for us. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751868AbcDTWab (ORCPT ); Wed, 20 Apr 2016 18:30:31 -0400 Received: from terminus.zytor.com ([198.137.202.10]:47130 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751285AbcDTWa2 (ORCPT ); Wed, 20 Apr 2016 18:30:28 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <20160420213637.GA4978@pd.tnic> References: <1460041951-22347-11-git-send-email-mhocko@kernel.org> <20160413090829.GB29579@gmail.com> <20160413091625.GF14351@dhcp22.suse.cz> <20160413091943.GA17858@gmail.com> <20160413102731.GA29896@gmail.com> <20160413124943.GH14351@dhcp22.suse.cz> <20160420134019.GX3448@twins.programming.kicks-ass.net> <91A11395-ACAA-4043-B770-2DF6CBAED54C@zytor.com> <20160420204501.GA6815@pd.tnic> <5717EF59.1030709@zytor.com> <20160420213637.GA4978@pd.tnic> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH 10/11] x86, rwsem: provide __down_write_killable From: "H. Peter Anvin" Date: Wed, 20 Apr 2016 15:29:30 -0700 To: Borislav Petkov CC: Peter Zijlstra , Michal Hocko , Ingo Molnar , LKML , Ingo Molnar , Thomas Gleixner , "David S. Miller" , Tony Luck , Andrew Morton , Chris Zankel , Max Filippov , x86@kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org, Josh Poimboeuf Message-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On April 20, 2016 2:36:37 PM PDT, Borislav Petkov wrote: >On Wed, Apr 20, 2016 at 02:06:33PM -0700, H. Peter Anvin wrote: >> Setting ret to sem doesn't make any sense. Just use "=a" and "a". > >Yeah, that's what Michal's patch ontop does. > >And to answer my own question: we need the "a" (sem) input for the fast >path. > >I guess we can still move "1" (RWSEM_ACTIVE_WRITE_BIAS) before the >asm(): > > long tmp = RWSEM_ACTIVE_WRITE_BIAS; > >One thing I'm still not clear on is why we need the output tmp operand: >"=d" (tmp) ? Since it is a fixed register we could just mark edx clobbered, but with more flexible register constraints it can permit gcc to allocate a temp resister for us. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.