From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FFC6C6FA83 for ; Fri, 2 Sep 2022 19:48:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 05B428010D; Fri, 2 Sep 2022 15:47:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F0D680101; Fri, 2 Sep 2022 15:47:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03FF48010D; Fri, 2 Sep 2022 15:47:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 39D7080110 for ; Fri, 2 Sep 2022 15:47:05 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1B7A114064B for ; Fri, 2 Sep 2022 19:47:05 +0000 (UTC) X-FDA: 79868178810.07.F4340FC Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf18.hostedemail.com (Postfix) with ESMTP id D58FF1C0049 for ; Fri, 2 Sep 2022 19:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=D+82vubFJc6QJAVdIZ51p+s82tMbkawAG6VALT75iy8=; b=hoGHrcbUJ8AVq95ISK5ChGP7AJ A1hzOlFO7lBV6m1Xux6UHy8ZxmnbgHGP0A95uJY5dFfgNMG6Qa4OnZLdBsPm9Am6CbAfbwZrlCjgQ vokjDbHe2yqMPxwqAgTGyMDjF/ZSvwPp5YAtjNqezp4ntfhsFz6/5ae4EXUYHEujx65acaxZrtAWh JFOJNsvxI+kUJ/fwSfJgkboui5gu6Qfk7GAGdhZfnYIzQLoMyvJ+vwPPFo79kBX+2DUTEOWVzmfoN aLBhsJqKvbFHno4O03wrqDLsQdzTBHxU8SEkhvaWnCIxe6yiejk3DQ40qAIa8T+KXLjVgLoR2U9h5 mz9/8xdA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oUCd6-007IiR-GT; Fri, 02 Sep 2022 19:47:04 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH v2 53/57] huge_memory: Convert unmap_page() to unmap_folio() Date: Fri, 2 Sep 2022 20:46:49 +0100 Message-Id: <20220902194653.1739778-54-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220902194653.1739778-1-willy@infradead.org> References: <20220902194653.1739778-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662148024; a=rsa-sha256; cv=none; b=P2Rg7SwocqfNIewFgpWQYiW9p7qJOaeZRHJRadv8PcOgzSpHIXTyMNYiLlAhaESX2+ZJp9 zcBqcybEKMBxvYq+QKhfdqXS/lytjitPmdg7OEOqwRYvzvfIb/3Z4JJahUK4xUx1ChhBUS D2xJQxK/+hTUqf6nA95c7MPwi7pbFjo= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=hoGHrcbU; dmarc=none; spf=none (imf18.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662148024; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=D+82vubFJc6QJAVdIZ51p+s82tMbkawAG6VALT75iy8=; b=EN7Hyk7vq1mKcqsvU284rjrJi4B+wglZ9v4/IvKwqK9eUquWjgdX627ePtO6TgCe1BdrP2 E+nu13nwyJpVQ464Xzlb4bC0Haf/E9GPM/0XeYGoPYGC2M3szgq97LTgTiqJ7QPnFx5Ukm U32fHl2PlJPezt8ir4qWroKxpnHYK2k= X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D58FF1C0049 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=hoGHrcbU; dmarc=none; spf=none (imf18.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspam-User: X-Stat-Signature: 8pi18kbce1iescwo44c4r6x6fbcec3mc X-HE-Tag: 1662148024-640125 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Remove a folio->page->folio conversion. Signed-off-by: Matthew Wilcox (Oracle) --- mm/huge_memory.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 366519eb2af8..4e76b3c760ac 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2348,13 +2348,12 @@ void vma_adjust_trans_huge(struct vm_area_struct *vma, } } -static void unmap_page(struct page *page) +static void unmap_folio(struct folio *folio) { - struct folio *folio = page_folio(page); enum ttu_flags ttu_flags = TTU_RMAP_LOCKED | TTU_SPLIT_HUGE_PMD | TTU_SYNC; - VM_BUG_ON_PAGE(!PageHead(page), page); + VM_BUG_ON_FOLIO(!folio_test_large(folio), folio); /* * Anon pages need migration entries to preserve them, but file @@ -2371,7 +2370,7 @@ static void remap_page(struct folio *folio, unsigned long nr) { int i = 0; - /* If unmap_page() uses try_to_migrate() on file, remove this check */ + /* If unmap_folio() uses try_to_migrate() on file, remove this check */ if (!folio_test_anon(folio)) return; for (;;) { @@ -2421,7 +2420,7 @@ static void __split_huge_page_tail(struct page *head, int tail, * for example lock_page() which set PG_waiters. * * Note that for mapped sub-pages of an anonymous THP, - * PG_anon_exclusive has been cleared in unmap_page() and is stored in + * PG_anon_exclusive has been cleared in unmap_folio() and is stored in * the migration entry instead from where remap_page() will restore it. * We can still have PG_anon_exclusive set on effectively unmapped and * unreferenced sub-pages of an anonymous THP: we can simply drop @@ -2682,7 +2681,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) } /* - * Racy check if we can split the page, before unmap_page() will + * Racy check if we can split the page, before unmap_folio() will * split PMDs */ if (!can_split_folio(folio, &extra_pins)) { @@ -2690,7 +2689,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) goto out_unlock; } - unmap_page(&folio->page); + unmap_folio(folio); /* block interrupt reentry in xa_lock and spinlock */ local_irq_disable(); -- 2.35.1