Commit 56221b4
nfsd: filecache: don't repeatedly add/remove files on the lru list
There is no need to remove a file from the lru every time we access it,
and then add it back. It is sufficient to set the REFERENCED flag every
time we put the file. The order in the lru of REFERENCED files is
largely irrelevant as they will all be moved to the end.
With this patch, files are added only when they are allocated (if
want_gc) and they are removed only by the list_lru_(shrink_)walk
callback or when forcibly removing a file.
This should reduce contention on the list_lru spinlock(s) and reduce
memory traffic a little.
Signed-off-by: NeilBrown <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>1 parent 6491212 commit 56221b4
1 file changed
+17
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
323 | 323 | | |
324 | | - | |
325 | | - | |
326 | | - | |
| 324 | + | |
| 325 | + | |
327 | 326 | | |
328 | | - | |
329 | | - | |
330 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
331 | 330 | | |
332 | 331 | | |
333 | 332 | | |
| |||
363 | 362 | | |
364 | 363 | | |
365 | 364 | | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 365 | + | |
| 366 | + | |
375 | 367 | | |
| 368 | + | |
376 | 369 | | |
377 | 370 | | |
378 | 371 | | |
| |||
516 | 509 | | |
517 | 510 | | |
518 | 511 | | |
519 | | - | |
520 | | - | |
| 512 | + | |
| 513 | + | |
521 | 514 | | |
522 | | - | |
| 515 | + | |
523 | 516 | | |
524 | | - | |
525 | | - | |
| 517 | + | |
526 | 518 | | |
527 | 519 | | |
528 | 520 | | |
| |||
1062 | 1054 | | |
1063 | 1055 | | |
1064 | 1056 | | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
| 1057 | + | |
1073 | 1058 | | |
1074 | | - | |
1075 | 1059 | | |
1076 | 1060 | | |
1077 | 1061 | | |
| |||
1165 | 1149 | | |
1166 | 1150 | | |
1167 | 1151 | | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1168 | 1155 | | |
1169 | 1156 | | |
1170 | 1157 | | |
| |||
0 commit comments