From patchwork Thu Aug 1 18:04:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaiyang Zhao X-Patchwork-Id: 13750839 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 7CB88C3DA4A for ; Thu, 1 Aug 2024 18:05:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 064EC6B007B; Thu, 1 Aug 2024 14:05:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 014FB6B0082; Thu, 1 Aug 2024 14:05:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1EBF6B0083; Thu, 1 Aug 2024 14:05:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C35316B007B for ; Thu, 1 Aug 2024 14:05:25 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 52B691C33A3 for ; Thu, 1 Aug 2024 18:05:25 +0000 (UTC) X-FDA: 82404453810.28.E1A3CF4 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by imf29.hostedemail.com (Postfix) with ESMTP id BD64E12001D for ; Thu, 1 Aug 2024 18:05:22 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=cs.cmu.edu header.s=google-2021 header.b=Yq1I5Yru; dmarc=pass (policy=none) header.from=cs.cmu.edu; spf=pass (imf29.hostedemail.com: domain of kaiyang2@andrew.cmu.edu designates 209.85.219.51 as permitted sender) smtp.mailfrom=kaiyang2@andrew.cmu.edu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722535459; 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: references:dkim-signature; bh=bU4J0jaxRCj1uCLzmYV++hhFHWH6yGolNrzeqbUQ2CU=; b=X7H1P4kue1qPqeK45mCXw0t6Ww2+Mz0TXicjIjyvli3iVSXMdp09mtHTCNVW+wGv65nxpF j+KO7NDLtNMMzIrDHcWHM9niLA3kOntrKKT21scNmzFjGmQg8LZzOeSXQt1Kf5ZJg9jopU wZh9WK6ysoHzM3CXvfJgQ0aVBMMH4Ho= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722535459; a=rsa-sha256; cv=none; b=P6SlQ9CaI8pDg2OTBgXSNDJp6109ksD7aMiqmGcRvd4H1I5jLAvk+I26AlMU6pq33SMA84 ZNmpBRpjBM6e7yGRAeDDsVzyyl7quWYGEzF494HcS97YYFOu/j3MYLb71733c8PFs0NHRw aDv15yinZKOrXAHW62jwphudjPcj8Fk= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=cs.cmu.edu header.s=google-2021 header.b=Yq1I5Yru; dmarc=pass (policy=none) header.from=cs.cmu.edu; spf=pass (imf29.hostedemail.com: domain of kaiyang2@andrew.cmu.edu designates 209.85.219.51 as permitted sender) smtp.mailfrom=kaiyang2@andrew.cmu.edu Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6b6199ef089so42020346d6.3 for ; Thu, 01 Aug 2024 11:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.cmu.edu; s=google-2021; t=1722535522; x=1723140322; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bU4J0jaxRCj1uCLzmYV++hhFHWH6yGolNrzeqbUQ2CU=; b=Yq1I5YrunmXkdh0sBrZca1bHvI7A7uZXbOY0Gc84EIoZIoB8oms+LJTbBlKAQaym4z WXqv/NioqarDGWpbZhJ2BDbplZH1E2GhxnnuWSPgew0UzioBcy9rrdN0Rce9qr3zO7Zy ghBbYFz2XWOFtdMwV8CcYfIMXWmZP8b8PUBhOGbmNOd3w1u9y8z5SlJstjQjV+P/JA8S /FvdUD1vO2a0Jcf5wOY8N/CtxjbyyFO0CA/dvuIwWFwvzkJG7toUXeRvhvOJglXtaN2Q 9cb/LZ0bzsZMYrBbjHS9XIc+rnncnTKZsqiEuCf/OI/8ypq+g9Ptb3rvgxEXP+MagJob F79A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722535522; x=1723140322; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bU4J0jaxRCj1uCLzmYV++hhFHWH6yGolNrzeqbUQ2CU=; b=bR9o5p7WlsmFAGEKbUXYOkPA1cxmqnw7y3rQYuZ0WrDWDcJqRkt3Q54xWsG+W1SSUC NLdPMsg3oqoaeen/wwuRq0L+bPfM9BqJRuA3edsi+uGv1BX9e5orast7effA4kZpBWKK jipjKc+uBIo18RTTDzXPSMsgL4EbHQNq2aAoK0DqFXknHAnfgCSsqEiPiNtO10zvz/x6 6siY7JeFhZEN/ZpHSAPPROB5ev+1MlQLFQw9Kr3YGMs4+nArtxJ2VgFKmPqD8uIZBWk6 PiPG85ZmFV2pwjHut4Nw6Ivu/eGeAqQE2MV+dMU/igYnINPc4XOAyZkliwmv0TXYktOr iXSw== X-Gm-Message-State: AOJu0YyV8OdjPoI77ylysGm5kEaWRTV9xXMRgIG8MIlrkTsp/oChe+iE qlCqe4kxrjaOE/7UzZ3JhBF75HKVOSOOBamf0RyxVekd6NNnC+hAjOvqjzrMv6BbZPr3eZjf1xF /eBDNPZ6gwURnhkSuu/sAQCf0P9C/O9zIuUiJvNh02/Q3Lb1qXuMGFypXS6lMJ5QuMdSr9hOGFa K9IDh6DPt/ftnpWwpKlX65sBSKZedRoPRZ X-Google-Smtp-Source: AGHT+IG40VyufTWU2d+sP63uwNd8bdelAdRAfFggQlO4ljHuKKN0aTXvo0TCc2M1fzXVL/X6KeMumg== X-Received: by 2002:a05:6214:54c3:b0:6b5:3da3:adaa with SMTP id 6a1803df08f44-6bb9830f93bmr10191966d6.3.1722535521523; Thu, 01 Aug 2024 11:05:21 -0700 (PDT) Received: from localhost (pool-74-98-231-160.pitbpa.fios.verizon.net. [74.98.231.160]) by smtp.gmail.com with UTF8SMTPSA id 6a1803df08f44-6bb99b0bbffsm1011236d6.76.2024.08.01.11.05.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Aug 2024 11:05:21 -0700 (PDT) From: kaiyang2@cs.cmu.edu To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, Kaiyang Zhao Subject: [PATCH] mm: consider CMA pages in watermark check for NUMA balancing target node Date: Thu, 1 Aug 2024 18:04:56 +0000 Message-ID: <20240801180456.25927-1-kaiyang2@cs.cmu.edu> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: BD64E12001D X-Stat-Signature: 8tpf98xx6r3dyew1kkpg7qbywbzcw9ey X-Rspam-User: X-HE-Tag: 1722535522-288635 X-HE-Meta: U2FsdGVkX195E1Zud58xBJjpreMMYQC94x60p1ZCPAlpDADXAOsx5nmrI7lTgG9c1tBamMofqxKW/X9CxNAZVxBQiyzkhvPsUNZzE1Npdqi4L8ai2Nz2Jq5dmq1X1s092xCnQOyapjhZjrOP4bey0JJ5KT1Kk1W+0nrilEjzvvoM1iQoyDNxfLf241OU2wCFeH3umFK5KpGIcA+u3bdoGfHAaxuXK1vsp+t7J6sp1yftuq3Ld6bf4y5mBikLcH6RBIL5e6B4IcvWbUGeJx378HyzxvdTcA9QxmTt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0FPMVfvn/llDzyEr3E= X-Bogosity: Ham, tests=bogofilter, spamicity=0.008404, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Kaiyang Zhao Currently in migrate_balanced_pgdat(), ALLOC_CMA flag is not passed when checking watermark on the migration target node. This does not match the gfp in alloc_misplaced_dst_folio() which allows allocation from CMA. This causes promotion failures when there are a lot of available CMA memory in the system. Therefore, we change the alloc_flags passed to zone_watermark_ok() in migrate_balanced_pgdat(). Signed-off-by: Kaiyang Zhao Acked-by: Johannes Weiner Reviewed-by: Baolin Wang --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 8578a930cad1..aa482c954cb0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2526,7 +2526,7 @@ static bool migrate_balanced_pgdat(struct pglist_data *pgdat, if (!zone_watermark_ok(zone, 0, high_wmark_pages(zone) + nr_migrate_pages, - ZONE_MOVABLE, 0)) + ZONE_MOVABLE, ALLOC_CMA)) continue; return true; }