Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5575124rwb; Tue, 17 Jan 2023 16:00:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXs/dBkrncRr/L9zqcn1917uO0mhNS7v/sRnr6zxruBGgvZWebahH9BIbZ4Uc8rpdhE/s3yU X-Received: by 2002:aa7:dd44:0:b0:49e:689:f003 with SMTP id o4-20020aa7dd44000000b0049e0689f003mr5040031edw.10.1674000057143; Tue, 17 Jan 2023 16:00:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674000057; cv=none; d=google.com; s=arc-20160816; b=bniw6AH+o+OuUnyhrMUwJnGQLhr/BXeBe5c4nmsB9vWc5DBpnRTKA7ly8Ma6STpLlu /IF8rKh3bloXmoYwyrzgMc1J0TlAxfQEatlR3CsK37WQzrynLzH5mT0JITfxHoup+R/d ew5m45quFGslIA4OatwZKUwdHRzGqWMX0e3w3PcqdJqThrwmZtF2/HElU233hB7TbFei jBYyjCsUPc9+7zhIXechBRTwvc8zrIPUynHs41s8I5dHBhHDm2Nu2t5I+zQD6Rk/T6fN CCjVtfVH51xIETdo6joKuj1S4ifeOd/jFhhdqVTDD5Dk2lGOvfzvj+oIkkE5Q2lr/2gL gQYg== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=kK9jjV9LP02qyv4y6+sL2kQpufhJ4FqsFgh0MZZolJ4=; b=OLoWfj80BOL1xE2ud9X9yNHPGFKkpyCBQNxiwnnfS8QgIhRFvW3kKN3ONJ1mHaYzhP TC7rmKHqLSQ+nmV2pmA2fRSLf7WJ74MCVqF5Q9cOCCRiflN2LTBomLMPRNs5BE1/6l3S icw8ecfhwc9Zdf57uxggNe0moZOwtVzD/kqwITE7POwYmSgS3aDfZkBgD1lmcIF4V62H iapEbH8JlKWvVe5Ga+9DfkXx9h3kMSLpkuaklkw6EnkxkZfZsoUG+7SptxOyrkKa2txc mwocFk3YoeWIsbVySdCHk7sF1WIA7nFhpquX9ETqvmI42BNcF/3gspob3C5AIWdBAVo3 0Bbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=c5lMSLWV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a056402511100b0048ea96d245asi38589604edd.267.2023.01.17.16.00.45; Tue, 17 Jan 2023 16:00:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=c5lMSLWV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229484AbjAQXNB (ORCPT + 46 others); Tue, 17 Jan 2023 18:13:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbjAQXLZ (ORCPT ); Tue, 17 Jan 2023 18:11:25 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF457683F8 for ; Tue, 17 Jan 2023 12:53:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673988809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kK9jjV9LP02qyv4y6+sL2kQpufhJ4FqsFgh0MZZolJ4=; b=c5lMSLWVkMbtouTkpAileyhU2gC59N2OMdVgltfXYfjtmDSkAayTZ44UMLMeiT7u1tlYGY UqpT5GvCkJiWmPx+D6m+EEaS8QiDkN8Wgk6KcVDPXex2RjfOfx8I1Sxn4J4IIVGUApxKgm wlL/xjvyY9Rq96HT3AvZRqmcb9OmuOg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-390-XDlHVebtNmCyO3FtIvn-Ag-1; Tue, 17 Jan 2023 15:53:23 -0500 X-MC-Unique: XDlHVebtNmCyO3FtIvn-Ag-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D5B7A811E9C; Tue, 17 Jan 2023 20:53:22 +0000 (UTC) Received: from [10.18.17.153] (dhcp-17-153.bos.redhat.com [10.18.17.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58FBF7AE5; Tue, 17 Jan 2023 20:53:22 +0000 (UTC) Message-ID: Date: Tue, 17 Jan 2023 15:53:22 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v6 0/6] lockinig/rwsem: Fix rwsem bugs & enable true lock handoff Content-Language: en-US To: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng Cc: linux-kernel@vger.kernel.org, john.p.donnelly@oracle.com, Hillf Danton , Mukesh Ojha , =?UTF-8?B?VGluZzExIFdhbmcg546L5am3?= References: <20221118022016.462070-1-longman@redhat.com> From: Waiman Long In-Reply-To: <20221118022016.462070-1-longman@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/17/22 21:20, Waiman Long wrote: > v6: > - Fix an error in patch 2 reported by kernel test robot. > > v5: > - Drop patch 2 and replace it with 2 new patches disabling preemption on > all reader functions and writer functions respectively. The other > patches are adjusted accordingly. > > v4: > - Update patch descriptions in patches 1 & 2 to make clear the live > lock conditions that are being fixed by these patches. There is no code > change from v3. > > It turns out the current waiter optimistic spinning code does not work > that well if we have RT tasks in the mix. This patch series include two > different fixes to resolve those issues. The last 3 patches modify the > handoff code to implement true lock handoff similar to that of mutex. > > Waiman Long (6): > locking/rwsem: Prevent non-first waiter from spinning in down_write() > slowpath > locking/rwsem: Disable preemption at all down_read*() and up_read() > code paths > locking/rwsem: Disable preemption at all down_write*() and up_write() > code paths > locking/rwsem: Change waiter->hanodff_set to a handoff_state enum > locking/rwsem: Enable direct rwsem lock handoff > locking/rwsem: Update handoff lock events tracking > > kernel/locking/lock_events_list.h | 6 +- > kernel/locking/rwsem.c | 240 ++++++++++++++++++++++-------- > 2 files changed, 182 insertions(+), 64 deletions(-) > Peter, I know that you are busy these days. Do have any further comment or suggestion on this patch series? Looking forward to your reply. Thanks, Longman