From patchwork Fri Dec 16 15:50:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13075134 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 C275EC4167B for ; Fri, 16 Dec 2022 15:51:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3DE5A8E000A; Fri, 16 Dec 2022 10:51:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 33FE58E0008; Fri, 16 Dec 2022 10:51:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16B3B8E000A; Fri, 16 Dec 2022 10:51:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id F36F38E0008 for ; Fri, 16 Dec 2022 10:51:14 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D002CAB97E for ; Fri, 16 Dec 2022 15:51:14 +0000 (UTC) X-FDA: 80248608468.04.F29FD80 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf14.hostedemail.com (Postfix) with ESMTP id D1B42100004 for ; Fri, 16 Dec 2022 15:51:12 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ELVCcT8X; spf=pass (imf14.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671205872; a=rsa-sha256; cv=none; b=ukOwQI0/D2RFHP60to7qzpSq1sGD/AMm6jvcqcRqFpBxE03H2vBjkjl46Z9pMdmuTIb+OM oPqxbG8klvGyxmZcmVaYza/DmLTxwUn1qtNPwWGtzjRYhFFNb4+qVrk/rMH3C3DZnCI6ka /PwAk+6SfK8p4djtsNMFuzpLxANl1Os= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ELVCcT8X; spf=pass (imf14.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.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=1671205872; 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=t1N733mGfOZDIeBgBOLPf9hKyMpT23Vbs9QUhNwynbg=; b=AKQQNQWJBbQgbxZ1u2JN+eZmCW327mVxtED/n0jm5i3tQr82QwTUOtZU6cdaUHgKOzBrIQ j23jlRrFRHb9LWp07uvXQ2LALQkaJz6oxhDLKe+swzJVvJr/c7pufdG77CK2/wFQfjxkcZ ffEtFVWJWsqttOagDT/KXH78O2JBHy4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671205872; 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=t1N733mGfOZDIeBgBOLPf9hKyMpT23Vbs9QUhNwynbg=; b=ELVCcT8X2+qnYXjMSo4POIva87565guTEAQXoKVa+hIFfm7ohRHqyMc51cDTZ9r20Pjgr1 5bbi2n0F3iTIU4YFWo6PTfy+Lwm9EM3JRTF7clQb+IleaB1wYTjxKE+1iaGk+N+aEoK44s sOl+6QO6dTXZqfgFgHbCUKden7ziVe4= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-65-INbXPdXZObm7keFtvjqjYg-1; Fri, 16 Dec 2022 10:51:11 -0500 X-MC-Unique: INbXPdXZObm7keFtvjqjYg-1 Received: by mail-qk1-f199.google.com with SMTP id q20-20020a05620a0d9400b006fcaa1eac9bso2053430qkl.23 for ; Fri, 16 Dec 2022 07:51:11 -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=t1N733mGfOZDIeBgBOLPf9hKyMpT23Vbs9QUhNwynbg=; b=r5MVOoSCg+Mqf+JzGxt3gIgQXMOiilAD4XbqqhM61Id/JJoSltowBI/oIjhgDPTdzJ To/3ZGu4lIky8HjrChRlgS5ut9uZX9t8MMV62lO9mYA/LgRxGolqqjj0+d9pu0eA2CrG LPU2+U5amV8FwMvx6BmXdZdaBkBOywZgIRcABmiu1r1TY6m+bqYa2soKXlODsrAhVISw EfyyzeDfuEI3wOovzRd5Q+mXJntydjVVR0YWaXJNPDUFSlBQtRtOiDSA9jh3gUg1ozCZ I+78zCDqON9D8mzC71P/ZvgxVwyTCf0qnKzaGDo1lL7Fr60yK6q6qZ1p/sXVR0kcj0iC k0DA== X-Gm-Message-State: ANoB5pkmO08kraov2WCuPukFw3gVJw079t/p3m6cAlMu9iynoUOAH9IH GkoYjkLGcwJR9u5YiPO3JAIxYHr33dJ2U7zN0RBbNXoL0UI7+isK0FAiVZAbs9HrIZFPFWcS1Qx mOS7XuZFxFd0= X-Received: by 2002:a0c:dd01:0:b0:4c6:fb9f:a327 with SMTP id u1-20020a0cdd01000000b004c6fb9fa327mr41198456qvk.29.1671205870611; Fri, 16 Dec 2022 07:51:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4FDmXNL5rmIhjVY1GIvpSpY4Qco5LlZXCExcuuFvXBDlMq/YlZ/u02dz6yRyxhRquFj5j+Cw== X-Received: by 2002:a0c:dd01:0:b0:4c6:fb9f:a327 with SMTP id u1-20020a0cdd01000000b004c6fb9fa327mr41198425qvk.29.1671205870379; Fri, 16 Dec 2022 07:51:10 -0800 (PST) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-45-70-31-26-132.dsl.bell.ca. [70.31.26.132]) by smtp.gmail.com with ESMTPSA id s81-20020a37a954000000b006eeb3165554sm1682297qke.19.2022.12.16.07.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 07:51:09 -0800 (PST) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Muchun Song , Miaohe Lin , Andrea Arcangeli , Nadav Amit , James Houghton , peterx@redhat.com, Mike Kravetz , David Hildenbrand , Rik van Riel , John Hubbard , Andrew Morton , Jann Horn Subject: [PATCH v4 2/9] mm/hugetlb: Don't wait for migration entry during follow page Date: Fri, 16 Dec 2022 10:50:53 -0500 Message-Id: <20221216155100.2043537-3-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221216155100.2043537-1-peterx@redhat.com> References: <20221216155100.2043537-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D1B42100004 X-Stat-Signature: gg7onrk49d8myfmff3t5uurxde7wpnio X-HE-Tag: 1671205872-926323 X-HE-Meta: U2FsdGVkX18gxplshuRetAG1JvOU6JdpLjhqeXicIEO2zsuGrTEs+rkuqTV1Nff+lga7sFGUjyRN+X5ldn2Xg14vfgCqhD4GIabQtP5Te0v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ests=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). Reviewed-by: Mike Kravetz Reviewed-by: David Hildenbrand Reviewed-by: John Hubbard Signed-off-by: Peter Xu --- mm/hugetlb.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 0dfe441f9f4d..8ccd55f9fbd3 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6380,7 +6380,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; @@ -6403,16 +6402,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);