Commit f39b6e2d authored by Alex Shi (tencent)'s avatar Alex Shi (tencent) Committed by Andrew Morton

mm/ksm: use folio in remove_rmap_item_from_tree

To save 2 compound_head calls.

Link: https://lkml.kernel.org/r/20240411061713.1847574-3-alexs@kernel.orgSigned-off-by: default avatarAlex Shi (tencent) <alexs@kernel.org>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Izik Eidus <izik.eidus@ravellosystems.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent b91f9472
...@@ -1006,16 +1006,16 @@ static void remove_rmap_item_from_tree(struct ksm_rmap_item *rmap_item) ...@@ -1006,16 +1006,16 @@ static void remove_rmap_item_from_tree(struct ksm_rmap_item *rmap_item)
{ {
if (rmap_item->address & STABLE_FLAG) { if (rmap_item->address & STABLE_FLAG) {
struct ksm_stable_node *stable_node; struct ksm_stable_node *stable_node;
struct page *page; struct folio *folio;
stable_node = rmap_item->head; stable_node = rmap_item->head;
page = get_ksm_page(stable_node, GET_KSM_PAGE_LOCK); folio = ksm_get_folio(stable_node, GET_KSM_PAGE_LOCK);
if (!page) if (!folio)
goto out; goto out;
hlist_del(&rmap_item->hlist); hlist_del(&rmap_item->hlist);
unlock_page(page); folio_unlock(folio);
put_page(page); folio_put(folio);
if (!hlist_empty(&stable_node->hlist)) if (!hlist_empty(&stable_node->hlist))
ksm_pages_sharing--; ksm_pages_sharing--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment