From patchwork Fri Dec 9 17:00: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: 31876 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp888448wrr; Fri, 9 Dec 2022 09:03:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf6QgrExp6HO/+VW+hJAOhRIDT+KGVcYVs+Q0lV8ptRnDLNu0ianpDoNJXpXbkFz/bGI585J X-Received: by 2002:a17:906:ecb7:b0:7c1:f6c:dd4e with SMTP id qh23-20020a170906ecb700b007c10f6cdd4emr6053923ejb.40.1670605411736; Fri, 09 Dec 2022 09:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670605411; cv=none; d=google.com; s=arc-20160816; b=kmwPUco9YbzvVQUuuZOdIwzQcaOE1i6RZJLjvdN2KtSPuFqrXKEPVsBadowaooLLxc Lk7gBs5owcrnwNlpLcCjfO9GBanBcP9GTyGBa9s4/JKfEJggx8A6zGYf69Phwf3NZYbb n7EWZPliYdBfrhYNDk8A3nvIPW1wCi10LMt+u1yPp8yFnKdHBUZtqYJv8c4eJWhNcb+q 33wlEIJuwKSLherZ1U2e5knoBNlbduslpw7qhKCXX2UCBjATvwYVv5mZVfHFJlb50h66 LERg2aqSeNAe0EHyNMdFYzfFcexw1mb3J4jmMDqe1rBs7LPyMQqP/mx8MfWAXVM2bx9f EIYA== 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=3uAZCG3P+mUZeKCIXPYURgU7pcsgAcHbWcWGaDTy3vU=; b=W9DVTgNdSsZllwjsn5HwX0TO61/rvh9iKIPQfzAIqB7pQbJzraMDbsRBl/oGBIo7/X MYbYDxZLKGbziY1ntPlTgtajzIDjyr9PGwBBa18peU2+dUFlPJwl7dCo8eT75QjUyJC1 tAhPI0b5DHjmTpPlCg1Aq8xWAdVVq2npkut8lYk7h45XrtYVKZW0XpVUnwZfW14Wj5L4 +JKTcsPNiUcvluVmC3oH/1Gkkk7/gy3fVuWeVF/pHtAUPfSDllhzKfH1zQEWDUYVGU9t oVZBJEIJdLOi6wmFKhZ+IV4MBT1zmXiRFzvw0dXM7qm64f8RlZxcdOx3xJrZFei1ruv5 7AeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DzIjkVtp; 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 xb4-20020a170907070400b007af039d0bcasi210266ejb.429.2022.12.09.09.03.07; Fri, 09 Dec 2022 09:03:31 -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=DzIjkVtp; 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 S229938AbiLIRC3 (ORCPT + 99 others); Fri, 9 Dec 2022 12:02:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbiLIRCQ (ORCPT ); Fri, 9 Dec 2022 12:02:16 -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 31C6E8F08B for ; Fri, 9 Dec 2022 09:01:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670605282; 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=3uAZCG3P+mUZeKCIXPYURgU7pcsgAcHbWcWGaDTy3vU=; b=DzIjkVtpK7Cp1Jj+m6zRAtywQWuMDR/7tV5tS+evqXmt64NxJB/4gfhY/0cj9b4c6u9HsY Dl47pHcs8SZHgPkQ1eTAYEQkNVG0YMNQhWtz+xZ6Vwss/aeCWM4UKkhsibCTXiAexk/QGT Rr5uiyfe/uPpiBHC3AufQk8xaP5WifM= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-614-P1I0-qKkN-6KU1hwasDSOA-1; Fri, 09 Dec 2022 12:01:13 -0500 X-MC-Unique: P1I0-qKkN-6KU1hwasDSOA-1 Received: by mail-oo1-f71.google.com with SMTP id u22-20020a4a6c56000000b004a38aa46a1fso1578747oof.22 for ; Fri, 09 Dec 2022 09:01:13 -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=3uAZCG3P+mUZeKCIXPYURgU7pcsgAcHbWcWGaDTy3vU=; b=E55SgkSfoQwsHLpjbJG3MLUvJn1lSsaBb8vfRXDBwHcY0+Ci1JuFM8xTBvqLzxdFyM NpawgnEgIQgYxuk2tdCbgoe4eVC5m1WBIT59LdAV58Y44/MuGhGpwk0zMbHR2JsbfRry w2fO3uLqyfxrCQLgB8t+IrYjWea4dLrjz8tlBlmWEX0pbYFHttyaMcvwSIpbjMHhsIo9 f99dKFCulVo8MO9gBirDvhhqx7Se3bRLywpm6yvOJVkpmFBJVM6CdauKbVmWYXXLBHIj j+QBemK5291JIZv9/iaCHvcXv7wPydyBrGQwHnBo1QYQJXg/otxLuXg15Xs9IFkMeNdB kBJQ== X-Gm-Message-State: ANoB5pmv2PQKivi3NzWMTLDSAYmXRA0aNntiKCNRsr/LU+u+6tfd0MEE +sL2GK2uR5izNmvhFC1MZA1zPK5zGy+shZlAKSfJnny8BuDQ2oYi+qV3a65q95iIU3zMcXdy9Pi yrJjqgbaItosd+EdVjOC7auxz X-Received: by 2002:a54:438d:0:b0:35e:1ca6:ff6d with SMTP id u13-20020a54438d000000b0035e1ca6ff6dmr2673227oiv.5.1670605273064; Fri, 09 Dec 2022 09:01:13 -0800 (PST) X-Received: by 2002:a54:438d:0:b0:35e:1ca6:ff6d with SMTP id u13-20020a54438d000000b0035e1ca6ff6dmr2673199oiv.5.1670605272841; Fri, 09 Dec 2022 09:01:12 -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 q7-20020a05620a0d8700b006cf38fd659asm178907qkl.103.2022.12.09.09.01.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 09:01:12 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , Miaohe Lin , David Hildenbrand , Nadav Amit , peterx@redhat.com, Andrea Arcangeli , Jann Horn , John Hubbard , Mike Kravetz , James Houghton , Rik van Riel , Muchun Song Subject: [PATCH v3 2/9] mm/hugetlb: Don't wait for migration entry during follow page Date: Fri, 9 Dec 2022 12:00:53 -0500 Message-Id: <20221209170100.973970-3-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221209170100.973970-1-peterx@redhat.com> References: <20221209170100.973970-1-peterx@redhat.com> MIME-Version: 1.0 Content-type: text/plain 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?1751756739887593636?= X-GMAIL-MSGID: =?utf-8?q?1751756739887593636?= 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 1088f2f41c88..c8a6673fe5b4 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6232,7 +6232,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; @@ -6255,16 +6254,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);