From mboxrd@z Thu Jan 1 00:00:00 1970 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 D938AEE49A5 for ; Mon, 21 Aug 2023 08:10:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 023848D0008; Mon, 21 Aug 2023 04:10:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F16088D0001; Mon, 21 Aug 2023 04:10:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E06418D0008; Mon, 21 Aug 2023 04:10:16 -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 D05A08D0001 for ; Mon, 21 Aug 2023 04:10:16 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 99492140B48 for ; Mon, 21 Aug 2023 08:10:16 +0000 (UTC) X-FDA: 81147389232.22.767781D Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) by imf04.hostedemail.com (Postfix) with ESMTP id 7F0EB4001D for ; Mon, 21 Aug 2023 08:10:12 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf04.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.111 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=1692605414; 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:in-reply-to:references:references; bh=6buOu7+t/fkkReMVFyWlZd5b/xUoLG8QayXWsbnyp8Y=; b=pHzZO2X0JL3isBJ303PYxInnR11TlA0vg4iRSzbrk+lyRGHQGIaSp4EnB9teM0d98PzHIt LVpBuRCzSPkIse+thW7KvnhBY0UV5MmYp1smPS/tjO1cpTPItu1+6LwqHBCUypKX4Qgeie 8GpuoUDNnfOCxRNYokHZ7SJXtANpLS0= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf04.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.111 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692605415; a=rsa-sha256; cv=none; b=FHOaGWks0bd4y4eME3NAmh9jIBXOHu1MNG9BY06lfOXgeX0u4QDxOBqLK3z7RxLw3QpRPK 52fBKhIkMeONhDNcoYPiW76ruhTA/Ss24p0wyAwquVsBPQ5UkMJqdTZmkJ7BeOcN8vfWA8 wsGTdJVSgVO4Yuafq4xEvqLG2tfTINY= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VqD7Njw_1692605407; Received: from 30.97.48.69(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VqD7Njw_1692605407) by smtp.aliyun-inc.com; Mon, 21 Aug 2023 16:10:08 +0800 Message-ID: <21099f59-c660-41a3-e422-0c14ac5d0fac@linux.alibaba.com> Date: Mon, 21 Aug 2023 16:10:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH 0/4] Extend migrate_misplaced_page() to support batch migration To: "Huang, Ying" Cc: akpm@linux-foundation.org, mgorman@techsingularity.net, shy828301@gmail.com, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <87cyzhdt5r.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Baolin Wang In-Reply-To: <87cyzhdt5r.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 7F0EB4001D X-Stat-Signature: o516sodnepfwjg1bdao4a7nwkn9hhego X-HE-Tag: 1692605412-912580 X-HE-Meta: U2FsdGVkX1+PXGpV/op/owzwoEi23NdixXmUWF18T6d+1GZgFXT6uWgcc9nbbPQBL4Ekqc+klOGH/6uRZ6LUWsoeXIb6kE5alBkf0ye5N5NtvzuNbKMXQP6D7XZiawhMJKTSSwAbZX9mZ3cMQDy+IK8SHz8dHbq7uL8kSmVyM+KICD8lipS0qamshoicNOaKLzbKM5HSi6jbG3S75u+DvZnPF15Py16g0EEIaSMTZw+7oMtbxGbElEQPCi/4unAOesx1HDwvyJRv15RYoLE4lZYVBhFDD8bw0hSAcsT1yb20sto0mbtGFxiS6IqLtpouXOQ1mLnTCPYJcdZ4KIqNJ7l6wxa9rNUusMuG+Yd3OwSkuzViKJxJ5ZXwoR2zxUCR27Jl4xuRI2nA+FCn9aXMDtBvPafx+I8wfAzEbydPIlc94p+oZSO+FccqGZGIZfbqtFVJduF1b8lu0rKJU8EunwKj47sFj2l3MWxl0SQNpviR9f4kD9KnkXlUJmO/b19w7hqxZV6xkI4h17UKWfv4ARae1TBA7xN04ZLKjQ1FUOuzXZv73UDSIH+0fsWXgoz6z2sirU4uyhxlElYdistdLIgGvFSPOFldojZcm049Y3IhYxpW0eJSqCQIlyP9yNjBTSB6zoAySPNQ/Rp/Q+pCRJ+hOIjW9tWvbyt2b8r+J8IWytQm5gmVI1bG04dw9dN4cewEgAjscyQABFVQrljxEuXDdZLOfhbBPNLj6HNpu0zww29RqdcCMpnaSojI77F7GT5V3VKyCDUa9RtpCQQ9kKDGq/m/Gh/25F8TPmJJdQj7XO6S3mrvCeMLVKUXNFhCGgHg/1uApF7DNum3Ijv0gZiKXoC9WJP7eX23WIJ4mr0hD1LNsEAeU3jLxk/kxHodCWeGMmyf3nxqCjHBZB+zlArhNKHTT55uywpGDzntrZijKaBqARJXz1kh2eBiB1zjipGdeFl6kHeEaXevbev wsaYZAvn f2+2CcYJuDjZ/fawIK+YNPj8U6XACvUNlsWwIOnbQkV0piP4T/UUdk4HJXRh6ahObfatRETau/OQvPnJ0d8KRIh4JBmQ7QRPVjSL0U1EMXFcSIH0aiwvj10Qtrov3kVW7wlbrYc/aoktkn/UrU+w4kh1gK7qlu40C1V3TdpAY0DbzOXHjDks2qgf7HHNxGR7XARYIdxmLHLXHbwwzbidt8XSbgC/jsiHjJ3KNyPEUEP7AmpPhvrORAmrND3cGa6jGc/nH4kX3LVEm64f9hLM8OS+4dLMRi2FOnoRZoqeqmJpwhjM= 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: On 8/21/2023 10:29 AM, Huang, Ying wrote: > Baolin Wang writes: > >> 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. > > Will these cleanup benefit anything except batching migration? If not, I hope these cleanup can also benefit the compound page's NUMA balancing, which was discussed in the thread[1]. IIUC, for the compound page's NUMA balancing, it is possible that partial pages were successfully migrated, so it is necessary to return the number of pages that were successfully migrated from migrate_misplaced_page(). (But I did not look this in detail yet, please correct me if I missed something, and I will find some time to look this in detail). That is why I think these cleanups are straightforward. Yes, I will post the batch migration patches after more polish and testing, but I think these cleanups are separate and straightforward, so I plan to submit the patches separately. [1] https://lore.kernel.org/all/f8d47176-03a8-99bf-a813-b5942830fd73@arm.com/ > I suggest you to post the whole series. In this way, people will be > more clear about why we need these cleanup. > > -- > Best Regards, > Huang, Ying > >> [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(-)