Re: [PATCH v1] mm/readahead: Do not allow order-1 folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 01, 2023 at 04:10:45PM +0000, Ryan Roberts wrote:
> The THP machinery does not support order-1 folios because it requires
> meta data spanning the first 3 `struct page`s. So order-2 is the
> smallest large folio that we can safely create.
> 
> There was a theoretical bug whereby if ra->size was 2 or 3 pages (due to
> the device-specific bdi->ra_pages being set that way), we could end up
> with order = 1. Fix this by unconditionally checking if the preferred
> order is 1 and if so, set it to 0. Previously this was done in a few
> specific places, but with this refactoring it is done just once,
> unconditionally, at the end of the calculation.
> 
> This is a theoretical bug found during review of the code; I have no
> evidence to suggest this manifests in the real world (I expect all
> device-specific ra_pages values are much bigger than 3).
> 
> Signed-off-by: Ryan Roberts <ryan.roberts@xxxxxxx>

It's better code anyway!

Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux