From patchwork Tue Mar 26 17:10:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13604744 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 026FBC54E67 for ; Tue, 26 Mar 2024 17:11:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 458FC6B00A0; Tue, 26 Mar 2024 13:10:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BA5E6B00A1; Tue, 26 Mar 2024 13:10:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20CD86B00A2; Tue, 26 Mar 2024 13:10:55 -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 0AF856B00A0 for ; Tue, 26 Mar 2024 13:10:55 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D8895C0D77 for ; Tue, 26 Mar 2024 17:10:54 +0000 (UTC) X-FDA: 81939830028.26.806BCC7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP id 287E4A0008 for ; Tue, 26 Mar 2024 17:10:52 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Nv4zpwsI; dmarc=none; spf=none (imf15.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=1711473053; 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=FjUWHQrn4FbgqZDhW3tfi340RZXU1+nbifFSALnT85s=; b=FkEwZ+bbZQ/WAguhIsdRSsiXssqh98q7HaFridQ0e9m5pN7/tpbl6SfsLEw1A935WbcY38 KVdgImBtr1CMnKfyBFckZH1wULbyERTP97hrBXzKAJV+n81hk1ZUZ0u0p/DC+Y2GPXs9d6 rkkGL405ciwkDcm6w9kbFfZYKjA33ps= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Nv4zpwsI; dmarc=none; spf=none (imf15.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711473053; a=rsa-sha256; cv=none; b=S5iCLwmmed3xXHG+ZandkUXnDkqnr+K4qLPT+7w3s0TtHJ72GZ53SqPcrC9M3z2sgnWMWN wsO/3rDoYELPrwRsLTNACz+0uhX3LxRqDU1A9wOP/U+YtTOWt/vFhS0X5HO9ZXpuOA+nZG eH6kvzYMCnk60noh4dZS3rViBzD0JFE= 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=FjUWHQrn4FbgqZDhW3tfi340RZXU1+nbifFSALnT85s=; b=Nv4zpwsISRfvdUvqCXOaT2bEqG MNZxrIICQ6CVMZFFRajePmkRTL1loEtrFYnnNC4nH0PgeiVzl9VpNkRRevyZnkaVF4zqbsobHk3ho wOimlW1AAcXLTs7sGhhUZ8mJhh3xaZ31NV2uUISBGv/NDm33w4mTYC+iJzAVV2tSxdwx29krKmKQn Eg0KpAyWG39G74oRQXEI3SOkx9H+JPlOloxqvnlE3UUweyyms4ik+hAesK0EBuM5fM5ZmUefryZUB 6w26KxX+Sj22qnODxCdbWR1zgdrFd7U7+/L5ufLQBfKZR9fpwk7EsAKbFmmp85ysfBqBZFoSEz8ww p8gkV+zg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpAJz-00000001irz-3RMM; Tue, 26 Mar 2024 17:10:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH 01/10] sh: Remove use of PG_arch_1 on individual pages Date: Tue, 26 Mar 2024 17:10:23 +0000 Message-ID: <20240326171045.410737-2-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240326171045.410737-1-willy@infradead.org> References: <20240326171045.410737-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 287E4A0008 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: jm8gknsa3ykshmo766tx3kj83hxrrud7 X-HE-Tag: 1711473052-70041 X-HE-Meta: U2FsdGVkX1/eHwgdkiB6WzfWwCUzgYbaKLUwnrV2BP3B860T5gYON2w7N1TpCAVnYJG7b0XruJadfOe2i259QWlcpkZpbPBuOTT1jpRkIFR1eKfZ9kDZAbQqepFl9eRZoJLYA40lPYfQAe7E+kP0zKRgIXNMy/fcZQE2mupWPGT86YGdhIN/Qom/L58r4BQWJHhwkgYLqqX9EMTXI3uyPXl1Oe6R7rFHAub9MZOi+ZDT+NmkXpEFzqGQ1ect+zSdKp/eeT3sBs9/iUt4q9WZ9oVTAJFp0T+1cVD4bib9PlKJ7PoqiTQmFL2wNuUAIIOCpUlEsE/VLqWca0mM0vsOi3wWKEIm/mh37mfAq2HO/I4F/a9uuBJNC9kYWS9MEkrdh04UiAwfN6ROEDGKbsireg9r2de4RSnwNBwqWxtkCxzIKPpy4paBIZVdP9h6HtflqPPdfkpley/MrnClLDNoTew+zJp6t7XMsVzcaruRXiHyB/ki6MCb6fs3rdknFP1LUCWasLs8k5FFaPzG3LiJc9Ov2ZLnhzG93r4odq26I7OX5q6mgBmJK9ao9/CvOYcrbs5otDfUMvG26509e7/jiwwkd0pKU6Pq3WaPBEtK186d0pEafsIcE/lhxyIlYmiMueFJF+XICNiah8p3b5jEAN/kXNbqfYdzWBNHfrD43iHCSLtqcjYWIF+bRgpYwr8B8uzNSzWX80+AqwUYdEN9yf9xd0rY16Sb7fHyoqrnpiz+9iP/QUqcImPG+y+dBVS9It2cbGYe1tTSOppu4MX2XBCkSZ+FyKJQ7cFMb0yqdafi4vT3VmLjlA+dAdO9rLzFPazXS1P+NRyiwpMoORRscaCnsNXpNlOxMQvPZZTzKongC47NO87OC5eiijF0FVYI+NlT+edoRxhsMsb4F6l1/+sXTzZihXDjQKIQXJkprLjaTOph3615xvlMztyvyRh9D6KRop7jZvisvVrwrrH ZkLMgoZO HyXWP04YxcBPEJEXodf+DpaDoqY3IHsxy/blOj1w5x8rDjLnxtCygOazzEeANnEHF1Fi+7EEMtIoXf3QGMR4QQW615yZ5f7lFLfu8goJMclB7Yjqy6flWLp/2VM7aFe/XJcyI6pFBVnO0hTzWsYnA9EYsw7b47KDOFkSR0ZtWHGKRAvi1cFUH5RN2gpjFZfFrp8aP4VqYcOBQKJMe6Ql5i2h69Prbcs8aRuij 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: Since switching to the new page table range API, we do not set the PG_arch_1 (aka dcache clean) flag on tail pages, only on the folio. Test it on the folio. Also use page_mapped() instead of page_mapcount() as it is more efficient. Signed-off-by: Matthew Wilcox (Oracle) --- arch/sh/mm/cache-sh4.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index 862046f26981..cea8f1693908 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c @@ -241,13 +241,14 @@ static void sh4_flush_cache_page(void *args) if ((vma->vm_mm == current->active_mm)) vaddr = NULL; else { + struct folio *folio = page_folio(page); /* * Use kmap_coherent or kmap_atomic to do flushes for * another ASID than the current one. */ map_coherent = (current_cpu_data.dcache.n_aliases && - test_bit(PG_dcache_clean, &page->flags) && - page_mapcount(page)); + test_bit(PG_dcache_clean, folio_flags(folio)) && + page_mapped(page)); if (map_coherent) vaddr = kmap_coherent(page, address); else