From patchwork Mon Jun 24 04:51:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenneng Li X-Patchwork-Id: 13708937 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 71D4BC2D0D0 for ; Mon, 24 Jun 2024 04:52:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EA406B0446; Mon, 24 Jun 2024 00:52:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 89A516B0447; Mon, 24 Jun 2024 00:52:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 762316B0448; Mon, 24 Jun 2024 00:52:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 55F6D6B0446 for ; Mon, 24 Jun 2024 00:52:55 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C22D51C19D0 for ; Mon, 24 Jun 2024 04:52:54 +0000 (UTC) X-FDA: 82264562268.19.897C3AC Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by imf10.hostedemail.com (Postfix) with ESMTP id E26E0C0008 for ; Mon, 24 Jun 2024 04:52:51 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of lizhenneng@kylinos.cn designates 124.126.103.232 as permitted sender) smtp.mailfrom=lizhenneng@kylinos.cn; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719204755; 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:references; bh=U03wbSw1Uf1mfRDbwhwlmukAPDtJBnAqEboGO7zA9jk=; b=4r4QKMIwjG6hyM7ndN3qrEIxcRpG8wC2Ffr+CUZTRJUSKSz2Td3RN3rBSB8lN+lSqVEZzj GrsQv6+QbR3F2JikqTWLXQIVHYI4AmPOw+RfcmzdxNeUo4zzzNlAT1aUn4tWBT7pRbA4pQ xxVNzWrx5Ujrwwwx/G1dyDRb+UFy+W0= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of lizhenneng@kylinos.cn designates 124.126.103.232 as permitted sender) smtp.mailfrom=lizhenneng@kylinos.cn; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719204755; a=rsa-sha256; cv=none; b=Tu/rSpVV06QVb3yAJdpUFq5g3KXt8K00tobRlbS1SWLs04DFX5Yba5hIhjzYxXs3gP9ADC +/AB4VCeJrFuSzdiO+pMbvTujcY1mLAGfSHN0vX3DkevDr24HMbX6Ep2twdYKeR9s65but rHV6UTf1NPLAMVBMM0ViILwGn6NAENQ= X-UUID: 97c90f3c31e511ef9305a59a3cc225df-20240624 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.38,REQID:513e5f83-4bc0-4c29-9adf-5881a04f0a2b,IP:15, URL:0,TC:0,Content:0,EDM:-25,RT:0,SF:-1,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:-11 X-CID-INFO: VERSION:1.1.38,REQID:513e5f83-4bc0-4c29-9adf-5881a04f0a2b,IP:15,UR L:0,TC:0,Content:0,EDM:-25,RT:0,SF:-1,FILE:0,BULK:0,RULE:EDM_GE969F26,ACTI ON:release,TS:-11 X-CID-META: VersionHash:82c5f88,CLOUDID:ae42ce6172741fa5beedcdd08076e516,BulkI D:24062412423347W5T7XY,BulkQuantity:1,Recheck:0,SF:72|19|44|66|25|102,TC:n il,Content:0,EDM:1,IP:-2,URL:0,File:nil,RT:nil,Bulk:40,QS:nil,BEC:nil,COL: 0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_FSD,TF_CID_SPAM_FSI,TF_CID_SPAM_SNR X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CC_NO_NAME, HR_CTE_8B HR_CTT_MISS, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_NAME HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER, HR_SJ_NOR_SYM, HR_SJ_PHRASE HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT, HR_TO_DOMAIN_COUNT, HR_TO_NAME IP_TRUSTED, SRC_TRUSTED, DN_TRUSTED, SA_EXISTED, SN_EXISTED SPF_NOPASS, DKIM_NOPASS, DMARC_NOPASS, CIE_BAD, CIE_GOOD_SPF GTI_FG_BS, GTI_RG_INFO, GTI_C_BU, AMN_T1, AMN_GOOD AMN_C_TI, AMN_C_BU, ABX_MISS_RDNS X-UUID: 97c90f3c31e511ef9305a59a3cc225df-20240624 X-User: lizhenneng@kylinos.cn Received: from localhost.localdomain [(116.128.244.171)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1586047465; Mon, 24 Jun 2024 12:52:43 +0800 From: Zhenneng Li To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zhenneng Li Subject: [PATCH] migrate_pages: modify max number of pages to migrate in batch Date: Mon, 24 Jun 2024 12:51:20 +0800 Message-Id: <20240624045120.121261-1-lizhenneng@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E26E0C0008 X-Stat-Signature: 4xbgsx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J2eD4PmUOYOCdpwYEIUjU5Z2C3T4GT+wdB9L9N/NHmQQ= 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: List-Subscribe: List-Unsubscribe: We restrict the number of pages to be migrated to no more than HPAGE_PMD_NR or NR_MAX_BATCHED_MIGRATION, but in fact, the number of pages to be migrated may reach 2*HPAGE_PMD_NR-1 or 2 *NR_MAX_BATCHED_MIGRATION-1, it's not in inconsistent with the context. Please refer to the patch: 42012e0436d4(migrate_pages: restrict number of pages to migrate in batch) Signed-off-by: Zhenneng Li --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 781979567f64..7a4b37aac9e8 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1961,7 +1961,7 @@ int migrate_pages(struct list_head *from, new_folio_t get_new_folio, break; } if (nr_pages >= NR_MAX_BATCHED_MIGRATION) - list_cut_before(&folios, from, &folio2->lru); + list_cut_before(&folios, from, &folio->lru); else list_splice_init(from, &folios); if (mode == MIGRATE_ASYNC)