Commit 992caf7
locking/rtmutex: Add adaptive spinwait mechanism
Going to sleep when locks are contended can be quite inefficient when the
contention time is short and the lock owner is running on a different CPU.
The MCS mechanism cannot be used because MCS is strictly FIFO ordered while
for rtmutex based locks the waiter ordering is priority based.
Provide a simple adaptive spinwait mechanism which currently restricts the
spinning to the top priority waiter.
[ tglx: Provide a contemporary changelog, extended it to all rtmutex based
locks and updated it to match the other spin on owner implementations ]
Originally-by: Gregory Haskins <ghaskins@novell.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210815211305.912050691@linutronix.de1 parent 48eb3f4 commit 992caf7
1 file changed
Lines changed: 65 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
1297 | 1302 | | |
1298 | 1303 | | |
1299 | 1304 | | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
1300 | 1351 | | |
1301 | 1352 | | |
1302 | 1353 | | |
| |||
1381 | 1432 | | |
1382 | 1433 | | |
1383 | 1434 | | |
| 1435 | + | |
1384 | 1436 | | |
1385 | 1437 | | |
1386 | 1438 | | |
| |||
1403 | 1455 | | |
1404 | 1456 | | |
1405 | 1457 | | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
1406 | 1462 | | |
1407 | 1463 | | |
1408 | | - | |
| 1464 | + | |
| 1465 | + | |
1409 | 1466 | | |
1410 | 1467 | | |
1411 | 1468 | | |
| |||
1561 | 1618 | | |
1562 | 1619 | | |
1563 | 1620 | | |
| 1621 | + | |
1564 | 1622 | | |
1565 | 1623 | | |
1566 | 1624 | | |
| |||
1579 | 1637 | | |
1580 | 1638 | | |
1581 | 1639 | | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
1582 | 1644 | | |
1583 | 1645 | | |
1584 | | - | |
| 1646 | + | |
| 1647 | + | |
1585 | 1648 | | |
1586 | 1649 | | |
1587 | 1650 | | |
| |||
0 commit comments