Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1412552rwb; Wed, 7 Dec 2022 12:46:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf6/nrdUAa+aARFKNfJVxtvEyFOTON9awlaMBIgATM9hLJR/MeMb6ko1itndw4mRG829DCfI X-Received: by 2002:a62:1792:0:b0:56b:e975:cf98 with SMTP id 140-20020a621792000000b0056be975cf98mr77408932pfx.63.1670446000202; Wed, 07 Dec 2022 12:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670446000; cv=none; d=google.com; s=arc-20160816; b=EdXT6KSDXbjPRtpyzk7T9P0V44H/x9/AIsU4qx+11CYFXasb64ZdSL5BRnD6WIZkIC aIdB5hFfLCPbXw8P6FaxGLu/F+v3On2XpBxipn39uzl2OHoFop5OlhFTprshlPZmF1jf Y/lqwiCIRDdMwQrFfU+eWVRAHaatUSYOgisPs8CtryY2YkscAtfyrZ009OZ03O47dEgy Pq4kqJNRmLSnktmffdIUC/4auHgiuDmujjuXwRx92sXu0KQCNdHJkGBbsAXdrIRVUf6M z00Z7YjFBNMLO1Kd84CAULHiUA232ZJweQQakZeAd7vDhfbhvEzpv/YI9eKNeco7tk6E hFiw== 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=RTEeCRjKpb4wZGC2IHTK/YLghk1hCkfDBIBgYSHgVC0=; b=cESWatD8Mh0Ewkahm7Cwq3EPYWYdtudlEBlQZe1dcs3j8hCPj8qU8ydXNChoJw2zAa NqymORkaBYxM99fCWjA3j10Prvp4Yko37+4923YP03RgFDPd3SnnNlFTtBvAsUSOk71s AZU71tz2eGjkWp2B6PamuAXM0jkO2oQ1BIfZltbeNbE5HftUEgIj4Nr7ikQmleIk+nPg J7TdEvVJIl2auAamIbRDBZkfi+10kR1HD+ctcHv5nal7XNegE37vFmjDgqD483LcXuyq PGzBV7r3CGNH1Z8hQ3WSTZ4x3QtAAtlxryNdcXCe5/WAoPg9OrnYF55GvwtP5GZG/H1s SFzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="evZwOO/r"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a17090274c300b00189f58ecb7asi3027396plt.151.2022.12.07.12.46.30; Wed, 07 Dec 2022 12:46:40 -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="evZwOO/r"; 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 S229890AbiLGUcA (ORCPT + 75 others); Wed, 7 Dec 2022 15:32:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbiLGUbq (ORCPT ); Wed, 7 Dec 2022 15:31:46 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C97C67BC28 for ; Wed, 7 Dec 2022 12:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670445043; 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=RTEeCRjKpb4wZGC2IHTK/YLghk1hCkfDBIBgYSHgVC0=; b=evZwOO/reQhgKX78m90wFfpYs0rFtY1fq+Cxif56xRNB+CUFF17eR/kzpN5JQzu/NfKv+S 2/pU0BAM51YhINEEIzjPB+pZE7tRI3889YnCqAvVm3qXP1BDS+7qClDsau2YHodaZYp0ch iuLX4hhdq6x2WwIprAJh6v9iv5UToU0= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-529-PasFPQGDPvi8z08cbKKKGA-1; Wed, 07 Dec 2022 15:30:41 -0500 X-MC-Unique: PasFPQGDPvi8z08cbKKKGA-1 Received: by mail-qv1-f69.google.com with SMTP id 71-20020a0c804d000000b004b2fb260447so37545241qva.10 for ; Wed, 07 Dec 2022 12:30:41 -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=RTEeCRjKpb4wZGC2IHTK/YLghk1hCkfDBIBgYSHgVC0=; b=PTF57sVXTgP3tc7wWW8Hgp+SMFzlIgBuVr0BR1C9Y2vAqvUTBuM8tHK2swcx9iFqiK IZ9gjWPAYEsJF6ymVB092+ekWBugygdQser10kg5uIRX+gw+zGLWm15FXsi05y3kHTZ5 PiuQZSYOl+tnVT2MJAnKAVF/WNkzRvXKvPdikT9upZUUyCL2axDY5CelfMhGQvmipF/F 6OSs91zbBRwbYie9juws87mTi/ILjkRk2VBDdeA/fsrN056zIdsg7glS5ZsJOTsnQ6q6 4c4cKmLl6iRqXrl05mDJQsQaorEu7qGeJGP0hc/p1gM7+sZoboQxHRwgtokKtmKeuKVE IfaQ== X-Gm-Message-State: ANoB5pkYxxohLOAJNIpFSCQ44P1sZbkQ+HEUdfvrhka3fRcn0FZ+6Gu1 NrmJrenlK7Y06r4OHbdSGjcCC12Fdn995krOJbSqjjH1yaDat5m251bslX/fSM5ISbLT6uyINxa 38wSwrjeyrIbr4nWf+H2b/x01 X-Received: by 2002:ac8:6b92:0:b0:3a6:8a53:b8ab with SMTP id z18-20020ac86b92000000b003a68a53b8abmr1339915qts.36.1670445041489; Wed, 07 Dec 2022 12:30:41 -0800 (PST) X-Received: by 2002:ac8:6b92:0:b0:3a6:8a53:b8ab with SMTP id z18-20020ac86b92000000b003a68a53b8abmr1339904qts.36.1670445041289; Wed, 07 Dec 2022 12:30:41 -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 dc53-20020a05620a523500b006fefa5f7fcesm855594qkb.10.2022.12.07.12.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 12:30:40 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Muchun Song , John Hubbard , Andrea Arcangeli , James Houghton , Jann Horn , Rik van Riel , Miaohe Lin , Andrew Morton , Mike Kravetz , peterx@redhat.com, David Hildenbrand , Nadav Amit Subject: [PATCH v2 02/10] mm/hugetlb: Don't wait for migration entry during follow page Date: Wed, 7 Dec 2022 15:30:26 -0500 Message-Id: <20221207203034.650899-3-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221207203034.650899-1-peterx@redhat.com> References: <20221207203034.650899-1-peterx@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit 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 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 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); -- 2.37.3