Message ID | 20221118011025.2178986-4-peterx@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 3357EC433FE for <linux-mm@archiver.kernel.org>; Fri, 18 Nov 2022 01:10:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CA556B0071; Thu, 17 Nov 2022 20:10:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 679C56B0073; Thu, 17 Nov 2022 20:10:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F09C8E0006; Thu, 17 Nov 2022 20:10:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 39B578E0005 for <linux-mm@kvack.org>; Thu, 17 Nov 2022 20:10:38 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 03116804D8 for <linux-mm@kvack.org>; Fri, 18 Nov 2022 01:10:37 +0000 (UTC) X-FDA: 80144782956.25.6B84872 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id B547880006 for <linux-mm@kvack.org>; Fri, 18 Nov 2022 01:10:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668733835; 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=U+Gtvi2x1OMFo8SBrSP3Pl5SiCw4KKSlLL8MzskCOZw=; b=baOfAKtrhbiKxjDPoeJnpmzl3rgMObZ3/3RbW8cuq5liAJNJOdPZ6yYUmX9NU5B9lOe40V n9WLw6+sCCoZdNX3QoISblZxD45imgFgVee7DlxO0OYPOcq8/m6n2iZs/ifGvio2f0Zsoi ZFHwSxxX3NJV/Ntg/8gui+FD+vxB/wM= 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-137-KhJk9QM9NGqyGSTwDDB7vw-1; Thu, 17 Nov 2022 20:10:34 -0500 X-MC-Unique: KhJk9QM9NGqyGSTwDDB7vw-1 Received: by mail-qv1-f69.google.com with SMTP id on28-20020a056214449c00b004bbf12d7976so3235555qvb.18 for <linux-mm@kvack.org>; Thu, 17 Nov 2022 17:10: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=U+Gtvi2x1OMFo8SBrSP3Pl5SiCw4KKSlLL8MzskCOZw=; b=ooLT2Z0bskZz2bpp6/fuuvn8rLLcBb02GvXPHV4kWEawEo191KjaUWZfEU3yjPTzQ5 9UMbRdBPM04+HLUTF8cHF+HPdPQWi1P4LjeqhHUJrBeSWgfpH/VldzfsNMWEdW66k1cm Awtluer5Z9z1tqBFPNCgK24/+KNy10zV/EzFmy9rDs4smmjWafbqmquS82OvWTxpPJJn DCN//p8nCGL6pGzsIdtJQrenoVH1ekOFYEbhuNXmr5RJtbvzpf9Ht49tMuFIqvWt8myJ jf7PnuqkQhJa3it3S8ea1ea64SjtxuXTGlKBCTx/fcedelPbz4e4jR1kZl5SGNuhqoLH QRJg== X-Gm-Message-State: ANoB5plV68lv2NFbk7ZyBRy7FCEFsz9ed/+IWRvsT8/1pHfZ0T8N7xTr x4Z1ZI8VXmdTeBWtBlxCqoWk6gfzdTs7q4jWDgMN6FF/oqgtDdwBjWoWiaWqxyXL6ELnvUkKA9M oYtBsU2cEx0HmvRh3K4wukSjJ6HjcKGn6fGvnTY/pH0ADGFgo7Vlm2N1rz6Y4 X-Received: by 2002:a05:6214:aab:b0:4bb:625c:e300 with SMTP id ew11-20020a0562140aab00b004bb625ce300mr4898438qvb.96.1668733833686; Thu, 17 Nov 2022 17:10:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6NCzhzda4Hbt+DXca7JaSEwUx4nLg4wsJGPVAjeHHodiz4M9R0WBhRFqNCAHbtCQKOIPJeFg== X-Received: by 2002:a05:6214:aab:b0:4bb:625c:e300 with SMTP id ew11-20020a0562140aab00b004bb625ce300mr4898416qvb.96.1668733833478; Thu, 17 Nov 2022 17:10: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 u7-20020a05620a430700b006eed75805a2sm1491342qko.126.2022.11.17.17.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 17:10:33 -0800 (PST) From: Peter Xu <peterx@redhat.com> To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Rik van Riel <riel@surriel.com>, Muchun Song <songmuchun@bytedance.com>, Andrew Morton <akpm@linux-foundation.org>, peterx@redhat.com, James Houghton <jthoughton@google.com>, Nadav Amit <nadav.amit@gmail.com>, Andrea Arcangeli <aarcange@redhat.com>, David Hildenbrand <david@redhat.com>, Miaohe Lin <linmiaohe@huawei.com>, Mike Kravetz <mike.kravetz@oracle.com> Subject: [PATCH RFC v2 03/12] mm/hugetlb: Don't wait for migration entry during follow page Date: Thu, 17 Nov 2022 20:10:16 -0500 Message-Id: <20221118011025.2178986-4-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221118011025.2178986-1-peterx@redhat.com> References: <20221118011025.2178986-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668733836; a=rsa-sha256; cv=none; b=HIz8sN6F8G9z3dX2zktPxheXgOIHB4w3UHb5x3IGs3ZdHqs53/bHD1aGytAK3nSgfDMZFX slwLq5V0H5RvIS5YoSNfECkFtqjuVTdawac5lY2rtAqoLy4VVbaCDNOt2L8ZI6xvs8XCIW Kwbs8WqTVghnT2fj6w2ONSKYJJ8LpoQ= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=baOfAKtr; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668733836; 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=U+Gtvi2x1OMFo8SBrSP3Pl5SiCw4KKSlLL8MzskCOZw=; b=dyZ1k3LX5i8o715DhWdWLIgSEsrnKrJougoLTkjpVG1SRLWn1L5nd53H5kHZgs1/DiKFE0 phIPPm/o3NZWQGDmGWqL4yluXDaQVmncgHCUd7jEOByBfKzsp20cH1Hv5K0SJyxHrWJORA OhzuABQhBon84aGc4iWWNR4HhJygPuM= Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=baOfAKtr; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf02.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com X-Rspam-User: X-Stat-Signature: q7k8c513xzmceheidt9yuohmucxdwmyc X-Rspamd-Queue-Id: B547880006 X-Rspamd-Server: rspam11 X-HE-Tag: 1668733836-725211 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: <linux-mm.kvack.org> |
Series |
mm/hugetlb: Make huge_pte_offset() thread-safe for pmd unshare
|
expand
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 62ff3fc51d4e..61a1fa678172 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6222,7 +6222,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; @@ -6245,16 +6244,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);
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 <peterx@redhat.com> --- mm/hugetlb.c | 11 ----------- 1 file changed, 11 deletions(-)