From patchwork Mon Jul 29 18:38:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13745582 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 AE103C3DA4A for ; Mon, 29 Jul 2024 18:39:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 344B56B0095; Mon, 29 Jul 2024 14:39:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F5076B0096; Mon, 29 Jul 2024 14:39:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1966C6B0098; Mon, 29 Jul 2024 14:39:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id E5C766B0095 for ; Mon, 29 Jul 2024 14:39:17 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5BDA91A01E9 for ; Mon, 29 Jul 2024 18:39:17 +0000 (UTC) X-FDA: 82393652754.26.00E701B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id A5A1A18000C for ; Mon, 29 Jul 2024 18:39:15 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NaMN5A4l; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf24.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722278315; a=rsa-sha256; cv=none; b=EqCCZ3XQ2G7vWQ3C+uS5KfU0lzREm6XDfzsc4aNrS2cCihWhSZ2q7BLtJTaCR/tP+QRZrX nFr6CjQau5u/vUYP7ZYlxYDAe8T2i3qnva350IGq4BVwE9VgyZdwvrh1LiQlJ4R8rGt1pb Rnr6pUU0nmz37AcwSfvvU2/mw/ZmcU4= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NaMN5A4l; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf24.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722278315; 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=1LweK4YyrJ+GH/WLrm8oiFvHfSVbn4+ENVtw/AVp5dM=; b=7jHTLkD0q7yEHrcX6BKAY/kKGVWfD00G5p/hqMnkYqbj+oHl8YBFgj6vYodOLX8sA0JOHr RPsB5Lylr5YYZLweWEaKpm2eNdu7014Qko++hdaiDYx5JLRzKN17n9qKT1l0dL9M47lUfR o1M/U1l6PGXgO+j9ouJBvOkTqV1IbDM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722278355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1LweK4YyrJ+GH/WLrm8oiFvHfSVbn4+ENVtw/AVp5dM=; b=NaMN5A4l7ehUyIHlE4TYPa+bDhK0Lfihd6KwnyN7Yk7rUEAT56zAedEI02VzO7P15F7uNo vSapc5CdL8yCwyDQu1A730m+PfTC1Ak03UieXXiJheBR/N0TeaKpLKQKmeFdiAE2+sLLzN 5eYa7HZqaAP5fLaDMrKcsLsUL/F+qrA= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-673-8Qug9MJyOh6RXOQYIceWMA-1; Mon, 29 Jul 2024 14:39:09 -0400 X-MC-Unique: 8Qug9MJyOh6RXOQYIceWMA-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B279A1955F49; Mon, 29 Jul 2024 18:39:07 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.25]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5CA481955D45; Mon, 29 Jul 2024 18:38:59 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, David Hildenbrand , Andrew Morton , Matthew Wilcox , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Janosch Frank , Claudio Imbrenda Subject: [PATCH v1 1/3] mm: simplify arch_make_folio_accessible() Date: Mon, 29 Jul 2024 20:38:42 +0200 Message-ID: <20240729183844.388481-2-david@redhat.com> In-Reply-To: <20240729183844.388481-1-david@redhat.com> References: <20240729183844.388481-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspamd-Queue-Id: A5A1A18000C X-R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+BjMZMNTmfy5J 2kazv0tr KYGt0nqDTVTu1y42YvgHj+JfexuR9PKJb4tXr0lCQDf6CEx8xKMObZBj12kZgX1Hunhvl7Y1q4wjrCPGdf58aHfM7iOHa1+KFs4+vaixM6Z/Ru1WwgS1kcPihun5IPvKhNb7RfFvN+TYSDyBhKWbAq6W+adtRJmNR7KxiEJ3JBwh8A4YdQ5w0ZBqp76KvpRLjLVaaI5RISpLWCXDGo46JRVZepkisUMOJxieUlTKjXYhSz06UkcAHVNcj7sJ3EAAfzd6irr4DPiM2B07LJlYkyW+IgZzqXz2mtJoMww0w3eZGzrLO2bqYs/qQrIZBkjWSsTdadW66fVYH5cV2bD0mYZxh7w== 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: Now that s390x implements HAVE_ARCH_MAKE_FOLIO_ACCESSIBLE, let's turn generic arch_make_folio_accessible() into a NOP: there are no other targets that implement HAVE_ARCH_MAKE_PAGE_ACCESSIBLE but not HAVE_ARCH_MAKE_FOLIO_ACCESSIBLE. Signed-off-by: David Hildenbrand --- include/linux/mm.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 381750f41767a..bab689ec77f94 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2215,16 +2215,7 @@ static inline int arch_make_page_accessible(struct page *page) #ifndef HAVE_ARCH_MAKE_FOLIO_ACCESSIBLE static inline int arch_make_folio_accessible(struct folio *folio) { - int ret; - long i, nr = folio_nr_pages(folio); - - for (i = 0; i < nr; i++) { - ret = arch_make_page_accessible(folio_page(folio, i)); - if (ret) - break; - } - - return ret; + return 0; } #endif From patchwork Mon Jul 29 18:38:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13745583 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 B117AC3DA61 for ; Mon, 29 Jul 2024 18:39:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BA046B0098; Mon, 29 Jul 2024 14:39:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36B3E6B0099; Mon, 29 Jul 2024 14:39:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 231746B009A; Mon, 29 Jul 2024 14:39:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 057476B0098 for ; Mon, 29 Jul 2024 14:39:22 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 86463A05B8 for ; Mon, 29 Jul 2024 18:39:22 +0000 (UTC) X-FDA: 82393652964.20.E05EEC8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id D5E0A1C0015 for ; Mon, 29 Jul 2024 18:39:20 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Y1X7yEQA; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722278318; 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=exvRAG2tHq6VgTaD/fmuS7ZLph4K5zUJO/hhwy+FasE=; b=Dvw5J6fOFM8mydrRBgahG1yXIAvKZohjqo51rbCEEwEVHuJDye9CrWaRLuAPMSSOlKBPaj Yl0UC0DUmkYCcl9QX35rIzpM95D+XVg3SiMeNaC4EJlzPJt5fZEBaGKOSPFs1JsRvsh7Uj LPjVE4lv3Jb+6MaTTlw8emOfhyYT1Gc= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Y1X7yEQA; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722278318; a=rsa-sha256; cv=none; b=lQkERHTLR+iiI6HIeNnsclcxZ2lE3iZvqJX0qiFOysDIj1Phatz3TZJumqay0qqZWf6j+6 Ur78usdrkutSSa3iYqqHy/jrjoMM5lMp0nsI9xm9z+SPKdNeow3RtgZjKBWlx3PrgPPWBN TG6aYx6NSKbj8ot9vI0I2oGL53XY4RU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722278360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=exvRAG2tHq6VgTaD/fmuS7ZLph4K5zUJO/hhwy+FasE=; b=Y1X7yEQAJBeTsJOUGjWBmDWbQY8nJI66rlBAK5d3fsZ5F33zsPpnUu0Rtrt8TATAecrqAK NqvEkFKQQ6XofaRGGpk+a9ywAGwXBzXf6TCzP7Qn+otuoWj8MkYFuItfKLVqxc/E6CIa/w MTM9FUiJx6zEFgSQkpesKw+TymmoBG0= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-157-8rBTIKH0MemeRNuEhQNSCw-1; Mon, 29 Jul 2024 14:39:15 -0400 X-MC-Unique: 8rBTIKH0MemeRNuEhQNSCw-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6FB9A1956064; Mon, 29 Jul 2024 18:39:13 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.25]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 079E61955D45; Mon, 29 Jul 2024 18:39:07 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, David Hildenbrand , Andrew Morton , Matthew Wilcox , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Janosch Frank , Claudio Imbrenda Subject: [PATCH v1 2/3] mm/gup: convert to arch_make_folio_accessible() Date: Mon, 29 Jul 2024 20:38:43 +0200 Message-ID: <20240729183844.388481-3-david@redhat.com> In-Reply-To: <20240729183844.388481-1-david@redhat.com> References: <20240729183844.388481-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Stat-Signature: 4kmfyiq33of8q955ughgwucih5u3k5qw X-Rspam-User: X-Rspamd-Queue-Id: D5E0A1C0015 X-Rspamd-Server: rspam02 X-HE-Tag: 1722278360-214110 X-HE-Meta: U2FsdGVkX1/m/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bPmkP3+UU8cQMS7iELA3rmA6edxTKszIhf+Y8qGlbxQhwX6sef0TEtsLLXG5N726/2gMaMQEXcJUYrMfCQnCJm+r2dROADKwTZqW0GvWe4P3cXaZbEZ4mZfpldZelMD1DiXMfuE4DjajjA4C+KQVej5vaeF2ZYM0Ko2OXpbtmKHDCz8QcjokZaLMy+rB7WAXLStSul8mzwMSp6z9HK5Rck1iNjRr2/RxLOnP27fmRtzZXQ9eqQ== 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: Let's use arch_make_folio_accessible() instead so we can get rid of arch_make_page_accessible(). Signed-off-by: David Hildenbrand --- mm/gup.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 120740cf5a348..3e8484c893aa8 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -819,6 +819,7 @@ static struct page *follow_page_pte(struct vm_area_struct *vma, struct dev_pagemap **pgmap) { struct mm_struct *mm = vma->vm_mm; + struct folio *folio; struct page *page; spinlock_t *ptl; pte_t *ptep, pte; @@ -876,6 +877,7 @@ static struct page *follow_page_pte(struct vm_area_struct *vma, goto out; } } + folio = page_folio(page); if (!pte_write(pte) && gup_must_unshare(vma, flags, page)) { page = ERR_PTR(-EMLINK); @@ -886,7 +888,7 @@ static struct page *follow_page_pte(struct vm_area_struct *vma, !PageAnonExclusive(page), page); /* try_grab_folio() does nothing unless FOLL_GET or FOLL_PIN is set. */ - ret = try_grab_folio(page_folio(page), 1, flags); + ret = try_grab_folio(folio, 1, flags); if (unlikely(ret)) { page = ERR_PTR(ret); goto out; @@ -898,7 +900,7 @@ static struct page *follow_page_pte(struct vm_area_struct *vma, * Documentation/core-api/pin_user_pages.rst for details. */ if (flags & FOLL_PIN) { - ret = arch_make_page_accessible(page); + ret = arch_make_folio_accessible(folio); if (ret) { unpin_user_page(page); page = ERR_PTR(ret); @@ -2919,7 +2921,7 @@ static int gup_fast_pte_range(pmd_t pmd, pmd_t *pmdp, unsigned long addr, * details. */ if (flags & FOLL_PIN) { - ret = arch_make_page_accessible(page); + ret = arch_make_folio_accessible(folio); if (ret) { gup_put_folio(folio, 1, flags); goto pte_unmap; From patchwork Mon Jul 29 18:38:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13745584 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 975C5C3DA61 for ; Mon, 29 Jul 2024 18:39:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31DAE6B009A; Mon, 29 Jul 2024 14:39:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CD7C6B009B; Mon, 29 Jul 2024 14:39:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1968C6B009C; Mon, 29 Jul 2024 14:39:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EF8746B009A for ; Mon, 29 Jul 2024 14:39:33 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9983F14055E for ; Mon, 29 Jul 2024 18:39:33 +0000 (UTC) X-FDA: 82393653426.02.36C17DA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id EABFF1A000C for ; Mon, 29 Jul 2024 18:39:31 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YwyMUAFi; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722278344; a=rsa-sha256; cv=none; b=tooZFUVz1PtzJv/Fc3usgGBHoBNkBpnyP+Zt1DJThoRAB+H7H+8ZHyYvyw1BxBrhcNqoqL DQIK13DbHtNyp8APj4sKSUp2FbgcBZ3mJRKH+pMH7LnAzsVT40PeYxqANzaf2zGUtBc1si sG+fJVa3VqlDB88TRJRP7d2J5cQNkmg= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YwyMUAFi; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722278344; 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=9H38+PlxDPb0B2kVTxHGHrLppqPJ/7ePtq7mF29j+5Q=; b=k2t/WSwxg1q9oRUUGQX5KEmzCUc54D6KvtHN51GRbyyav7oRur/rS8Ca6R7w6zxV7g0h7Z CPYIozEQEIQD9AjcKXgic56Dbi5GnINjqR5JFJXCUavR75/B/qMdYpgsEtJoqkcCWrkR4E OuI/wLWJURx/o8fZk72YGcNm/aJUQns= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722278371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9H38+PlxDPb0B2kVTxHGHrLppqPJ/7ePtq7mF29j+5Q=; b=YwyMUAFiqHaIjAfSSdi9ADnLGQlliCC1azpqqR29gxVdqaxueDRmXtkK/mxZjoAZSTyuiT ZMAMPq0pwuHxVztQxRE/SV0y7wIXMORWACuf+Ojn9ok0n33e+IK3sjOnF0QZO4/jw3WvDP 7zxetUfuDZkGrEeG75gV3gqWMOPLnDY= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-TyEAJ39yMBCJknv_CsRGMA-1; Mon, 29 Jul 2024 14:39:22 -0400 X-MC-Unique: TyEAJ39yMBCJknv_CsRGMA-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8C61E19560A1; Mon, 29 Jul 2024 18:39:19 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.25]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5EF6D1955D42; Mon, 29 Jul 2024 18:39:13 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, David Hildenbrand , Andrew Morton , Matthew Wilcox , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Janosch Frank , Claudio Imbrenda Subject: [PATCH v1 3/3] s390/uv: drop arch_make_page_accessible() Date: Mon, 29 Jul 2024 20:38:44 +0200 Message-ID: <20240729183844.388481-4-david@redhat.com> In-Reply-To: <20240729183844.388481-1-david@redhat.com> References: <20240729183844.388481-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Stat-Signature: 1wpezqqww5bnawnrdhy6yhehu74jpk3d X-Rspamd-Queue-Id: EABFF1A000C X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722278371-249631 X-HE-Meta: U2FsdGVkX1+hNp1oX4tXLdF/yQ1/mr+bitlV1vumZxj1Yevy58qFh4RqPDQL3MJJ6EVt8lrQAsoSP+8kyAbmbPhQqKFffig1AIrsoXtafbUF6YQQ9r101FhHJAtd+VGoNSzO/5Gtz129E/WvlIDr5nrSXeOgTtvsBU4BoEN4NARDs0jTvDth+x1OglSaWtLP6f6Jwwj8ukyDu7CT+08gIcfGhG6/wGu86H8KWGMxVtDJ1sSnbXt/EPSWOyloRTU/7METOJJngvdfwKZOFWGpDfcJ6eult/vzsYSVG0/GWvaQ2hoDzu55HTOW8TY4OCVm0d/bIZCcLW1t5+YGycxUzsr59qMXUePN/Dc1mwBAA7ZjVjO/d7zuHGMHOyiC9CuuVXeBiwOwn+yj330N/uISmvS1AwOB+RTrZUqxfQjFJ3LoaCjNv4zNcDKKg7v8hJlHIA9NDTDdJZV6cslBYrD3wup+CMVA20a4eMDSsVzeAmgNC+Qmdyb6WYLK7/svYxyeiEl5EdQEUTFNoxWIhU/ud7k5a0hy9hW54QGH6Bqc3kt2fIAi00y/gvdCvSr3ttauMbBcTfanmTKJ99+hy0e1omfT7DzYosN4YNP5a5Iydt4HqsC9cRKWMErA53SQQHBfc2DNatKLPaYDOzqYP0lf1sqbPJFAkvcL4Ps1s6TC40YyEiL+Bgc8SjRQY0fy/U/DgVl474LWlqX4AsJzKaE1v5N5/CN0sg9JbrRlsajpD8/3uof6xLp2BXBJ+n6dnQHYjOT9j8CIhHvfYsfh5VemgRgp0mT6xPW0yAmnomYUI5+zNlr6CoRaGjeFKtoCW7SzxJoqMwSiOnObQNOJrI5ce9XVvxqM27GGlkS3fObjkIKkxcpXKHWNpBThcRiGwTJPDgjA44byrmpMjvlTdQ7PD2HmkyKWXFmtSPxPvTiFxsdLfp7FKRbHReyL9pD7hiG+WiYfAky90x57/4kbuH5 ELiYQ3FG n4JCe05zre6G2oXcOd2+ORWV8YVKqFL+sqnKarQUH6yetKY0GcqHJqDEjYSop2AxnFu0NUQhiUdaq/s3gR4k0G2iJOV0CxsWZc6ZfNarANUzqqAKBUxjLcTFbLGMZtJeM/jtnxZSwt3Rkh19Zmm51GqBhW6rpQq2GlgIR28IkyiRgAWcYtRAam/jsHvDogMADWM4GJDZ0ssCDbsKo3RiRBp+VXgwVnUivm4KqJ8IO0bL/XB0Z3orFKO4AIPBbGlAtFxlzCWTJfhRR0FM3LIqu74oMmanLoXC28E9duE0f0oUX7dfApsUVVjz+hfANthaoPkx/wjGBGOBiGIvP4qAi/ZQO52y2v+mYn+BU 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 code was converted to using arch_make_folio_accessible(), let's drop arch_make_page_accessible(). Signed-off-by: David Hildenbrand --- arch/s390/include/asm/page.h | 2 -- arch/s390/kernel/uv.c | 5 ----- include/linux/mm.h | 7 ------- 3 files changed, 14 deletions(-) diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h index 06416b3f94f59..515db8241eb6b 100644 --- a/arch/s390/include/asm/page.h +++ b/arch/s390/include/asm/page.h @@ -176,8 +176,6 @@ static inline int devmem_is_allowed(unsigned long pfn) int arch_make_folio_accessible(struct folio *folio); #define HAVE_ARCH_MAKE_FOLIO_ACCESSIBLE -int arch_make_page_accessible(struct page *page); -#define HAVE_ARCH_MAKE_PAGE_ACCESSIBLE struct vm_layout { unsigned long kaslr_offset; diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c index 36db065c7cf75..35ed2aea88918 100644 --- a/arch/s390/kernel/uv.c +++ b/arch/s390/kernel/uv.c @@ -548,11 +548,6 @@ int arch_make_folio_accessible(struct folio *folio) } EXPORT_SYMBOL_GPL(arch_make_folio_accessible); -int arch_make_page_accessible(struct page *page) -{ - return arch_make_folio_accessible(page_folio(page)); -} -EXPORT_SYMBOL_GPL(arch_make_page_accessible); static ssize_t uv_query_facilities(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { diff --git a/include/linux/mm.h b/include/linux/mm.h index bab689ec77f94..07b478952bb02 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2205,13 +2205,6 @@ static inline bool folio_likely_mapped_shared(struct folio *folio) return atomic_read(&folio->_mapcount) > 0; } -#ifndef HAVE_ARCH_MAKE_PAGE_ACCESSIBLE -static inline int arch_make_page_accessible(struct page *page) -{ - return 0; -} -#endif - #ifndef HAVE_ARCH_MAKE_FOLIO_ACCESSIBLE static inline int arch_make_folio_accessible(struct folio *folio) {