Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp12572pxb; Fri, 10 Sep 2021 20:00:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5IFlmrK05UJNqgOLXzJqOeBe67ff3uVWaEBdynw8l9A3BmDZ7sYey+zv2A4gczCV2qXir X-Received: by 2002:a92:194c:: with SMTP id e12mr591356ilm.3.1631329204699; Fri, 10 Sep 2021 20:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631329204; cv=none; d=google.com; s=arc-20160816; b=L5fyfHjLqVWbH+vtvX1gVN3Lxkr+GVTpn4oT896iPTw8N5XfqC/JUF3aNJy4wDq3G5 heRw3lZJ6lmak+iaR02Vi3LrjLvfnZ8d4CN/NaPCrYTlOGO9h013S4ODh154qtkBevFh C09lxbgndpZ0+F9F1PQIKo1lk/xquQuS2o2RhBq0ii++5i/qnGquEl+HTdBuHh4eGR07 PHyFhT9bzEj5metj8hMnH3UpJ364cwnr3SRKf8XQLKjwC/Fdg0qgZV814kc3NqL7LWwK BHEk/E0pu/jrtJAWTwA/p95Qwg2LLiJjnNVtc//pLUvwJqliqtDPDl22DFOIrFkTiu/M O22w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=Vd6JS30Twb7W8oBbLRJ9ToFHZ1Khw86DNjJ+nxmqr9E=; b=c8oWtm8FiKj61EeeoaKFXz35nxhXqcpOZIOUXvrIYlspUpTlg6QPkDlBN82QUJIGgm gsvRz05Iucs97rtF/0GbGK8+5cwuWACSt8gZFEHLaYxGZ17Cxc6vZP7DqApLfwmlTnyl LTns64sS34eAscOZWhl9CQq1lj6D0zyh3tWExZP58SeVPWzom0uFn5ynGBbQxXgTguaP qvIqFUDCOVVcT+s4bFJQqPtfTDKT8+sBgU/0OKf3s970YCtlieEMdQ7eenhGo5ax+6ub L1Df0FpcVCebxbCftIV3AHwuKDRvvNKsxyefbVnu4S2G+6Aqfn6L7OyFyLMMjuW2ZSTA jCGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y20si542117jao.34.2021.09.10.19.59.53; Fri, 10 Sep 2021 20:00:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235213AbhIKDAZ (ORCPT + 99 others); Fri, 10 Sep 2021 23:00:25 -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