From patchwork Wed Oct 2 15:13:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819916 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 97DAFCF6D2D for ; Wed, 2 Oct 2024 15:14:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 16AF96B00E2; Wed, 2 Oct 2024 11:14:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 11BEE6B02D3; Wed, 2 Oct 2024 11:14:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F25E06B03C9; Wed, 2 Oct 2024 11:14:11 -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 CBAAF6B02D3 for ; Wed, 2 Oct 2024 11:14:11 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 600E21409B5 for ; Wed, 2 Oct 2024 15:14:11 +0000 (UTC) X-FDA: 82629007902.28.A9BD01A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf18.hostedemail.com (Postfix) with ESMTP id 47C281C001F for ; Wed, 2 Oct 2024 15:14:09 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QBCtk004; 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; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727881922; 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:references:dkim-signature; bh=flykXy9LqYFGtzaaECdeb9QtYjt+cj7Jin7jS7kxPlg=; b=tNyG7IU/+raTB5WYpVB+P6UK19RSUhmJKmxtdJx4HSsyyb8M/XJqLZx3+1OS7WO97rKTiV Mt77ddQSdikEKpQHYtaMSLCNC4liaJVfFpqbW8OE10xb7Y7B1yfAwbL4ASbPiyw7ImJRfw zs3a+LiyzdQtGTcKAFqcNq5dOwrDuhY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727881922; a=rsa-sha256; cv=none; b=g0NDni841AqhOZsRpB3Eo1gnIqO2qcsWkzV8v7wkPuMfRJdyYPSViig444X/Fh8assWRBv tMg/p+eomhCaSTB6PMRsTtXeGqQD9x/7r5o2LmzidazDZm3j3ui6hiW0cGtrcseJjdmbRp VUqw36SlAlwZ9y3hFaHRUD80p9VTVLE= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QBCtk004; 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; 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: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=flykXy9LqYFGtzaaECdeb9QtYjt+cj7Jin7jS7kxPlg=; b=QBCtk004YJyqDwjPMMY1vLv79J Q8C+IWgUyqpcpntwjWxOnAdviAEbanAbXvyY8S2f3mYN8c407AqeIGqRzOXI81CD+Dsckg+gbSmP7 u6qFyagsVm8+nnLq2DonZ7sf/wMT7oze1rGYS7jS5rFev0NYhnfKfrKl6unfRBGUb5Me54vg0hecw mSnB/kaD90y09EsXhN4whBYFJQVdNwssyJCWj8WGadICrCNZdCZkD4ucZpIV+JNlFX6LJ4BVxA3XO w7CSuynioTghnY4ymN58us/yZHM75iIdQuXsdNOx6E+vz+E0ZTWwZCSwhkKMsVO5ITLgUOvRDL+fK yLXST91Q==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1sw13F-00000005e0g-0mXB; Wed, 02 Oct 2024 15:14:05 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH] gup: Convert FOLL_TOUCH case in follow_page_pte() to folio Date: Wed, 2 Oct 2024 16:13:27 +0100 Message-ID: <20241002151403.1345296-1-willy@infradead.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: 47C281C001F X-Stat-Signature: 4ekz3i58db7mwygimk6yb3wma7diuqea X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1727882049-646050 X-HE-Meta: U2FsdGVkX18tU0bgzwrRvaq3UpechNLXTjco+8t/m+gi/RPsMKg5CDz5dIJLxgRO18gEA9TtG8LeN5R5G8rzikGuhbi1qc+u5l6U4Rx4qDwOT4n+TCYyyMEtuHCdqf6JmQWAIW+osh6wNRF9XZDOLr51DRZLCKal3MLCh3cIaKyRR6aMRfriH2tHdhWFvI7+UvZb5w+8u3EuDeLeNuGsGiHg3opO93C+bv9pk0ChH4Kzz6Bvmf+1YA8ggAV3QMKFPwFrroRPXI96y3i/JqdC1nwD2QIBBULnNl7PoZjDzSXH1dRIi9CmPE5PxZphrylY8Y+V5LzudvSwL3CKr2EsjJQ63VGYoC5aTqESICHNKGfdmDILtrwX+XJOCPpxX6FpB1H2kYIuLt3p+gOmXQundJT0YYVhrCS+DVJPkH2X8kyX0idEGWSLS/guWu7a/bNKp4ky8eyLP5aOvg4piJdWQ6tDyG5JI+u428nDMb9aB6WeKv00LDFxZz7+sAJZeM0yFDZWAMqh5JhQb2u+qBlmgJqd2vJ0hwkj31km2LTXStW0eWH0fMUf9/0wCKVSMSZ9H7BOz98oLi9VPd23ai9PQdz/kh5oTVGA+1tLffVqIenCjlLOwaj1sHT8S8cHv14yyJybzpAAFvVs5hHOrgzdC/aNlwQ4iwOhXkfgBQtxRZjQU/fayWqsYgCiJ8BzZVqe4gAiXR4kYdUlZEAsgvV4RX/QMd7MaZq8fv0niK4KND4IW8sDpebX6FKXCciW1Gkk9cRkUjcis1MS21HATmZqTRnD1ULwpGAhChGrl8EE+aI3Ro/sfDrp6xw9uAolGYf5Da5wXvJafeiwSpUk+KBcBN1nDl3gv8W8Ii1UQJ0pboEtD6InvaPcB7hbjAmb3W+l92ZGLNt3RkxVdMnIkiNCsEh/IiXrG23tyMsMuRxcQo22fMm7cCax5LR3CGHCUCkHcoyxZG1jRiQEDW5BWU7 /nEc9V+Y hC7qy4rOuvEbijTRoC0BczEkLGbg0BFrN3oW0gy78DTDbqH7YyfJi92x4hlLLA8fjiOAVS2lXQPoZ7vRmEN0BtkbNtZR/ISG1zKKP1srZw9j8g6PE3idH3d2LrmGFaUjZ43kBIQQj4axTQESINt37ROGeTX8pdHqH6P9wywvHfcBn36+l/r9CMzlRYprd9i3IUlv4V3fEgfZKxt5QeRzBlMugXuX3+7w9h/7enisVRI8rUdgybfhYpJ8ohxGRjxM7neieR8YqmF6UddHaTjbjoU6yCJxW4hC7n8llRSjF9guhiT5J28aZ5weasg== 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: We already have the folio here, so just use it, removing three hidden calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Acked-by: David Hildenbrand --- mm/gup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index a82890b46a36..7aecaa5ff6f3 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -922,14 +922,14 @@ static struct page *follow_page_pte(struct vm_area_struct *vma, } if (flags & FOLL_TOUCH) { if ((flags & FOLL_WRITE) && - !pte_dirty(pte) && !PageDirty(page)) - set_page_dirty(page); + !pte_dirty(pte) && !folio_test_dirty(folio)) + folio_mark_dirty(folio); /* * pte_mkyoung() would be more correct here, but atomic care * is needed to avoid losing the dirty bit: it is easier to use - * mark_page_accessed(). + * folio_mark_accessed(). */ - mark_page_accessed(page); + folio_mark_accessed(folio); } out: pte_unmap_unlock(ptep, ptl);