Message ID | 20221103182936.217120-1-longman@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp698368wru; Thu, 3 Nov 2022 11:31:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VviF+kc14AvEZPvf7Dgoj9mMDVAk4VCPitQeptb1bPSdFHMaSaqQdC0O1wBpsoaI+CHl5 X-Received: by 2002:a17:90a:1994:b0:212:f4e9:cebf with SMTP id 20-20020a17090a199400b00212f4e9cebfmr50323872pji.51.1667500310995; Thu, 03 Nov 2022 11:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667500310; cv=none; d=google.com; s=arc-20160816; b=ryjVsSOxafHGOVbOYr78fjaQW9N25v9GVuwjW72aTTqE2aKnWIi7TXMqoC2sM8nxvA Kzqou/QoP0XD6yq0CgmQk5Rq3rrUpQh04DqI0ia0dN8O7ci4Cap1XUixWHoDz0ecNocB pDkfBSPS1bNAqv1jRqAdfGSDti8RgNhSMETjhhi5yHqFGSnobIDBKyFgB47RDty71Di2 e2uGHUo5ibaDMJSGzCnkcCQk0imMrLx8xhDu7lbwWzvSmF9M51LT+UpTFDlY6A2ZmXrg 3sd7AcZedqucMUMWYxa4jfwpfWtYfiaDZwFJJ0YPBPJqWifvK7zcyHkhsUns24AOyiU6 RmZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dvDqTENSw9N0V4FMcGDKiEfPJa7hYDNehGPPO8daO5Q=; b=UEPvZBpjprAQ+wOkkDYRCwtqdNQWhR2mkXdHxkldK2wS0XHO345iA43ni5OgBiq4Rz Twm+3ctgHAURqVxzZS9v0wA5wx9vqWl7biWRg3F4smN51P/GNvRfNbotaQeCX+i66Ce2 eeqTWqC5RTkqWP9G3ZGZMSPQKF0oW7JNVUaXpw1F73xyBvUuYfcnVRIE2MLIwKswRDZu u5YeSggLd/ARS91g0BFDYiGqrhj3Uyf69fn8YmKkwn/T7Fj8FwxURh2Wp1zG3HgMoM/7 YFmT6fZEpW8SHWORKhRamNvkpG9qJ0kAl+c7st4eYDpqO4/wJUqhA8ezHC4X33HfoSCq 6IEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Sr0sTZzH; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a17090a1d4600b001f06a6fdb2fsi602929pju.27.2022.11.03.11.31.37; Thu, 03 Nov 2022 11:31:50 -0700 (PDT) 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=Sr0sTZzH; 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 S231527AbiKCSay (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Thu, 3 Nov 2022 14:30:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbiKCSap (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Nov 2022 14:30:45 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F305E26DE for <linux-kernel@vger.kernel.org>; Thu, 3 Nov 2022 11:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667500187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dvDqTENSw9N0V4FMcGDKiEfPJa7hYDNehGPPO8daO5Q=; b=Sr0sTZzHt8ZmVfeSS2spfM4Ocy3pBFjKqljiFf3Wfze5jvl4zYyEOiNGnHvxIga0bLBUcB dvsaq2fHXOZ+r6DV3Ol0XwSHIJMUG6j/fgggbsUCYcyaN8RAfAp70PnxTarRxjwEooW9PA hBHxXIVdcWPOjId4e5NJ2xBCQrDhxEk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-631-ZL1D63TdPu6FPBTVAN2-Nw-1; Thu, 03 Nov 2022 14:29:43 -0400 X-MC-Unique: ZL1D63TdPu6FPBTVAN2-Nw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 60AD21C14341; Thu, 3 Nov 2022 18:29:43 +0000 (UTC) Received: from llong.com (unknown [10.22.33.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9A551121331; Thu, 3 Nov 2022 18:29:42 +0000 (UTC) From: Waiman Long <longman@redhat.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>, Boqun Feng <boqun.feng@gmail.com> Cc: linux-kernel@vger.kernel.org, john.p.donnelly@oracle.com, Hillf Danton <hdanton@sina.com>, Mukesh Ojha <quic_mojha@quicinc.com>, =?utf-8?b?VGluZzExIFdhbmcg546L5am3?= <wangting11@xiaomi.com>, Waiman Long <longman@redhat.com> Subject: [PATCH v5 0/6] lockinig/rwsem: Fix rwsem bugs & enable true lock handoff Date: Thu, 3 Nov 2022 14:29:30 -0400 Message-Id: <20221103182936.217120-1-longman@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748500805956378834?= X-GMAIL-MSGID: =?utf-8?q?1748500805956378834?= |
Series |
lockinig/rwsem: Fix rwsem bugs & enable true lock handoff
|
|
Message
Waiman Long
Nov. 3, 2022, 6:29 p.m. UTC
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. v3: - Make a minor cleanup to patch 1. - Add 3 more patches to implement true lock handoff. 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 | 237 ++++++++++++++++++++++-------- 2 files changed, 181 insertions(+), 62 deletions(-)