[PATCH v3 13/18] mm/huge_memory: drop the unused do_lru argument of the file split helper
Kairui Song <[email protected]>
| Newsgroups | org.kernel.feeds.b4-sent,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
The only caller of __folio_split_unmap_and_freeze_file() always passes do_lru as true, so the argument and the branches gated on it are dead code. Drop it. Signed-off-by: Kairui Song <[email protected]> --- mm/huge_memory.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 72b364a90062..84c6e4bbaa88 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -4087,8 +4087,6 @@ static int __folio_split_unmap_and_freeze(struct folio *folio, unsigned int new_ * smallest order of the after-split folios (non-uniform split) * @split_at: in non-uniform split, the folio containing @split_at is split * until its order becomes @new_order - * @do_lru: if true, add after-split folios to @list if non NULL, otherwise to - * the LRU list * @list: after-split folios will be put on it if non NULL * @split_type: perform uniform split or not (non-uniform split) * @@ -4100,8 +4098,8 @@ static int __folio_split_unmap_and_freeze(struct folio *folio, unsigned int new_ * is returned, @folio might be split but not to @new_order) */ static int __folio_split_unmap_and_freeze_file(struct folio *folio, unsigned int new_order, - struct page *split_at, bool do_lru, - struct list_head *list, enum split_type split_type) + struct page *split_at, struct list_head *list, + enum split_type split_type) { struct address_space *mapping = folio->mapping; XA_STATE(xas, &mapping->i_pages, folio->index); @@ -4196,9 +4194,7 @@ static int __folio_split_unmap_and_freeze_file(struct folio *folio, unsigned int } /* lock lru list/PageCompound, ref frozen by page_ref_freeze */ - if (do_lru) - lruvec = folio_lruvec_lock(folio); - + lruvec = folio_lruvec_lock(folio); ret = __split_frozen_folio(folio, new_order, split_at, &xas, mapping, split_type); @@ -4220,8 +4216,7 @@ static int __folio_split_unmap_and_freeze_file(struct folio *folio, unsigned int folio_ref_unfreeze(new_folio, folio_cache_ref_count(new_folio) + 1); - if (do_lru) - lru_add_split_folio(folio, new_folio, lruvec, list); + lru_add_split_folio(folio, new_folio, lruvec, list); /* Add the new folio to the page cache. */ if (new_folio->index < end) { @@ -4247,9 +4242,7 @@ static int __folio_split_unmap_and_freeze_file(struct folio *folio, unsigned int * and its caller can see stale page cache entries. */ folio_ref_unfreeze(folio, folio_cache_ref_count(folio) + 1); - - if (do_lru) - lruvec_unlock(lruvec); + lruvec_unlock(lruvec); fail: /* * If we want to use try_to_migrate() on file in unmap_folio, @@ -4333,7 +4326,7 @@ static int __folio_split(struct folio *folio, unsigned int new_order, false, list, split_type); else ret = __folio_split_unmap_and_freeze_file(folio, new_order, split_at, - true, list, split_type); + list, split_type); /* * Unlock all after-split folios except the one containing -- 2.55.0