From patchwork Wed Oct 2 15:25:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819962 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 97F57CF6D39 for ; Wed, 2 Oct 2024 15:25:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 82B624401B3; Wed, 2 Oct 2024 11:25:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B3BE6B00B1; Wed, 2 Oct 2024 11:25:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62F486B00DA; Wed, 2 Oct 2024 11:25:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 339B36B00B0 for ; Wed, 2 Oct 2024 11:25:45 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B3A7240976 for ; Wed, 2 Oct 2024 15:25:44 +0000 (UTC) X-FDA: 82629037008.13.2AB1D0A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 2305814000E for ; Wed, 2 Oct 2024 15:25:42 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cO2o10iZ; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727882614; 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=pEi1qecZjXYRKDQYodPf8d3r2tJklgFZpkjTV07YDYk=; b=6MlVsRo21V3f4AcJxWKYpQaGQ4i0ukWEVvlFqBJBGJSLF0g+oXd96ISUXMh4rRouMv6Tsd hBJl4DmuIzJwYfE+gxQUpss5yf1pE5/Q3JZ44d7NXDVNakTjYalAirurxgfmpgPRA2sGzR s0rOnc4isnblzEYwAMV+yumSDJ+u9og= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727882614; a=rsa-sha256; cv=none; b=oi9JlLH+HvrgBKlG5YWbCo8C5B9CmABIe5KxiSQndkTBvEaIJrFdQ6V9u48eTWAlfFXafu sVmXCfiwt0YUhmj80xTevFUM6kaC1cr6Dtbw5I8Pw1rirzeuQt7GNZIqMo/kOuAbS127Gw UTDpudGmbesKhYJOYo7bQXq7ZCBbfME= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cO2o10iZ; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=pEi1qecZjXYRKDQYodPf8d3r2tJklgFZpkjTV07YDYk=; b=cO2o10iZ0eOYzLLdMtLDsW+fcu F8TgbwVvwWa5rfNSs8Y9oIozj5lrb8+3/+EtdoYhCUaPo/8dS2sEiG6/s4SJpTv8O9Zle7p4S896c EapvE3ksKrKWexbVeap9OhHRUril6WBUc5GtaRB+TQUNnRmzEn+y94/KH0k4Dhegi4OxxPTCAI2gV vuuyVMqv0fs8dmEhAy08nEGyvSK1fQU4kgywnX8xsge7drbExien/ZHV+aZKEHEPoTvkspk6fiB8Z QFHGfwkPxr2Q3UlEQ1Pl1IEH8auE44csxs/QoGYC+brxRuOcMM3D7kXbuXGkXjntowWwuTA0iyNAD 3oOtzRMw==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1sw1EN-00000005fMu-2IQX; Wed, 02 Oct 2024 15:25:35 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Alex Shi Subject: [PATCH 5/5] mm: Remove PageKsm() Date: Wed, 2 Oct 2024 16:25:31 +0100 Message-ID: <20241002152533.1350629-6-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002152533.1350629-1-willy@infradead.org> References: <20241002152533.1350629-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: 5ckiwsfbb7o141m88ie51fxnwsm4o496 X-Rspamd-Queue-Id: 2305814000E X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1727882742-78017 X-HE-Meta: U2FsdGVkX19WwP1pgGM+vGo4/pCU92Swv7M67doaiORAN1+iFJJmfor3wFO4e4+pUDo7C1TH3px7w2VbP8XefWRojq1JiOIdrcC+HEPfPHiaKsqAZhnx4oTWlptWIW+I1v9NqvAemvbdUULuQr/X8mHoGN+Mr7Y5WkXuK9Z+Z/cnYTk5Xb/uSJiUop0VM0ft1FKeVWEUNUsgZ/dSxp6UC7gkMoJMxfiCw7KO2JBoXSG12qfnnzgH7K8pN1EOgnpi+yNOuOasNgXfGCcTT1Yl5tATvNM9vho6mbjg0wTxnyUU11HbeLS0RO3uB3KU0GK7mlYMRi3QHmda3dKdcgJ+M4JRx+k5m/9czPLZwPe6p7t5azuUSlAbotfwosUsqHYbswhUtGAYv6CE/BGHNHgCrGeZEBIhRV6GpsA9FWhMWHwrYM9aRpx7l01JDW4ImMyAH5IZv2rhM/EA2vekJK/d4Z7uCiejtCPfT4JB2tLE1CyCk+LmBntYtchHxPvariGskBSkLu31jOzETpXaWpjTorgJgd0n/e60twztDMOoQS5LJRt3boaHZUxBhxcOeROUPGjYCt/YyeqvbkRJO/flJn7vUJds+xqH1MqefqvN2rF3JaXBs0VCcIWTM8N4I07a6qtAZ8kEthbHbX7NW4Z/msrHEVZJY6qEOL09CvZdTroXfYIWhO9WrQ3PLE3yd8MbzRkiEmcGAJk1iB4EeNHuL4vAnRq/s7+aa0GVSS9AKw3g44hkMGPuYQ+oqtk5o6gJipo0HdjKFYSP3W84mXUpmhU/Brjk1O787Z66hTp19TDKnFIN1Ia00jNM0VX3c3lHLv5yNnWDkaxZ77PfzlozENdqsK6aXwjTDJ8gj9JEdBCa4yz2hiBiaMNqe/40SB1SHj+QksiQtCgPtwUBvALZJikyMZE/qKdYtKsoFJQ2EgeqYGiDt4Fu9dr1teL0suZINkCM1cjAo52CyYyCLGQ xbYmzQWn DtDlxjv+Rp0+j7RU5201wHhPzPkReKSKVKkLPs+ZDyKpwSefomOQpeo7SaxhafmdVCKOt89y5HrWAIOkvMvKpd1RYGPNx7fzQ3rFeB4crNadNfs6Tfy1UFEJdOOZR1Yb5lU2msAlIDR0vf+0oxHfSzoflGua/3sphMV/f3sy9AYLiCE9cBH3dZnOObmNvLLyArQ5IudEYbMebpzmNcWSD4hDfbEuDteDeijUexGBEc5h5S74= 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: List-Subscribe: List-Unsubscribe: All callers have been converted to use folio_test_ksm() or PageAnonNotKsm(), so we can remove this wrapper. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: David Hildenbrand --- include/linux/page-flags.h | 7 +------ mm/internal.h | 2 +- mm/ksm.c | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 157c4ffc2fdc..84746da35f79 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -725,13 +725,8 @@ static __always_inline bool folio_test_ksm(const struct folio *folio) return ((unsigned long)folio->mapping & PAGE_MAPPING_FLAGS) == PAGE_MAPPING_KSM; } - -static __always_inline bool PageKsm(const struct page *page) -{ - return folio_test_ksm(page_folio(page)); -} #else -TESTPAGEFLAG_FALSE(Ksm, ksm) +FOLIO_TEST_FLAG_FALSE(ksm) #endif u64 stable_page_flags(const struct page *page); diff --git a/mm/internal.h b/mm/internal.h index 93083bbeeefa..5099558c7500 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1311,7 +1311,7 @@ static inline bool gup_must_unshare(struct vm_area_struct *vma, smp_rmb(); /* - * Note that PageKsm() pages cannot be exclusive, and consequently, + * Note that KSM pages cannot be exclusive, and consequently, * cannot get pinned. */ return !PageAnonExclusive(page); diff --git a/mm/ksm.c b/mm/ksm.c index 1b8b43dc6ba7..e2068c73429b 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -657,7 +657,7 @@ static int break_ksm(struct vm_area_struct *vma, unsigned long addr, bool lock_v * * VM_FAULT_SIGBUS could occur if we race with truncation of the * backing file, which also invalidates anonymous pages: that's - * okay, that truncation will have unmapped the PageKsm for us. + * okay, that truncation will have unmapped the KSM page for us. * * VM_FAULT_OOM: at the time of writing (late July 2009), setting * aside mem_cgroup limits, VM_FAULT_OOM would only be set if the @@ -1435,7 +1435,7 @@ static int replace_page(struct vm_area_struct *vma, struct page *page, * try_to_merge_one_page - take two pages and merge them into one * @vma: the vma that holds the pte pointing to page * @page: the PageAnon page that we want to replace with kpage - * @kpage: the PageKsm page that we want to map instead of page, + * @kpage: the KSM page that we want to map instead of page, * or NULL the first time when we want to use page as kpage. * * This function returns 0 if the pages were merged, -EFAULT otherwise.