Message ID | 20220921223639.1152392-4-opendmb@gmail.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 C8BB0C32771 for <linux-mm@archiver.kernel.org>; Wed, 21 Sep 2022 22:37:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 607FD8000A; Wed, 21 Sep 2022 18:37:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B72D80008; Wed, 21 Sep 2022 18:37:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40A5C8000A; Wed, 21 Sep 2022 18:37:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 344F980008 for <linux-mm@kvack.org>; Wed, 21 Sep 2022 18:37:23 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 095D31C3F88 for <linux-mm@kvack.org>; Wed, 21 Sep 2022 22:37:23 +0000 (UTC) X-FDA: 79937555166.29.DD91AA1 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by imf17.hostedemail.com (Postfix) with ESMTP id BB9DE40057 for <linux-mm@kvack.org>; Wed, 21 Sep 2022 22:37:22 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id g12so5190934qts.1 for <linux-mm@kvack.org>; Wed, 21 Sep 2022 15:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=LmEVzalCJFIRHw39sUF5chZzrB9L9Ol3S17vl8cf3+Y=; b=aZdar3AJ1DG3bz5HOxv9V7SzAwaMBzRGfUiS2XhA18Fcs8H4Ak5WpiBR1K2Se7ALpk bO5X4Q3hs7tZXOHJ7kqDEFfkGSd5t1TshU98QnDHGeXRCCBrctK0s1+vmE/l9n+wMFEy KmuZhTGthHpG1FGxaAPgsnbYGSp3KhhNzHIGR4IpQ2IgFZn8JdyeTULbj5YlXASe6zfd +Jw+BUD1TUAvRH2kEJfCf3ILMgbKZCaqj3qJFLPXK0pLCCS4K5bnURD0A52RmHGkxMhB HN3Xhv0e+DFmztWDUwIiDLA5nfC0eLWMpyhpTMzmJLl6IKZ0XkD8fK0b08YlrPT44Rke zrrw== 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; bh=LmEVzalCJFIRHw39sUF5chZzrB9L9Ol3S17vl8cf3+Y=; b=wKWTkBpZwbw2l0BSDa58FFozmeuwOB4tbghz1//yVB3nkUMEDvmYMrIX5AgpRDNIHc 58Cx1zpQDSdPPJL5wTdgLq5dJXOtJJHDOSvlN6aObjN1N/zZnOzyLwaP9jRbIpdmKJ4B olQdVYcpOyqbBPgwQ9VEvVBFWVERqLNes/H3dQHObtTfeidPL5QfSMQZCzN17X67newj RwGI9E5uV2afIZRj9+fbu9dx7nzOA4ix99fHIWHxxh4s7wAtNfS1aobUsut02e71W5Lq J7jmSaP57sqrh8fMMo5tlDqMabkwaY2B1oq6khS4m3OvAMGZqQIdSaCpAueFPuj8GLhN N+TQ== X-Gm-Message-State: ACrzQf14N4r3Zouq2uc2V6yT6Wt6VVKpSeYXFfyGXxLc0OiSjLHdxfN6 ODb6r6Lpxd8tsuy/wY/nXqCdHAXTPO8= X-Google-Smtp-Source: AMsMyM6pGX6zsqz0C40T23b+r6f11juvY3D4Nzd4CRClOWX9iALWXgBruz8A7GfTwra9HpWNdE+06Q== X-Received: by 2002:a05:622a:1015:b0:35a:de14:45b1 with SMTP id d21-20020a05622a101500b0035ade1445b1mr569768qte.348.1663799842103; Wed, 21 Sep 2022 15:37:22 -0700 (PDT) Received: from stbirv-lnx-3.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id j13-20020a05620a288d00b006cea2984c9bsm2731540qkp.100.2022.09.21.15.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 15:37:21 -0700 (PDT) From: Doug Berger <opendmb@gmail.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: Mike Kravetz <mike.kravetz@oracle.com>, Muchun Song <songmuchun@bytedance.com>, Florian Fainelli <f.fainelli@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Doug Berger <opendmb@gmail.com> Subject: [PATCH 3/3] mm/hugetlb: add hugepage isolation support Date: Wed, 21 Sep 2022 15:36:39 -0700 Message-Id: <20220921223639.1152392-4-opendmb@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921223639.1152392-1-opendmb@gmail.com> References: <20220921223639.1152392-1-opendmb@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663799842; a=rsa-sha256; cv=none; b=YbSQtfY0nJgKnOaw3nECQt+icNWEKXs5qIFzX0AFa1LonsVQ3uRxwMugn8gWg/fbQfflvb kG/G/QMQQ0pDxpnwuHM8/zUsUBzk8efMv4isV0hk2SitLcVdufucNdqnPwi1tksc8OS2Rn SzaaLgcGfSIAZXX4FRrnt8y6PBuvWKs= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=aZdar3AJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of opendmb@gmail.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=opendmb@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663799842; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LmEVzalCJFIRHw39sUF5chZzrB9L9Ol3S17vl8cf3+Y=; b=7A1f/QMK7CVrO5u72wqtG4sJA+X3R3aBzVnEiMUP5EroRCxNmO1fQ08xxGpaRwDY3UU4bd wIB0o+w3Lzzy+OLqKIl3RPyK1CjlFnrO7gzkzzH5m141g1YS+8Gn/2LJyf3SjPzFSHnROA ihYKLNdkv55atj8eC+kIgDXKXZv+woU= X-Stat-Signature: 9md8a7wpb5gqiasxr14szr1jh71xqda7 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: BB9DE40057 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=aZdar3AJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of opendmb@gmail.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=opendmb@gmail.com X-Rspam-User: X-HE-Tag: 1663799842-280256 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: hugepage migration enhancements
|
expand
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index eab812760fbe..3a2f0b55059d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -33,6 +33,7 @@ #include <linux/migrate.h> #include <linux/nospec.h> #include <linux/delayacct.h> +#include <linux/page-isolation.h> #include <asm/page.h> #include <asm/pgalloc.h> @@ -1135,6 +1136,10 @@ static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid) if (PageHWPoison(page)) continue; + /* Check head pageblock isolation */ + if (is_migrate_isolate_page(page)) + continue; + list_move(&page->lru, &h->hugepage_activelist); set_page_refcounted(page); ClearHPageFreed(page);
When a range of pageblocks is isolated there is at most one hugepage that has only tail pages overlapping that range (i.e. a hugepage that overlaps the beginning of the range). However, that hugepage is the first migration target for an alloc_contig_range() attempt so it already receives special attention. Checking whether the pageblock containing the head of a hugepage is isolated is an inexpensive way to avoid hugepage allocations from isolated pageblocks which makes alloc_contig_range() more efficient. Signed-off-by: Doug Berger <opendmb@gmail.com> --- mm/hugetlb.c | 5 +++++ 1 file changed, 5 insertions(+)