mm: Turn putback_lru_page() into folio_putback_lru()
Add a putback_lru_page() wrapper. Removes a couple of compound_head() calls. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
06d20bdb98
commit
ca6d60f3f1
@ -159,3 +159,8 @@ int isolate_lru_page(struct page *page)
|
||||
return -EBUSY;
|
||||
return folio_isolate_lru((struct folio *)page);
|
||||
}
|
||||
|
||||
void putback_lru_page(struct page *page)
|
||||
{
|
||||
folio_putback_lru(page_folio(page));
|
||||
}
|
||||
|
@ -154,7 +154,8 @@ extern unsigned long highest_memmap_pfn;
|
||||
*/
|
||||
int isolate_lru_page(struct page *page);
|
||||
int folio_isolate_lru(struct folio *folio);
|
||||
extern void putback_lru_page(struct page *page);
|
||||
void putback_lru_page(struct page *page);
|
||||
void folio_putback_lru(struct folio *folio);
|
||||
extern void reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason);
|
||||
|
||||
/*
|
||||
|
16
mm/vmscan.c
16
mm/vmscan.c
@ -1357,18 +1357,18 @@ int remove_mapping(struct address_space *mapping, struct page *page)
|
||||
}
|
||||
|
||||
/**
|
||||
* putback_lru_page - put previously isolated page onto appropriate LRU list
|
||||
* @page: page to be put back to appropriate lru list
|
||||
* folio_putback_lru - Put previously isolated folio onto appropriate LRU list.
|
||||
* @folio: Folio to be returned to an LRU list.
|
||||
*
|
||||
* Add previously isolated @page to appropriate LRU list.
|
||||
* Page may still be unevictable for other reasons.
|
||||
* Add previously isolated @folio to appropriate LRU list.
|
||||
* The folio may still be unevictable for other reasons.
|
||||
*
|
||||
* lru_lock must not be held, interrupts must be enabled.
|
||||
* Context: lru_lock must not be held, interrupts must be enabled.
|
||||
*/
|
||||
void putback_lru_page(struct page *page)
|
||||
void folio_putback_lru(struct folio *folio)
|
||||
{
|
||||
lru_cache_add(page);
|
||||
put_page(page); /* drop ref from isolate */
|
||||
folio_add_lru(folio);
|
||||
folio_put(folio); /* drop ref from isolate */
|
||||
}
|
||||
|
||||
enum page_references {
|
||||
|
Loading…
x
Reference in New Issue
Block a user