From nobody Wed Dec 17 21:29:44 2025 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13957145335; Tue, 17 Dec 2024 02:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734402611; cv=none; b=TUMpaAN0/R8lapDpQ+X+GXSlXXgi35wq9ytabB7M3os3GoJCEVXhyRnvMGqqo8Dw2VX4UYgXk4vT0KsYX9K9a9RVOEgKjYhI3emKvNigEG8Lly82ZHFYMzstxDzjWFir73hZ3/M1Fs5U28QrMelsBcMkC68nEhkRkaiv44adOkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734402611; c=relaxed/simple; bh=KvSHcgGfj5fVpbu4sV7uw540x5cmriVxQ9T+i6eEZbY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tvVgsJDcnTnn0B20UawDt5BjAiuuA01NyiRKpAV8MzgJjUVC3OTwWhh2S6Y93Hv0A2fJE8algRwbTL5IgIocILMhC5c4OZsera3o7hi5Mv6ddkXWriET4BeJoiVfkyg5thEB9/qDNzbxzxpvrWfvxHboYd25mZrpFBFLo0bamwI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=AmgMalE5; arc=none smtp.client-ip=115.124.30.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="AmgMalE5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1734402600; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=QCiwhXfJ2Z0HlTT5Ug0kalY1OtMxy3tJMQ6EtfaFoZg=; b=AmgMalE5QJrV980BE6thr25qt6e+OL7tX64Fxvv7aeMohY22AkRDbBOb02OKJ8NwRdE3sYLqvhUBlQfe7nhvYFz3NpK0iVti1UjvOKxmjbbPzKIR/tBJ+nK9r/ja23V5yrRI8DgB9UXdVoWYqd35R1Ua6Ce7QejM+3Mz7CV2PF4= Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WLguG8A_1734402598 cluster:ay36) by smtp.aliyun-inc.com; Tue, 17 Dec 2024 10:29:59 +0800 From: Baolin Wang To: yangge1116@126.com Cc: 21cnbao@gmail.com, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, david@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, liuzixing@hygon.cn, stable@vger.kernel.org, vbabka@suse.cz Subject: [PATCH] mm: compaction: fix don't use ALLOC_CMA in long term GUP flow Date: Tue, 17 Dec 2024 10:29:55 +0800 Message-Id: <20241217022955.141818-1-baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <1734350044-12928-1-git-send-email-yangge1116@126.com> References: <1734350044-12928-1-git-send-email-yangge1116@126.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Need update cc->alloc_flags to keep the original logic. Signed-off-by: Baolin Wang --- mm/compaction.c | 6 ++++-- mm/page_alloc.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index b10d921c237b..d92ba6c4708c 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2895,6 +2895,7 @@ static int compact_node(pg_data_t *pgdat, bool proact= ive) struct compact_control cc =3D { .order =3D -1, .mode =3D proactive ? MIGRATE_SYNC_LIGHT : MIGRATE_SYNC, + .alloc_flags =3D ALLOC_CMA, .ignore_skip_hint =3D true, .whole_zone =3D true, .gfp_mask =3D GFP_KERNEL, @@ -3039,7 +3040,7 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat) =20 ret =3D compaction_suit_allocation_order(zone, pgdat->kcompactd_max_order, - highest_zoneidx, ALLOC_WMARK_MIN); + highest_zoneidx, ALLOC_CMA | ALLOC_WMARK_MIN); if (ret =3D=3D COMPACT_CONTINUE) return true; } @@ -3060,6 +3061,7 @@ static void kcompactd_do_work(pg_data_t *pgdat) .search_order =3D pgdat->kcompactd_max_order, .highest_zoneidx =3D pgdat->kcompactd_highest_zoneidx, .mode =3D MIGRATE_SYNC_LIGHT, + .alloc_flags =3D ALLOC_CMA | ALLOC_WMARK_MIN, .ignore_skip_hint =3D false, .gfp_mask =3D GFP_KERNEL, }; @@ -3080,7 +3082,7 @@ static void kcompactd_do_work(pg_data_t *pgdat) continue; =20 ret =3D compaction_suit_allocation_order(zone, - cc.order, zoneid, ALLOC_WMARK_MIN); + cc.order, zoneid, cc.alloc_flags); if (ret !=3D COMPACT_CONTINUE) continue; =20 diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ecb2fd770387..1bfdca3f47b3 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6456,6 +6456,7 @@ int alloc_contig_range_noprof(unsigned long start, un= signed long end, .order =3D -1, .zone =3D page_zone(pfn_to_page(start)), .mode =3D MIGRATE_SYNC, + .alloc_flags =3D ALLOC_CMA, .ignore_skip_hint =3D true, .no_set_skip_hint =3D true, .alloc_contig =3D true, --=20 2.39.3