From patchwork Tue Dec 17 02:29:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13910906 Return-Path: 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 7A444E7717F for ; Tue, 17 Dec 2024 02:30:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE4656B007B; Mon, 16 Dec 2024 21:30:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B94D66B0082; Mon, 16 Dec 2024 21:30:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A5C3D6B0083; Mon, 16 Dec 2024 21:30:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 87B0C6B007B for ; Mon, 16 Dec 2024 21:30:07 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0EA4E42468 for ; Tue, 17 Dec 2024 02:30:07 +0000 (UTC) X-FDA: 82902870582.18.D3F5FAA Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by imf08.hostedemail.com (Postfix) with ESMTP id D1430160009 for ; Tue, 17 Dec 2024 02:29:43 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=AmgMalE5; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf08.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734402576; a=rsa-sha256; cv=none; b=PW43Kuj7X/t8uPDkv/VyMFoFw9SQOiwOFQCYifZXt/J40Mj6RMDDp1cDymM+j9F1wUg7J9 BfqfuaLP+LnrgwrtoXq14NcWDMaa47zBkuktxaNJZoAJ8zUGUTzFwkUFNbdXJIFIeVAvTG +A9YLTZ3fXV0TDDB+ReSuEg455sb/PI= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=AmgMalE5; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf08.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734402576; 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=QCiwhXfJ2Z0HlTT5Ug0kalY1OtMxy3tJMQ6EtfaFoZg=; b=C80/SZK45c54tDM9SErFIrsVYl8hsnC3yeWrfBT8BeEGzWcETbZobq+IljC9P1fMvBOJPe 6Fj3EcCvNZS1MqW4rw9MBGvEpz3AP3TB1Z3ELRoA5O8+cXjK6EFmSj/P5EYq0P7bj2yxEy R1uZheHiatocCp38MlIqdX4vQRaBXEg= 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> MIME-Version: 1.0 X-Stat-Signature: 793thdgpy3z1gyogd8is9pk3n8fr5ms3 X-Rspam-User: X-Rspamd-Queue-Id: D1430160009 X-Rspamd-Server: rspam08 X-HE-Tag: 1734402583-645613 X-HE-Meta: U2FsdGVkX1+FMUO0Gflhe0D3gMuiQbZ4ufUgGgwCOF7lCFNNtD/jOCtIAN4KGHnQm8ndzKKyLLogFC/9Q2xLCucux7RTQaAzfDBTWHhUgIaCkCToxZ89I1GpHww1qte+op1tPrv+Lp7EuEuurZNqZANDPdXXpVxQl4VF4QzQpk14oH6NtId4IwCasMHLphZ9AclhDyYTKRbf1dv15VlR6gQAC/u0sECfSLLkQpMbManH6DfJ/mQxlMbRJ0phGIDRZMm8cQuZDpU0QLfgAWuYN/lXIrkwFuFbFd4y8RPbYTtV4C4bct1dtwpeDuodQtRnGDxL262wEyKY2FJ8jV0cgVUBImIhj+no5RGz4QZQ5haXjCJzVd1FGomQEP8m1Fa/3gsa/3kj+yh5fQ154ZaZyvoLEPCFj822xhhhcpIngDZ0ySvPA3tIjlrk7l4bwI3blnEA3eg1D3Rug9619HJxA7o+3RIb29YrUiyTNkO0222dsBAYsS1sjuyi7bsn+/8foex17UJU8m9O8j44RuK7D0rrZsiHsoW3/nt5Y3BLrouRWkv4P+CURzmpM6mM2E1fpYVgLCUFXrNuubwi8rifil101M0c9d2kjd+dLkmjZstgz3dkk25i/E4JsMYfLSjMeAD3otKnyvP1ktVVPV+Zdn7L+m8XApyce8nBJrAxT9THpM0DVF/PMF7UHhBdVL9OXJZuvu0Y6+YmczUCs9yjO2Lmug1IuGbfsH9D01FLmGtwm8ZdqAyqE9egPUq7MyVmpCG1LREpZ2ExLX2uU89MA1K7NAhuKbKIn5T7RhMgpXrj01GMae/ApAbV49+iHcGMhSg34JBsKcQPyN4BXW41W4BFLpxlswyiHpP9ft+zqzVaWTXXQ6UkAE63qoPvlgfAoiJJrcHEuRM50riR0sMqYLJk394rix73u1zdIQ5YaeTN0gS9W4KfCF3S9Uv/CtBuokHfjDA/MRyf2OQ8XaM ItBQB0HM nHQY8K1IF1Cfj3xkfxTYePM9C5rlJrWvpaOWXwQCf913dGb7EvoIxLvamYLSkargy774jOF6aM4CED7QKP/d934j8PAFBzpjA5/Hf95bCur+1JDbB8E4lg+guAOQzGopp2OKOMBJ+pGJoSrk12hyo1/h2cg0e/K+aBz5baMUOPIlTB0BDiIP/ZweGo29nYFf71dGpbnScAGWH3EPZwgQVyg/rYr84dKKxgvgAnfuLOcWXber7oh2gCov+8ZyK9Loazw8uIOG98YEKYPkJxQsZZ6DnUg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.196057, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 proactive) struct compact_control cc = { .order = -1, .mode = proactive ? MIGRATE_SYNC_LIGHT : MIGRATE_SYNC, + .alloc_flags = ALLOC_CMA, .ignore_skip_hint = true, .whole_zone = true, .gfp_mask = GFP_KERNEL, @@ -3039,7 +3040,7 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat) ret = compaction_suit_allocation_order(zone, pgdat->kcompactd_max_order, - highest_zoneidx, ALLOC_WMARK_MIN); + highest_zoneidx, ALLOC_CMA | ALLOC_WMARK_MIN); if (ret == COMPACT_CONTINUE) return true; } @@ -3060,6 +3061,7 @@ static void kcompactd_do_work(pg_data_t *pgdat) .search_order = pgdat->kcompactd_max_order, .highest_zoneidx = pgdat->kcompactd_highest_zoneidx, .mode = MIGRATE_SYNC_LIGHT, + .alloc_flags = ALLOC_CMA | ALLOC_WMARK_MIN, .ignore_skip_hint = false, .gfp_mask = GFP_KERNEL, }; @@ -3080,7 +3082,7 @@ static void kcompactd_do_work(pg_data_t *pgdat) continue; ret = compaction_suit_allocation_order(zone, - cc.order, zoneid, ALLOC_WMARK_MIN); + cc.order, zoneid, cc.alloc_flags); if (ret != COMPACT_CONTINUE) continue; 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, unsigned long end, .order = -1, .zone = page_zone(pfn_to_page(start)), .mode = MIGRATE_SYNC, + .alloc_flags = ALLOC_CMA, .ignore_skip_hint = true, .no_set_skip_hint = true, .alloc_contig = true,