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=-17.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 1F532C433EF for ; Sat, 11 Sep 2021 02:59:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E28296120A for ; Sat, 11 Sep 2021 02:59:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235226AbhIKDA0 (ORCPT ); Fri, 10 Sep 2021 23:00:26 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:9416 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231864AbhIKDAZ (ORCPT ); Fri, 10 Sep 2021 23:00:25 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4H5y5P1MyHz8yLQ; Sat, 11 Sep 2021 10:54:49 +0800 (CST) Received: from dggema774-chm.china.huawei.com (10.1.198.216) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.8; Sat, 11 Sep 2021 10:59:12 +0800 Received: from [10.67.102.197] (10.67.102.197) by dggema774-chm.china.huawei.com (10.1.198.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Sat, 11 Sep 2021 10:59:11 +0800 Subject: Re: [patch V5 34/72] locking/rwlock: Provide RT variant To: Thomas Gleixner , LKML CC: Peter Zijlstra , Ingo Molnar , Juri Lelli , Steven Rostedt , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , Sebastian Andrzej Siewior , Davidlohr Bueso , Mike Galbraith References: <20210815203225.710392609@linutronix.de> <20210815211303.882793524@linutronix.de> From: Xiaoming Ni Message-ID: Date: Sat, 11 Sep 2021 10:59:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.0.1 MIME-Version: 1.0 In-Reply-To: <20210815211303.882793524@linutronix.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.197] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggema774-chm.china.huawei.com (10.1.198.216) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/8/16 5:28, Thomas Gleixner wrote: > From: Thomas Gleixner > > Similar to rw_semaphores on RT the rwlock substitution is not writer fair > because it's not feasible to have a writer inherit it's priority to > multiple readers. Readers blocked on a writer follow the normal rules of > priority inheritance. Like RT spinlocks RT rwlocks are state preserving > across the slow lock operations (contended case). > > Signed-off-by: Thomas Gleixner > --- > V5: Add missing might_sleep() and fix lockdep init (Sebastian) > --- > include/linux/rwlock_rt.h | 140 ++++++++++++++++++++++++++++++++++++++++ > include/linux/rwlock_types.h | 49 ++++++++++---- > include/linux/spinlock_rt.h | 2 > kernel/Kconfig.locks | 2 > kernel/locking/spinlock.c | 7 ++ > kernel/locking/spinlock_debug.c | 5 + > kernel/locking/spinlock_rt.c | 131 +++++++++++++++++++++++++++++++++++++ > 7 files changed, 323 insertions(+), 13 deletions(-) > create mode 100644 include/linux/rwlock_rt.h > --- ..... > + > +int __sched rt_rwlock_is_contended(rwlock_t *rwlock) > +{ > + return rw_base_is_contended(&rwlock->rwbase); > +} > +EXPORT_SYMBOL(rt_rwlock_is_contended); > + rt_rwlock_is_conted() exported but not declared in the header file? Is this a special design or a mistake? Thanks Xiaoming Ni