Repository navigation
Commit 5e6bbde
f2fs: introduce mempool for {,de}compress intermediate page allocation
If compression feature is on, in scenario of no enough free memory,
page refault ratio is higher than before, the root cause is:
- {,de}compression flow needs to allocate intermediate pages to store
compressed data in cluster, so during their allocation, vm may reclaim
mmaped pages.
- if above reclaimed pages belong to compressed cluster, during its
refault, it may cause more intermediate pages allocation, result in
reclaiming more mmaped pages.
So this patch introduces a mempool for intermediate page allocation,
in order to avoid high refault ratio, by default, number of
preallocated page in pool is 512, user can change the number by
assigning 'num_compress_pages' parameter during module initialization.
Ma Feng found warnings in the original patch and fixed like below.
Fix the following sparse warning:
fs/f2fs/compress.c:501:5: warning: symbol 'num_compress_pages' was not declared.
Should it be static?
fs/f2fs/compress.c:530:6: warning: symbol 'f2fs_compress_free_page' was not
declared. Should it be static?
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Ma Feng <mafeng.ma@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>1 parent c1c6338 commit 5e6bbde
3 files changed
Lines changed: 52 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 68 | | |
78 | 69 | | |
79 | 70 | | |
| |||
476 | 467 | | |
477 | 468 | | |
478 | 469 | | |
479 | | - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
480 | 491 | | |
481 | 492 | | |
482 | 493 | | |
483 | | - | |
484 | | - | |
485 | | - | |
| 494 | + | |
486 | 495 | | |
| 496 | + | |
487 | 497 | | |
488 | 498 | | |
489 | 499 | | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
490 | 511 | | |
491 | 512 | | |
492 | 513 | | |
| |||
516 | 537 | | |
517 | 538 | | |
518 | 539 | | |
519 | | - | |
| 540 | + | |
520 | 541 | | |
521 | 542 | | |
522 | 543 | | |
| |||
561 | 582 | | |
562 | 583 | | |
563 | 584 | | |
564 | | - | |
| 585 | + | |
565 | 586 | | |
566 | 587 | | |
567 | 588 | | |
| |||
581 | 602 | | |
582 | 603 | | |
583 | 604 | | |
584 | | - | |
| 605 | + | |
585 | 606 | | |
586 | 607 | | |
587 | 608 | | |
| |||
1183 | 1204 | | |
1184 | 1205 | | |
1185 | 1206 | | |
1186 | | - | |
| 1207 | + | |
1187 | 1208 | | |
1188 | 1209 | | |
1189 | 1210 | | |
| |||
1344 | 1365 | | |
1345 | 1366 | | |
1346 | 1367 | | |
1347 | | - | |
| 1368 | + | |
1348 | 1369 | | |
1349 | 1370 | | |
1350 | 1371 | | |
| |||
1364 | 1385 | | |
1365 | 1386 | | |
1366 | 1387 | | |
1367 | | - | |
| 1388 | + | |
1368 | 1389 | | |
1369 | 1390 | | |
1370 | 1391 | | |
| |||
1386 | 1407 | | |
1387 | 1408 | | |
1388 | 1409 | | |
1389 | | - | |
1390 | | - | |
| 1410 | + | |
1391 | 1411 | | |
1392 | 1412 | | |
1393 | 1413 | | |
| |||
1396 | 1416 | | |
1397 | 1417 | | |
1398 | 1418 | | |
1399 | | - | |
| 1419 | + | |
1400 | 1420 | | |
1401 | 1421 | | |
1402 | 1422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3829 | 3829 | | |
3830 | 3830 | | |
3831 | 3831 | | |
| 3832 | + | |
| 3833 | + | |
3832 | 3834 | | |
3833 | 3835 | | |
3834 | 3836 | | |
| |||
3862 | 3864 | | |
3863 | 3865 | | |
3864 | 3866 | | |
| 3867 | + | |
| 3868 | + | |
3865 | 3869 | | |
3866 | 3870 | | |
3867 | 3871 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3879 | 3879 | | |
3880 | 3880 | | |
3881 | 3881 | | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
3882 | 3885 | | |
| 3886 | + | |
| 3887 | + | |
3883 | 3888 | | |
3884 | 3889 | | |
3885 | 3890 | | |
| |||
3907 | 3912 | | |
3908 | 3913 | | |
3909 | 3914 | | |
| 3915 | + | |
3910 | 3916 | | |
3911 | 3917 | | |
3912 | 3918 | | |
| |||
0 commit comments