From patchwork Wed Jul 31 14:20:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13748847 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 A4942C3DA64 for ; Wed, 31 Jul 2024 14:20:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 397326B0085; Wed, 31 Jul 2024 10:20:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 347706B0088; Wed, 31 Jul 2024 10:20:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20EF46B0089; Wed, 31 Jul 2024 10:20:17 -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 04BC86B0085 for ; Wed, 31 Jul 2024 10:20:16 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 973BB1603DB for ; Wed, 31 Jul 2024 14:20:16 +0000 (UTC) X-FDA: 82400257632.24.1488AE2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 0AD0380004 for ; Wed, 31 Jul 2024 14:20:13 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WR8z90xI; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722435568; a=rsa-sha256; cv=none; b=SHt/u9uQ18d5APJqEJH6gjYwIb8wL4W6M3YtwZjEy/IoOv/0wgpzRwPvSnYxmJdJ5a1Id1 XjYDBYm1uaE47+xPlUZv7Gyb4kSMXfZcVkrpgLOUqkdDqT58+se/G0o12SaO7sx+T5EBlW M+jBbFkPKKHaPxVN2swoyYNPfdyuJX4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WR8z90xI; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of david@redhat.com designates 170.10.133.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=1722435568; 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=2OX9pHIYPCYciT54Hwf95cCUxzek0vThGczntvqQatQ=; b=sJ/dT/2ljQpini3nxMgq3WOw8LBtNpCxapyAOtkizoJXO1PbGW7UxjEMrlsZQKr2qBt4s8 aKP3ie40RPPvqn2Xaehhti79OpavNxANvfde0LZZX7HR0XPBwr8ga8gosJa6cKpMInezw6 FJj+CPz2ATFVniFWvU3TgAjhrtQLxPQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722435613; 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; bh=2OX9pHIYPCYciT54Hwf95cCUxzek0vThGczntvqQatQ=; b=WR8z90xI0KG7J+fPEELXFs2w6+UiOFZdY2mlbQ16mOzA2TzKNj0uw7ilQa2L8uvQFPP53h 5RcYxzbLOCvAKvzHx3RnXZqZh/poc+ws1uX+0pBf3gIVtSTlptsluT6cz26LcGYAeVo348 P032ev11OjfuHB90yQRaOVpAJxBXj08= Received: from mx-prod-mc-04.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-440-1ubZouPnO7KGbLcP0s3P_g-1; Wed, 31 Jul 2024 10:20:08 -0400 X-MC-Unique: 1ubZouPnO7KGbLcP0s3P_g-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DF2D91955D50; Wed, 31 Jul 2024 14:20:05 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.194.228]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B863019560AE; Wed, 31 Jul 2024 14:20:01 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, David Hildenbrand , Andrew Morton , Peter Xu , Muchun Song , Alexander Viro , Christian Brauner , Jan Kara Subject: [PATCH v1] mm/hugetlb: remove hugetlb_follow_page_mask() leftover Date: Wed, 31 Jul 2024 16:20:00 +0200 Message-ID: <20240731142000.625044-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 0AD0380004 X-Stat-Signature: cnnxh7q1aa5rskk1wnq8wzd3quaaxugw X-Rspam-User: X-HE-Tag: 1722435613-476390 X-HE-Meta: U2FsdGVkX18Eu9sa8n8sN6Bq7prK4T+G1pp6pyGEig8j4E1BMZ05c1L4H1LggP3vB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up10VHtdgVz7s5Cxc0dC4jIWmNuhakCsyk+943uujmqFsT8JBUWn2YSO9GHQZ+NX0BmM4k9Ybr98RwH2WY0ZaJmNZ+wLFOSHgaw5y/xsan/6nkLR2wz19W2FS5fj+qBBwSBsnS4+IXJ7jdOsSgPYRX8kfBDNcJ6CuORtgOccYmEXqLKxVbERmNzXyMX66fjsuf96ySeJ3XqIYa3UQf4OUfbB5BQa8FtttdN/8hukntd8JuTYPob2e/qsJqkfC7KJScxsQBvEY8m97dk22Kqwh66tS9aWhs/tAY5lIs3ofJOJUfYhHwTXzXTReB6XkwVuGddI5u80nwDaZEOXbDkTJowxynAAC9rbveHupbt0vLXwJXQ0GoBvJw= 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 removed hugetlb_follow_page_mask() in commit 9cb28da54643 ("mm/gup: handle hugetlb in the generic follow_page_mask code") but forgot to cleanup some leftovers. While at it, simplify the hugetlb comment, it's overly detailed and rather confusing. Stating that we may end up in there during coredumping is sufficient to explain the PF_DUMPCORE usage. Cc: Andrew Morton Cc: Peter Xu Cc: Muchun Song Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Signed-off-by: David Hildenbrand --- fs/userfaultfd.c | 11 ++--------- include/linux/hugetlb.h | 3 --- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index b3ed7207df7e..68cdd89c97a3 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c @@ -371,15 +371,8 @@ vm_fault_t handle_userfault(struct vm_fault *vmf, unsigned long reason) unsigned int blocking_state; /* - * We don't do userfault handling for the final child pid update. - * - * We also don't do userfault handling during - * coredumping. hugetlbfs has the special - * hugetlb_follow_page_mask() to skip missing pages in the - * FOLL_DUMP case, anon memory also checks for FOLL_DUMP with - * the no_page_table() helper in follow_page_mask(), but the - * shmem_vm_ops->fault method is invoked even during - * coredumping and it ends up here. + * We don't do userfault handling for the final child pid update + * and when coredumping (faults triggered by get_dump_page()). */ if (current->flags & (PF_EXITING|PF_DUMPCORE)) goto out; diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index fa5cc81e61a3..3e4b03de815d 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -127,9 +127,6 @@ int move_hugetlb_page_tables(struct vm_area_struct *vma, unsigned long len); int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *, struct vm_area_struct *); -struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, - unsigned long address, unsigned int flags, - unsigned int *page_mask); void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long, struct page *, zap_flags_t);