Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1011691pxb; Wed, 16 Feb 2022 09:02:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTcttMA3ldnMXxHNyT5cmZZ4Nb5NVwl8IAlCsPQwK6mlcPcOq0gNdx+r+D7JXvNAFMnjpa X-Received: by 2002:aa7:cb8b:0:b0:410:9aaf:2974 with SMTP id r11-20020aa7cb8b000000b004109aaf2974mr3903361edt.173.1645030940204; Wed, 16 Feb 2022 09:02:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645030940; cv=none; d=google.com; s=arc-20160816; b=hpO1uDLnQ5ZT8BZWik0xWX8xYNoa3Uw0X9Beiti00IzwWKsif1JDNWyPx24BuqDfUT nt1uY9F5gjVcrP8pxEheKATKR9z4WLs3hUitjfY7swRmgeW4kGUaLI4yGJGSY/xwKP6x v4SY75muKoiZH0nVxDkHpaw+5qH1L5CQUN5Gpwy3WtZS9uNq/LLTOe8mWd+71HYAuaYx ONhX2L6mioJJhy7qyxhxDfqosu50cSzMRDoVCBvc4fb0rQ14/xURAAqulhpsM3hPPY37 3LWSd0O4GbobdfWzZuQpoCAnr4u/V3EwwabNPBN6XOxRZxI03YjZ01FEvhPc57ebzCvw QnrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=Dqm8te0zzHU1H5txRpXsHKM3zW9lf47xUyauRehYznU=; b=aro5o75vqjv8TFeyDicNHP1Q6o7zWztXmcDfo5vks5uqLnGPUavlSN9k/gUDVAoUC+ yus6mhRVfmHLNDzcutw3r8qyyxOM0JMbPK59oJsf1A2RDDrGWoSs3frgAUB0Pm6c37KQ Ab86WSzg4TD4M/GGiQ/7u1B9kMo3ZFtsYFNPc/wJeOxnDjiXYM3hBfDm39YW/7fV9LPk HvbLqLWXWNQpAhX9aaXz+zT7cuAT8CjHERGRaDylK/FKPVUd2SXFPiXv9dbwzvESSUfh 3Yyqak6xuVDrvP2UogyhmCgNR07KU02UGj8VmTavGzIbBtPT/55HgB2ddFSrNH50Pl0A fL+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EwGJ6Ofw; 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 f8si158561ejl.873.2022.02.16.09.01.43; Wed, 16 Feb 2022 09:02:20 -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=EwGJ6Ofw; 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 S236415AbiBPQa7 (ORCPT + 99 others); Wed, 16 Feb 2022 11:30:59 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236444AbiBPQax (ORCPT ); Wed, 16 Feb 2022 11:30:53 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E85312AED80 for ; Wed, 16 Feb 2022 08:30:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645029038; 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: in-reply-to:in-reply-to:references:references; bh=Dqm8te0zzHU1H5txRpXsHKM3zW9lf47xUyauRehYznU=; b=EwGJ6Ofw4JN0PfkOVIev3K/2Ncp9svx2DyMBqUA63gW/fjYCMpfB1Y+tRZKnpmB41AozXR q1gMYJc6xTT3LJ0TAi04MfNMZ7rJhGJgCeYSPYCTYAA4c0xLlq5DC7nKsB1sK4DdGeYwWn a4GqBkJRciA12OMcqH1V6vrOvEfMxfw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-247-CI_S9XDNM8aP5rBVXvkTCg-1; Wed, 16 Feb 2022 11:30:35 -0500 X-MC-Unique: CI_S9XDNM8aP5rBVXvkTCg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2EF7B814243; Wed, 16 Feb 2022 16:30:33 +0000 (UTC) Received: from [10.22.11.152] (unknown [10.22.11.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 530BA8276A; Wed, 16 Feb 2022 16:30:31 +0000 (UTC) Content-Type: multipart/mixed; boundary="------------AdyRA7Eq4tOJeY8U1AgGjX0Q" Message-ID: Date: Wed, 16 Feb 2022 11:30:30 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v5] locking/rwsem: Make handoff bit handling more consistent Content-Language: en-US To: Greg KH , chenguanyou , Jaegeuk Kim Cc: dave@stgolabs.net, hdanton@sina.com, linux-kernel@vger.kernel.org, mazhenhua@xiaomi.com, mingo@redhat.com, peterz@infradead.org, quic_aiquny@quicinc.com, will@kernel.org References: <20211116012912.723980-1-longman@redhat.com> <20220214162218.13930-1-chenguanyou@xiaomi.com> From: Waiman Long In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Spam-Status: No, score=-2.9 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_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 This is a multi-part message in MIME format. --------------AdyRA7Eq4tOJeY8U1AgGjX0Q Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/15/22 02:41, Greg KH wrote: > On Tue, Feb 15, 2022 at 12:22:18AM +0800, chenguanyou wrote: >>>> Hi Waiman, Greg, >>>> This patch has been merged in branch linux-5.16.y. >>>> Can we take it to the linux-5.10.y LTS version? >>> What is "this patch"? >> commit d257cc8cb8d5355ffc43a96bab94db7b5a324803 ("locking/rwsem: Make handoff bit handling more consistent") > Have you tested it on the 5.10.y branch to verify it actually works > properly for you? > > If so, please provide a working backport to the stable list, as it does > not apply cleanly as-is. > > thanks, > > greg k-h > I have attached the 5.10.y backport of commit d257cc8cb8d5355ffc43a96bab94db7b5a324803 ("locking/rwsem: Make handoff bit handling more consistent"). I also include a backport of commit 2f06f702925b512a95b95dca3855549c047eef58 ("locking/rwsem: Prevent potential lock starvation") which I think may help Jaegeuk. I had run some sanity tests and the backported patches work fine. However, I don't have access to their testing environments to verify if they can fix the problems seem by Chen or Jaegeuk. So please test these patches to see if they can address your problems. Cheers, Longman --------------AdyRA7Eq4tOJeY8U1AgGjX0Q Content-Type: text/x-patch; charset=UTF-8; name="0001-locking-rwsem-Prevent-potential-lock-starvation.patch" Content-Disposition: attachment; filename*0="0001-locking-rwsem-Prevent-potential-lock-starvation.patch" Content-Transfer-Encoding: base64 RnJvbSAwZGJjN2E2MDI0NmFmZDAwNjQwZTE0ZjFkODcyYjk2ZTcxYmQ5MmIzIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBXYWltYW4gTG9uZyA8bG9uZ21hbkByZWRoYXQuY29t PgpEYXRlOiBUdWUsIDE1IEZlYiAyMDIyIDE2OjM2OjM4IC0wNTAwClN1YmplY3Q6IFtQQVRD SCAxLzJdIGxvY2tpbmcvcndzZW06IFByZXZlbnQgcG90ZW50aWFsIGxvY2sgc3RhcnZhdGlv bgoKY29tbWl0IDJmMDZmNzAyOTI1YjUxMmE5NWI5NWRjYTM4NTU1NDljMDQ3ZWVmNTggdXBz dHJlYW0uCgpUaGUgbG9jayBoYW5kb2ZmIGJpdCBpcyBhZGRlZCBpbiBjb21taXQgNGYyM2Ri YzFlNjU3ICgibG9ja2luZy9yd3NlbToKSW1wbGVtZW50IGxvY2sgaGFuZG9mZiB0byBwcmV2 ZW50IGxvY2sgc3RhcnZhdGlvbiIpIHRvIGF2b2lkIGxvY2sKc3RhcnZhdGlvbi4gSG93ZXZl ciwgYWxsb3dpbmcgcmVhZGVycyB0byBkbyBvcHRpbWlzdGljIHNwaW5uaW5nIGRvZXMKaW50 cm9kdWNlIGFuIHVubGlrZWx5IHNjZW5hcmlvIHdoZXJlIGxvY2sgc3RhcnZhdGlvbiBjYW4g aGFwcGVuLgoKVGhlIGxvY2sgaGFuZG9mZiBiaXQgbWF5IG9ubHkgYmUgc2V0IHdoZW4gYSB3 YWl0ZXIgaXMgYmVpbmcgd29rZW4gdXAuCkluIHRoZSBjYXNlIG9mIHJlYWRlciB1bmxvY2ss IHdha2V1cCBoYXBwZW5zIG9ubHkgd2hlbiB0aGUgcmVhZGVyIGNvdW50CnJlYWNoZXMgMC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gJj0gUldTRU1fUkRfTk9OU1BJTk5BQkxFOwogCi0tIAoyLjI3LjAK Cg== --------------AdyRA7Eq4tOJeY8U1AgGjX0Q Content-Type: text/x-patch; charset=UTF-8; name="0002-locking-rwsem-Make-handoff-bit-handling-more-consist.patch" Content-Disposition: attachment; filename*0="0002-locking-rwsem-Make-handoff-bit-handling-more-consist.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSA1MmIyNjVlZTY5MThjNjY0MWFlOWI0NDBlNTVhN2VlZTZiOTQwMzlmIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBXYWltYW4gTG9uZyA8bG9uZ21hbkByZWRoYXQuY29t PgpEYXRlOiBUdWUsIDE1IEZlYiAyMDIyIDE2OjUxOjA0IC0wNTAwClN1YmplY3Q6IFtQQVRD SCAyLzJdIGxvY2tpbmcvcndzZW06IE1ha2UgaGFuZG9mZiBiaXQgaGFuZGxpbmcgbW9yZSBj b25zaXN0ZW50Cgpjb21taXQgZDI1N2NjOGNiOGQ1MzU1ZmZjNDNhOTZiYWI5NGRiN2I1YTMy NDgwMyB1cHN0cmVhbS4KClRoZXJlIGFyZSBzb21lIGluY29uc2lzdGVuY3kgaW4gdGhlIHdh eSB0aGF0IHRoZSBoYW5kb2ZmIGJpdCBpcyBiZWluZwpoYW5kbGVkIGluIHJlYWRlcnMgYW5k IHdyaXRlcnMgdGhhdCBsZWFkIHRvIGEgcmFjZSBjb25kaXRpb24uCgpGaXJzdGx5LCB3aGVu IGEgcXVldWUgaGVhZCB3cml0ZXIgc2V0IHRoZSBoYW5kb2ZmIGJpdCwgaXQgd2lsbCBjbGVh cgppdCB3aGVuIHRoZSB3cml0ZXIgaXMgYmVpbmcga2lsbGVkIG9yIGludGVycnVwdGVkIG9u IGl0cyB3YXkgb3V0CndpdGhvdXQgYWNxdWlyaW5nIHRoZSBsb2NrLiBUaGF0IGlzIG5vdCB0 aGUgY2FzZSBmb3IgYSBxdWV1ZSBoZWFkCnJl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