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: 33986 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1044161wrn; Fri, 16 Dec 2022 07:54:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf5JIqfs2sFqxSh+LiV9f0y889RQeWv+wBZ9ObN/jTte1mVbuZQhsJTvVu1PUw5zdx5tSO1Q X-Received: by 2002:a17:902:b618:b0:189:af28:fd8d with SMTP id b24-20020a170902b61800b00189af28fd8dmr31734506pls.1.1671206046194; Fri, 16 Dec 2022 07:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671206046; cv=none; d=google.com; s=arc-20160816; b=R3Y7AVXzwx+l3u3FNQQziHrfSBgj+7msIYHiG5MousO4pbQ2b3f50MvxAEIYIf6v3a W5bVtLtApMfsTVvDs0V5q1fM4JK998x5cPru1t1+m173ELFONtKsFJLy/ERN6PHn7xsA RrDogKGH84aAOlVW0AoypjoAhbGbNBbb7IZ4Q0RO4JbVkag0VvT12y7ZDSuPsPn+v+q/ a1sTVQOe+O/Ui5AARE9u57+rCB4NAveGnHOTgkVpfNEhsc8YPHEoqJOFTaqVv/eH4YVQ mHObbDQSubPaC6uVEYrtoVz3RU1AbKX7xMWPqbPHWSggJovcmoG+s6DrQnUoQHqYutjH 8UWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=t1N733mGfOZDIeBgBOLPf9hKyMpT23Vbs9QUhNwynbg=; b=V4TnRyrbpAzfx6JmH341v/I51tLkRH02acHmYiJgdBWnnH+7MrVN97/2jchNVWFtER gHoaoNjmOVK5iPUzX2y3eJDDTdusLqnpWPLwQ9IF7n9oAw4GBQ2Lx0Up0KYs7BsPUe3O 02tA7OZEkjZNWnR+N3E9EPe4OBi+GJDbsZPDZZW1NBcEZzFABb0Jes6t5ZakZ+P0OCMM modRzyvAtKGDC0bT0s1JQcKzOzFKF6wJE90IeExv2KoUYfLgIVZBNKBJcS4H8f5PUm7C TOyOfAp/k2BO1rR/Uw0Lsq7nh9UiPQoktpqeEFBonICFQjQjoSZXxQ7SzXThbaF9VfWq QHAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="g/odTUMQ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020a170902f09500b00189e2b9e630si2641397pla.270.2022.12.16.07.53.54; Fri, 16 Dec 2022 07:54:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="g/odTUMQ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231533AbiLPPwT (ORCPT + 99 others); Fri, 16 Dec 2022 10:52:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231481AbiLPPwI (ORCPT ); Fri, 16 Dec 2022 10:52:08 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 869A836C51 for ; Fri, 16 Dec 2022 07:51:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671205878; 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=t1N733mGfOZDIeBgBOLPf9hKyMpT23Vbs9QUhNwynbg=; b=g/odTUMQC38MTBi31Z1wOiOv28WTPLSd/+R/A0KhwjBYdDpqEG6q9+tgjSoCMrty6n74cc md1z4mCV6F4xhYZszrSZFwPF0PK4Qa9A7rOZDQ5opyC3iHyisOrLBedo0LI4WWhKWiF1s+ QaGc2V6aqqqWS8RALrfjqXMxw9k+a6E= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-362-Qx61AxhiPuy9CElpUmT-eg-1; Fri, 16 Dec 2022 10:51:12 -0500 X-MC-Unique: Qx61AxhiPuy9CElpUmT-eg-1 Received: by mail-qv1-f72.google.com with SMTP id m4-20020ad44484000000b004c78122b496so1679694qvt.7 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=xJ9vOcURGPLlJUgfX3wi2AaiMm5ND8Y12ktadUxCJm5hbLQoQE9hU3m3FH043RwtVj noNxFCZVwI7NBEgQ4TEMUiZzPXn/2/bw3r+H+eTFDocgvVlSYAIx1WU2+8FckM5XQ8mL 7s1XfOMYuGS+7xFThT9sF+hzm6Z9eSP8JQhSnqMePC/zIcap13j7XfAvsCBmbvsLqfXU OlyR86SMaWxNJVSBNlV+f32DYONT+xkeKjw/IWEUS7XIY0cNh5hTb80br9TjRgS7lFgV RGHs4K/3eATIDf2haumCqxbPE8L7/Kr7kmAHqZH7MVvUEuVg5EgTSdQmQvaVbzFdrtAx RnTA== X-Gm-Message-State: ANoB5plBT6dCKIBwnKV/GN+CyZDSDpUSJYDbNN+8+Qig8ScbqND6jEkK jnwtpd4j5S7y3M+UARDRRaOvhf1MESgcKtsOruh2TEB4SN8x3o9jQZIUtzTsRzlh/1gySFbZoPl Oz50vLxaK1nOmx0H3rTR6sfaO932US75gwIjoZgB6rq/jdOlZn4yEO8/lIt/bpQLD4SkLWRSwtg == X-Received: by 2002:a0c:dd01:0:b0:4c6:fb9f:a327 with SMTP id u1-20020a0cdd01000000b004c6fb9fa327mr41198464qvk.29.1671205870676; Fri, 16 Dec 2022 07:51:10 -0800 (PST) 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752386551098938425?= X-GMAIL-MSGID: =?utf-8?q?1752386551098938425?= 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);