From patchwork Mon Jun 24 04:41:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenneng Li X-Patchwork-Id: 13708911 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 667E1C2BD09 for ; Mon, 24 Jun 2024 04:42:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A41C96B0448; Mon, 24 Jun 2024 00:42:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F1726B044A; Mon, 24 Jun 2024 00:42:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B9736B044C; Mon, 24 Jun 2024 00:42:44 -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 6DE136B0448 for ; Mon, 24 Jun 2024 00:42:44 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DEC12A0AB7 for ; Mon, 24 Jun 2024 04:42:43 +0000 (UTC) X-FDA: 82264536606.09.2DDBE5F Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by imf26.hostedemail.com (Postfix) with ESMTP id 4A52C140012 for ; Mon, 24 Jun 2024 04:42:39 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.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=1719204154; a=rsa-sha256; cv=none; b=prmWmmADCZWEAr3gjA4JYFbdkoRmlU2wKZ9rwev8+z3SQe9AyYItuJWIZn5ptrTm13ZNJq gZG5WtrSJe/Xt/hxfunymOanI3nzptcjBhqsz7qKoRK890DJSy4PhcK/tn5lMzbA8y6vib crys/Mu6ehuKgXvHLrZmDeAxIdjCuXA= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.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=1719204154; 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=uhlZqhDEfHlmNMUtLcNTtx1DRV34oF98zin9mIQpqAcGZaxW/SjVWigGUBX2lyI3Vs7oxt zYTwPevScUMQJ5Ogg+CtnUGhLWVnPbZdrEz77WU05TXd9T3s4OWtCgu++ijBo2T7aftuI2 rPGjjQluJeOwDDn28ROmR+rDl8YFYEU= X-UUID: 2b68c9dc31e411ef9305a59a3cc225df-20240624 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.38,REQID:53c491e2-b8da-4ec8-862d-4f50d5d39a69,IP:15, URL:0,TC:0,Content:0,EDM:25,RT:0,SF:5,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:45 X-CID-INFO: VERSION:1.1.38,REQID:53c491e2-b8da-4ec8-862d-4f50d5d39a69,IP:15,UR L:0,TC:0,Content:0,EDM:25,RT:0,SF:5,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:45 X-CID-META: VersionHash:82c5f88,CLOUDID:728743b82fceb780fd9822236738bdd0,BulkI D:24062412423347W5T7XY,BulkQuantity:0,Recheck:0,SF:19|43|74|66|25|72|102,T C:nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,RT:nil,Bulk:nil,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,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 2b68c9dc31e411ef9305a59a3cc225df-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 923631648; Mon, 24 Jun 2024 12:42:32 +0800 From: Zhenneng Li To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] migrate_pages: modify max number of pages to migrate in batch Date: Mon, 24 Jun 2024 12:41:40 +0800 Message-Id: <20240624044140.117196-1-lizhenneng@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Stat-Signature: 4xbgsxw3n4dggghn6wghxjr8gcee15rj X-Rspamd-Queue-Id: 4A52C140012 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1719204159-341814 X-HE-Meta: U2FsdGVkX1/Zer4gkx6kk236/6V7S/KJgbTtNcks/QjSwPvixo8vMYdRXfzmOhS39HRCW2h4pJjv9Q9xfPxYZgiu4ITxUgp3Gv8t1vSpflj4k0UPzCNZjsU8xXNXUrjzCFKtWxSC827BGq3zhhdLGP55l9krorVO+5rE8uYS0CmQq91XopLW4JpILLaEMfDR89MsEyG8939GBNBaTzYSfQ57j0h4I0GZLfktTeoWB9Rno8xsxHqeKu0T0nWvfJu5eF42ag5xaQrhCHU6hxu2z+p1XiPqRpbwQhwg8PHDvT69U+FSVr4vFBdu8DmbPh28QD/rvW2XOus4ie79I+SvCn3ay6lAR1KpB7g1i6EhvGpYKgysd5BSqgBzT8c6b9P+EvmlkuM5kCsgoRsX/2igWs5z7ROOhf9sgz2eWWrK2GkUadx/9cPHl3cYgl97ikDIKh+25pNlZDc5zacYQKPokmOLPpIistngTve/Kx48uK+2ZkuwfQsRcuOFYeK8QV7de+68SAlhsw5wXZ6fpJwfMws1Qzxf61FffIF3s9CvYKIvyb0YaiYBJEeYlIrFwgEJceIGMK+GH7QqXNf8mpI3vx9/FMdRU6WfzlR27zeSv3MhLj7kuQXFJ4Ap/8SVc8yvbnc74i3zw9u7H/9jZoi+OPLgTkRk0x9R5+dLJ+kJfcgIGmtf82NkV5JISs8aCkGgV0eOmZ2txgNOZlMStWDiphUtOqCwXTa23rILsslzOIYlIx/qR+RSqfAqbsW16px9dzdeoHW6SXQ36MznPbJRCjZOVo6xmwjiznpEAWQF5GLY/8PvHybhHPvQQplId7oUDROPdiZEImr6YH/jPlVxdui2z8IGWMcRZyiLo8f81iHHQ54IZQoMudZ0+RVFn7Av8HA7L26/7GPMhohnNK4DN6pH1SbUqgiZX+yUo2bdDSQpbRIcLxpEGC31MvGSJfUhik1TfPackAButLJ7Y/r 0qNKMhGM uMYO0FD4q6y876NW3FphAwwz++RuF3mWqQ9AV9uY1vsgxDVSKWSYjmnGynNy8/LDLOKKQdzaQ14+ozwc= 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)