Commit fbfdc9f
nfsd: filecache: drop the list_lru lock during lock gc scans
Under a high NFSv3 load with lots of different files being accessed,
the LRU list of garbage-collectable files can become quite long.
Asking list_lru_scan_node() to scan the whole list can result in a long
period during which a spinlock is held, blocking the addition of new LRU
items.
So ask list_lru_scan_node() to scan only a few entries at a time, and
repeat until the scan is complete.
If the shrinker runs between two consecutive calls of
list_lru_scan_node() it could invalidate the "remaining" counter which
could lead to premature freeing. So add a spinlock to avoid that.
Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>1 parent 56221b4 commit fbfdc9f
2 files changed
+30
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
547 | 554 | | |
548 | 555 | | |
549 | 556 | | |
550 | 557 | | |
551 | 558 | | |
552 | 559 | | |
553 | 560 | | |
| 561 | + | |
554 | 562 | | |
555 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
556 | 567 | | |
557 | | - | |
558 | | - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
559 | 575 | | |
| 576 | + | |
560 | 577 | | |
561 | 578 | | |
562 | 579 | | |
| |||
581 | 598 | | |
582 | 599 | | |
583 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
584 | 604 | | |
585 | 605 | | |
| 606 | + | |
586 | 607 | | |
587 | 608 | | |
588 | 609 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
| |||
0 commit comments