From patchwork Sat Aug 19 10:52:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13358588 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 03D5DEE49A5 for ; Sat, 19 Aug 2023 10:52:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26D5B900006; Sat, 19 Aug 2023 06:52:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21C44900004; Sat, 19 Aug 2023 06:52:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 132B6900006; Sat, 19 Aug 2023 06:52:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0510F900004 for ; Sat, 19 Aug 2023 06:52:52 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CC9654084D for ; Sat, 19 Aug 2023 10:52:51 +0000 (UTC) X-FDA: 81140541342.05.07D5142 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf20.hostedemail.com (Postfix) with ESMTP id CCA8B1C0015 for ; Sat, 19 Aug 2023 10:52:47 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692442370; 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=U+L8i5gOeEFLWk8o370qrf95qh5CQ5Nm2wvF69oJhr4=; b=MqDZwvApfCaY1nTwXJBj4cUJuAih0sCoUy7984WR8IMbfU3Q68PSOZO5Du1BHOtP0w9+iB 1SuoNYVxXz2Q7a+sO7mLRK4sDqmzwRUawKDfzvO1iVnMZs7Nvhcn1UELrWzslTs+SAz51C +3B3RwNotFlqD2/16rWcnzPL3zxqsQU= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692442370; a=rsa-sha256; cv=none; b=ll+aUEsYSFS0IWDdtX3lm0mIJ+0taKNF61Zvtvfg/Bl9ngQ4vpBSHt4eQ9HmI3S66aY7E8 t7cpjLWFj2HvWmxagJd3orlObJaTyBVxRu+Irk7K/kB8GTKZWsu9D4U4xHNfTQouVxiC6C jZ7UW1fAsb9k4FWVLksdjm/CmlXHaTs= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0Vq56BWP_1692442360; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0Vq56BWP_1692442360) by smtp.aliyun-inc.com; Sat, 19 Aug 2023 18:52:41 +0800 From: Baolin Wang To: akpm@linux-foundation.org Cc: mgorman@techsingularity.net, shy828301@gmail.com, david@redhat.com, ying.huang@intel.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] Extend migrate_misplaced_page() to support batch migration Date: Sat, 19 Aug 2023 18:52:33 +0800 Message-Id: X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Rspamd-Queue-Id: CCA8B1C0015 X-Rspam-User: X-Stat-Signature: pnaiqdyw1jnqyrrwdmmqn1wfqjao5398 X-Rspamd-Server: rspam01 X-HE-Tag: 1692442367-104354 X-HE-Meta: U2FsdGVkX1+XbKd2q08gi0TMv92fgw0WbT9yo9o+9MvrMUDEdxPx0/bIoWNgbpshknmO9n6JLlrVoe+DmTOg6Y5ikTEhldJWpPWJXoEgP2dcONKatUqQV3NT9A/VU27Q3BJ11CXV3eb/3g2XFeoVyn4c/czHV7CYJKBsj2Z5BQ9iP9UXRbqGqQzXtACEMrNNjqGsfmPxY25Of4Q5l1mU8dffethXifqTu17I+AEkmUqf31aYI679SfXVj/BfX9Lem2cffVFscOMTcXW2NGS4HBmV0Gj9F61lsac4revrbi3zGsFhoDLzGEW+c2mR5ePavHiNpFL97o11hven+NPTctoKXK4iekXZC7AxSF4OouolfWnbtGRLXE7Ipkj39Q6Yhi84SzKjZZE4YRFopJx5OX9KNSkdSg5T0qDqPi/LO/mnNPu3Dp6TpCCHGrYl8GwO4vTTFNIDwiy9+aaqW4a2JpWZl11vx/7XIno5iAwC0K/60Hr0h/vx5tG0dudJlDr+afOzFlcsDbchxv5fw8n1CqrwotkShNFhAN214CW569fvVvyATRjAMtjgC+IAT2Y7Q4iWiz0zt3YjTW5uvhBpWaCz2pSnrA1SkcHC/6y9BZn/NF5m9sh4RN49UkVx03/XG4hIBrfVgVTS4bpmikmG9YDQSOrFPs3lYsOm5+90myO4NnVTzISAHpmXSFYpjiwAou0lJBYMW90q+C/IIY6J9+mYsSPyO0MjFjHrdCNFMMmgiGO5/Yz2Qd0l9Ik6b6tv7UwpdQuIHX+V4Zze32Agw3RZMOy8IGQj6J1fNg1mZc7qsZ5nzgTo2/vZupRIlHyxEz9Cy0pndyCCxsWk6qVGuiMvwMkTRqHPCai6BxvyABSgKACSHLnUm3TePQMB1H7DCeyZ0GJQBntpQBcqa7Y07E5sZfcZJsZa6aDzHA/IzR17EBbQ2l69mg3c7+lrEcwCJtZvixYDuZ791KTXUad Ay5+rNLu teyxz1lqVjug2UA4Duqlyr/RRJYFv7m1HBksslTd4k1yD2fn6G39iJtwwMGk6FEzwRaJkgWoNb42RPRYIZ2GbSaTlj1V0b7GfxKmTN+N0Bl8ypaW6qPUAunhXVVtiS+Tyif1r/LJ3Zhd0X+ozks2hUGC4fDdTEQZXIS796ONq2DMkw6/gHYut+SSDxQAkKhujM64d23HsCF84f1zuTtMkWn7JAHUCo9Yk3KmprhdSEbKrFucce9Q9WwhxEOi0zTq1GUyYZWVCGkwEQ40= 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: Hi, Currently, on our ARM servers with NUMA enabled, we found the cross-die latency is a little larger that will significantly impact the workload's performance. So on ARM servers we will rely on the NUMA balancing to avoid the cross-die accessing. And I posted a patchset[1] to support speculative numa fault to improve the NUMA balancing's performance according to the principle of data locality. Moreover, thanks to Huang Ying's patchset[2], which introduced batch migration as a way to reduce the cost of TLB flush, and it will also benefit the migration of multiple pages all at once during NUMA balancing. So we plan to continue to support batch migration in do_numa_page() to improve the NUMA balancing's performance, but before adding complicated batch migration algorithm for NUMA balancing, some cleanup and preparation work need to do firstly, which are done in this patch set. In short, this patchset extends the migrate_misplaced_page() interface to support batch migration, and no functional changes intended. [1] https://lore.kernel.org/lkml/cover.1639306956.git.baolin.wang@linux.alibaba.com/t/#mc45929849b5d0e29b5fdd9d50425f8e95b8f2563 [2] https://lore.kernel.org/all/20230213123444.155149-1-ying.huang@intel.com/T/#u Baolin Wang (4): mm: migrate: move migration validation into numa_migrate_prep() mm: migrate: move the numamigrate_isolate_page() into do_numa_page() mm: migrate: change migrate_misplaced_page() to support multiple pages migration mm: migrate: change to return the number of pages migrated successfully include/linux/migrate.h | 15 ++++++++--- mm/huge_memory.c | 19 +++++++++++--- mm/memory.c | 34 +++++++++++++++++++++++- mm/migrate.c | 58 ++++++++--------------------------------- 4 files changed, 71 insertions(+), 55 deletions(-)