From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25EF0C43381 for ; Thu, 21 Feb 2019 14:15:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E87662070B for ; Thu, 21 Feb 2019 14:15:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728154AbfBUOPa (ORCPT ); Thu, 21 Feb 2019 09:15:30 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45228 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725880AbfBUOPa (ORCPT ); Thu, 21 Feb 2019 09:15:30 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3A33515AB; Thu, 21 Feb 2019 06:15:30 -0800 (PST) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C71A13F575; Thu, 21 Feb 2019 06:15:27 -0800 (PST) Date: Thu, 21 Feb 2019 14:15:25 +0000 From: Will Deacon To: Waiman Long Cc: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org, x86@kernel.org, Arnd Bergmann , Borislav Petkov , "H. Peter Anvin" , Davidlohr Bueso , Linus Torvalds , Andrew Morton , Tim Chen Subject: Re: [PATCH-tip v2 02/10] locking/rwsem: Move owner setting code from rwsem.c to rwsem.h Message-ID: <20190221141525.GF12696@fuggles.cambridge.arm.com> References: <1550263810-31947-1-git-send-email-longman@redhat.com> <1550263810-31947-3-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1550263810-31947-3-git-send-email-longman@redhat.com> User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Waiman, On Fri, Feb 15, 2019 at 03:50:02PM -0500, Waiman Long wrote: > Moves all the owner setting code closer to the rwsem-xadd fast paths > directly within rwsem.h file. > > For __down_read() and __down_read_killable(), it is assumed that > rwsem will be marked as reader-owned when the functions return. That > is currently true except in the transient case that the waiter queue > just becomes empty. So a rwsem_set_reader_owned() call is added for > this case. Sorry, but I'm having a really hard time understanding the paragraph above. You make it sound like you're fixing a bug here, but that doesn't appear to be the case. Please can you elaborate? > The __rwsem_set_reader_owned() call in __rwsem_mark_wake() > is now necessary. > > Signed-off-by: Waiman Long > --- > kernel/locking/rwsem-xadd.c | 6 +++--- > kernel/locking/rwsem.c | 19 ++----------------- > kernel/locking/rwsem.h | 17 +++++++++++++++-- > 3 files changed, 20 insertions(+), 22 deletions(-) I personally find the existing code easier to read, but I don't know if that's just because I'm used to it... Will