Commit ab95d23
filemap: allocate mapping_min_order folios in the page cache
filemap_create_folio() and do_read_cache_folio() were always allocating
folio of order 0. __filemap_get_folio was trying to allocate higher
order folios when fgp_flags had higher order hint set but it will default
to order 0 folio if higher order memory allocation fails.
Supporting mapping_min_order implies that we guarantee each folio in the
page cache has at least an order of mapping_min_order. When adding new
folios to the page cache we must also ensure the index used is aligned to
the mapping_min_order as the page cache requires the index to be aligned
to the order of the folio.
Co-developed-by: Luis Chamberlain <[email protected]>
Signed-off-by: Luis Chamberlain <[email protected]>
Signed-off-by: Pankaj Raghav <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Tested-by: David Howells <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Reviewed-by: Matthew Wilcox (Oracle) <[email protected]>
Reviewed-by: Daniel Gomez <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>1 parent 84429b6 commit ab95d23
2 files changed
+36
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
451 | 471 | | |
452 | 472 | | |
453 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
| 862 | + | |
| 863 | + | |
862 | 864 | | |
863 | 865 | | |
864 | 866 | | |
| |||
1919 | 1921 | | |
1920 | 1922 | | |
1921 | 1923 | | |
1922 | | - | |
| 1924 | + | |
| 1925 | + | |
1923 | 1926 | | |
| 1927 | + | |
1924 | 1928 | | |
1925 | 1929 | | |
1926 | 1930 | | |
| |||
1943 | 1947 | | |
1944 | 1948 | | |
1945 | 1949 | | |
1946 | | - | |
| 1950 | + | |
1947 | 1951 | | |
1948 | 1952 | | |
1949 | 1953 | | |
| |||
1958 | 1962 | | |
1959 | 1963 | | |
1960 | 1964 | | |
1961 | | - | |
| 1965 | + | |
1962 | 1966 | | |
1963 | 1967 | | |
1964 | 1968 | | |
| |||
2447 | 2451 | | |
2448 | 2452 | | |
2449 | 2453 | | |
2450 | | - | |
| 2454 | + | |
2451 | 2455 | | |
2452 | 2456 | | |
2453 | 2457 | | |
2454 | 2458 | | |
| 2459 | + | |
| 2460 | + | |
2455 | 2461 | | |
2456 | | - | |
| 2462 | + | |
2457 | 2463 | | |
2458 | 2464 | | |
2459 | 2465 | | |
| |||
2471 | 2477 | | |
2472 | 2478 | | |
2473 | 2479 | | |
| 2480 | + | |
2474 | 2481 | | |
2475 | 2482 | | |
2476 | 2483 | | |
| |||
2531 | 2538 | | |
2532 | 2539 | | |
2533 | 2540 | | |
2534 | | - | |
2535 | | - | |
| 2541 | + | |
2536 | 2542 | | |
2537 | 2543 | | |
2538 | 2544 | | |
| |||
3748 | 3754 | | |
3749 | 3755 | | |
3750 | 3756 | | |
3751 | | - | |
| 3757 | + | |
| 3758 | + | |
3752 | 3759 | | |
3753 | 3760 | | |
| 3761 | + | |
3754 | 3762 | | |
3755 | 3763 | | |
3756 | 3764 | | |
| |||
0 commit comments