Commit 85d9abc
xen/blkfront: speed up purge_persistent_grants()
purge_persistent_grants() is scanning the grants list for persistent
grants being no longer in use by the backend. When having found such a
grant, it will be set to "invalid" and pushed to the tail of the list.
Instead of pushing it directly to the end of the list, add it first to
a temporary list, avoiding to scan those entries again in the main
list traversal. After having finished the scan, append the temporary
list to the grant list.
Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Link: https://lore.kernel.org/r/20220311103527.12931-1-jgross@suse.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 67b5613 commit 85d9abc
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2521 | 2521 | | |
2522 | 2522 | | |
2523 | 2523 | | |
| 2524 | + | |
2524 | 2525 | | |
2525 | 2526 | | |
2526 | 2527 | | |
| |||
2539 | 2540 | | |
2540 | 2541 | | |
2541 | 2542 | | |
2542 | | - | |
| 2543 | + | |
2543 | 2544 | | |
2544 | 2545 | | |
| 2546 | + | |
| 2547 | + | |
2545 | 2548 | | |
2546 | 2549 | | |
2547 | 2550 | | |
| |||
0 commit comments