[LU-15156] Back port upstream patch for rwsem issue Created: 25/Oct/21  Updated: 22/Mar/23  Resolved: 20/Nov/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.15.0

Type: Improvement Priority: Minor
Reporter: Yang Sheng Assignee: Yang Sheng
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
Related
is related to LU-10678 LBUG: osd_handler.c:2353:osd_read_loc... Resolved
is related to LU-12508 (llite_mmap.c:71:our_vma()) ASSERTION... Closed
Rank (Obsolete): 9223372036854775807

 Description   

We need back port patch from upstream to fix some rwsem issue.

From 5c1ec49b60cdb31e51010f8a647f3189b774bddf Mon Sep 17 00:00:00 2001
From: Waiman Long <longman@redhat.com>
Date: Mon, 20 May 2019 16:59:01 -0400
Subject: [PATCH] locking/rwsem: Remove rwsem_wake() wakeup optimization

After the following commit:

  59aabfc7e959 ("locking/rwsem: Reduce spinlock contention in wakeup after up_read()/up_write()")

the rwsem_wake() forgoes doing a wakeup if the wait_lock cannot be directly
acquired and an optimistic spinning locker is present.  This can help performance
by avoiding spinning on the wait_lock when it is contended.

With the later commit:

  133e89ef5ef3 ("locking/rwsem: Enable lockless waiter wakeup(s)")

the performance advantage of the above optimization diminishes as the average
wait_lock hold time become much shorter.

With a later patch that supports rwsem lock handoff, we can no
longer relies on the fact that the presence of an optimistic spinning
locker will ensure that the lock will be acquired by a task soon and
rwsem_wake() will be called later on to wake up waiters. This can lead
to missed wakeup and application hang.

So the original 59aabfc7e959 commit has to be reverted.


 Comments   
Comment by Gerrit Updater [ 27/Oct/21 ]

"Yang Sheng <ys@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45383
Subject: LU-15156 kernel: back port patch for resem issue
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: b4a103d6a6ec09e74654f422a8956ec21f5bbef0

Comment by Gerrit Updater [ 20/Nov/21 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45383/
Subject: LU-15156 kernel: back port patch for rwsem issue
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 85362faed8f5ee94ffee1f3f6330beee57ea9284

Comment by Peter Jones [ 20/Nov/21 ]

Landed for 2.15

Generated at Sat Feb 10 03:15:56 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.