lkml.org 
[lkml]   [2021]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 43/46] mm/filemap: Add filemap_add_folio
On Wed, Jun 23, 2021 at 01:30:04PM +0200, Christoph Hellwig wrote:
> On Tue, Jun 22, 2021 at 01:15:48PM +0100, Matthew Wilcox (Oracle) wrote:
> > Pages being added to the page cache should already be folios, so
> > just cast the page to a folio in the add_to_page_cache_lru() wrapper.
> > Saves 96 bytes of text.
>
> modulo the casting:

ok. Moved add_to_page_cache_lru() into folio-compat.c, added the call
to page_folio() and also added:

if (!huge) {
+ VM_BUG_ON_FOLIO(index & (folio_nr_pages(folio) - 1), folio);
error = folio_charge_cgroup(folio, current->mm, gfp);

as we don't want pages added at an unaligned index in the file.

> Reviewed-by: Christoph Hellwig <hch@lst.de>

\
 
 \ /
  Last update: 2021-06-25 03:59    [W:0.521 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site