From patchwork Tue Nov 29 19:35:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13059085 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 AB3A9C4332F for ; Tue, 29 Nov 2022 19:35:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1412C6B007B; Tue, 29 Nov 2022 14:35:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F3336B0075; Tue, 29 Nov 2022 14:35:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E86796B007B; Tue, 29 Nov 2022 14:35:36 -0500 (EST) 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 D9A176B0074 for ; Tue, 29 Nov 2022 14:35:36 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A792EC01A3 for ; Tue, 29 Nov 2022 19:35:36 +0000 (UTC) X-FDA: 80187484272.22.0DC7F67 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 381E7C0012 for ; Tue, 29 Nov 2022 19:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669750535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=069LEwdmpjbCoEgrG7X25LyQKpeCovMtZOQCiu77QNo=; b=Rfxez/FP9JJaudHFIXy4W5UtTsBr5aMRRqpt4QbucuzCXp2qwJtSb/RckuK3/fRrxeZE3c EwWofrqsM26KyfSP663WyWgCTDrrFr4qXnKAhd7oFht7VDx4yCwmfa6zN4gIsk9T2x8I2j 446K7zzGYtN/mhIsTZInKoShtPwYTrs= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-178-bAnQ8ArBN72xMnS-7w-hvw-1; Tue, 29 Nov 2022 14:35:34 -0500 X-MC-Unique: bAnQ8ArBN72xMnS-7w-hvw-1 Received: by mail-qt1-f199.google.com with SMTP id bz20-20020a05622a1e9400b003a646e03748so22976571qtb.12 for ; Tue, 29 Nov 2022 11:35:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=069LEwdmpjbCoEgrG7X25LyQKpeCovMtZOQCiu77QNo=; b=CRsszuuciQI1xRVbmNGVSwcITx/doSwhjegGWKkOgALqP4LTG4kbZfSmqnGIcbEUYu GUJWRS2GhQ1h1zXJy6uxo+fMuu+quI4a1ZkKlEYl3c8oKso49PRR0McWe3s0qKw2//HY i82q4FeXnZkD12R24KWPcFTNxkYrpdS+qXIM2p/0kf7I036KHNt6sK7X4TGL+lwBxgve GWmcXaNe/pHT7nrPoFTTEPG9ljzZ3TrWJQGBb/XxVOlDAog9VkYJM4bndw4vvKdkwy9Y ChXPdm+88LNYM+icnuaySo8KH72VKSCUUaUbIDPzzCAjI+6ySaS24NBIovgS8RC/xEFi y9vA== X-Gm-Message-State: ANoB5plA+uIy78wlVQKGswPybyjDw0FlHm5yFMP7KylW1w/OMPeCeLMI Lwt/baXkXT6L9mJjTAf3GWpZO+QVVph2aofV4D20v+Pu1ZLSNyVxc4p8n4hxmnIZhpHcGToMwic HftFP5BO1gfwlbd+cjVJfXDphy4b25B21ffHFapJLBE00nx7v+8fo/daZ7I8o X-Received: by 2002:a05:6214:3b0b:b0:4c6:fb71:d337 with SMTP id nm11-20020a0562143b0b00b004c6fb71d337mr12678559qvb.110.1669750533717; Tue, 29 Nov 2022 11:35:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf4LlhV6iVquMdiRB0LITiL37rfEs8kARYiG6upAcjW7OrRevlCH3PouYPzzz2q3p48laJLCeg== X-Received: by 2002:a05:6214:3b0b:b0:4c6:fb71:d337 with SMTP id nm11-20020a0562143b0b00b004c6fb71d337mr12678530qvb.110.1669750533458; Tue, 29 Nov 2022 11:35:33 -0800 (PST) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id n1-20020a05620a294100b006fa16fe93bbsm11313013qkp.15.2022.11.29.11.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 11:35:33 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: James Houghton , Jann Horn , peterx@redhat.com, Andrew Morton , Andrea Arcangeli , Rik van Riel , Nadav Amit , Miaohe Lin , Muchun Song , Mike Kravetz , David Hildenbrand Subject: [PATCH 02/10] mm/hugetlb: Don't wait for migration entry during follow page Date: Tue, 29 Nov 2022 14:35:18 -0500 Message-Id: <20221129193526.3588187-3-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221129193526.3588187-1-peterx@redhat.com> References: <20221129193526.3588187-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669750536; a=rsa-sha256; cv=none; b=NaqjAdwq1/qNGw6AXqVLfW8n0njKQfhYVG08B0NvXiDfkMPf167gFChJvxFF1wDuLS5rGy i9Hoq9CphZhuM+uXDhSO6yhW85FGZ6UdXnREAutkGK2l/R5aErO9p608gK7zIEZspfsO5j eP/LqUJncDD/kIssvECIZhRJKETaea0= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Rfxez/FP"; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@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=1669750536; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=069LEwdmpjbCoEgrG7X25LyQKpeCovMtZOQCiu77QNo=; b=hgBmjNwkvx1uRoUXMmktSp2/o5ZIijZPiKQ1CGX8NdaAEY1V9Vy9tEY3JRlxsXtDkeJQTw ksKS/i5lrFXHvXWGV3+Gm2TrFDrkLOZiwCAKL7UM7N+Jr1AtnAkf1HD2npdJQ4vnpFfHpa NNJ2EwTTNCpyFnjgIHU+m/CiZM0TMzc= X-Stat-Signature: ggacj4ngqc5ur8o6uo7n8suoiqojpox5 X-Rspamd-Queue-Id: 381E7C0012 X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Rfxez/FP"; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam05 X-HE-Tag: 1669750536-589860 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: That's what the code does with !hugetlb pages, so we should logically do the same for hugetlb, so migration entry will also be treated as no page. This is probably also the last piece in follow_page code that may sleep, the last one should be removed in cf994dd8af27 ("mm/gup: remove FOLL_MIGRATION", 2022-11-16). Signed-off-by: Peter Xu Reviewed-by: Mike Kravetz Reviewed-by: David Hildenbrand --- mm/hugetlb.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 9d97c9a2a15d..dfe677fadaf8 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6234,7 +6234,6 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, if (WARN_ON_ONCE(flags & FOLL_PIN)) return NULL; -retry: pte = huge_pte_offset(mm, haddr, huge_page_size(h)); if (!pte) return NULL; @@ -6257,16 +6256,6 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, page = NULL; goto out; } - } else { - if (is_hugetlb_entry_migration(entry)) { - spin_unlock(ptl); - __migration_entry_wait_huge(pte, ptl); - goto retry; - } - /* - * hwpoisoned entry is treated as no_page_table in - * follow_page_mask(). - */ } out: spin_unlock(ptl);