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 D47DEEB64D9 for ; Mon, 19 Jun 2023 06:54:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58BDC8D0002; Mon, 19 Jun 2023 02:54:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53A3D8D0001; Mon, 19 Jun 2023 02:54:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42A708D0002; Mon, 19 Jun 2023 02:54:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2EFE48D0001 for ; Mon, 19 Jun 2023 02:54:31 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id F106E1A0479 for ; Mon, 19 Jun 2023 06:54:30 +0000 (UTC) X-FDA: 80918583900.23.A8E7CE5 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf15.hostedemail.com (Postfix) with ESMTP id 2E049A0005 for ; Mon, 19 Jun 2023 06:54:27 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687157669; 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=naz/R4lMOEy8D4nEykIjPBVj6rpWahXL4eIUvzMy5Ts=; b=6kDY5sTwdjCL/0t3IwM6xxZeZOZh6XRUqLYNabp/r5pVAxiOpkjuXQmXAXcfZaHeOiG11Q UZW4llF1Df5bEvkUuiDSIOhvM+8QIL4Q/+dRFgBtc3welterssQ8Ovi5bj0mNBjYzYP8Qs LcdEoVtjDqVrj5ZL2p0C5YaeYpLsmoI= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687157669; a=rsa-sha256; cv=none; b=ueySFEI1n+9P3/p0QTb65i7Eh3KarMbnalb7H9f0ydshQGIaM0OF2b+YB0Qym8f9+TDMCV 0LbT8hY+lN80Hj/BJd2XHkzbyLMbWHIPfPQNFsPIWdAxYbEnYq7lCm5ULSiFhlYJwFv9OU IRzjiWVUKThFr1tMG1YFubmRbUqszVE= Received: from dggpemm500014.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Ql0m33pBkzMp5B; Mon, 19 Jun 2023 14:51:15 +0800 (CST) Received: from [10.174.178.120] (10.174.178.120) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 19 Jun 2023 14:54:22 +0800 Message-ID: <0ce6abb5-bf32-a5dc-c6eb-0a96e12a8ebd@huawei.com> Date: Mon, 19 Jun 2023 14:54:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 CC: , , , , , , , , , , , Subject: Re: [PATCH stable 5.10 1/1] mm/memory_hotplug: extend offline_and_remove_memory() to handle more than one memory block Content-Language: en-US To: References: <20230614061900.3296725-1-mawupeng1@huawei.com> <20230614061900.3296725-2-mawupeng1@huawei.com> <2023061440-showing-happiest-937e@gregkh> <2023061927-parsnip-gauging-86e9@gregkh> From: mawupeng In-Reply-To: <2023061927-parsnip-gauging-86e9@gregkh> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.120] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected X-Rspam-User: X-Stat-Signature: mbdba5ixnrgidooz4w773pg6achtqbkx X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2E049A0005 X-HE-Tag: 1687157667-631628 X-HE-Meta: U2FsdGVkX18V2+0W6kUtkR2UrJ2K2PkeFersPtWVZO09jKFQhveSGCngVcytOmgB+7lt0NDshm0HSIiLfUyjSD3TcJ+FmSwESxTGYhREe/xGRVlJkEfr+7bkSe9uqA44u1IFyhcatKV/Ksa5yJWbPVF4QwM2rsDR6Qqtdz2lMR8N6TEjP9ZCfzb00UgSvhoWwu7PTfqAJN38D4GbZKTcEJHPRM5BwSQErqSv5MPhKo4hptvXuHU1HkAj72VGtiTMWnP+CP0jXIf31iCAFR6vFvIc7NatqyIJij28vh1MZCjC9aDM4R78Fzwr15lS1qMbppMLHxwmxFAk/0WHgGIC7saHu+A5gqZEX0/MheC89fFR9/LmjkIh0WMznHg4YMSYGkXs5l7S1Dn5XsW7CYB6CHU2GDrhsNAHPzPT4LAg/Yx2aqmzBhcuLswrYkp7CJsDCwI9ILNI5pHNa7lrykxX+28V2LduUFnVY64kwD0DjpXtExn0Ubn34ZHHMeyRcCgX29ceU1g8eki8F0FF1zSoVqB/jp8kSzK9aDCCALYmIg4m0okQWip7l1e+e4KAPh0ApSYh5k8jkpNXJxllHzPQj7W9u89pIGtqxybBjgKSSGHRFtBTRFkgQpDuXdHHfrvNOQJW2eKsxkg0PHTbtau5nbhAjzz1hbeur1WwRUcsdJwdYTnee+UU67JPX/XfUIwvaKGQyn7XFRk3dKAGY0LzmIKMxqALFB94IFZFDgD/5Z8zXtc8E2wuGKxf4LEts8jwlC2AgmhLpaNCDBwfIJDN7Ca1uxCHxVAKFfSGSC2JCWfiHzaR8Zxm+VjqXjiveL03ILDABM6mM9Tga81P4fRgB3VWuUboSjCD2SLnFG7nG9NdRn0KO9FRaiPr71T4quLJEYl+l+L+rLLcKJ8WL6aHkrG7GtYpEwxqSk9ThhAkJQ7QplwfkLuVdBcruPlK3dAh+2zQM+6o/7lY1FtnpwW hPJVR3rO AzBOHA/6jy9LJI2y+8yg6OdFI9W/v03zEY4rIdWFG3EB6BVmy1khbaugbaTMHz2Q78HGvXuMthLYEKNPZgp0o/h6Yvbr1VPpOsrCzqKH3tpcn3W4n8eXZ0j4CtYbhvViNEYdI9fF+5GmUi3AT6vhVnmYIrVKO5nbyQP3SiYfnG90/cb2eRhKGEyDqkZ153eUhcT+cuMRVEs5IIA4WSMht1Tf/Zk/7sV0B2RfyCaWFkDx7iYUtPaNgRWP1oyLgm43HZAEeQhYT+Xj83hN1GGf+vWCdr7fuiiS+TLLGMJu3tbtR8mCyjvJGw656bVrqgevr7dyVrLphRGHfsUbu1d3UkYzN3p0zo2sk4jOCcb4rNcEnMdeSR3pP8Ar6WyKwiLfcvLWQR9Q0usq9ygc3QUTHyu5qwdj70xTx0D5DJYT+1X054EHaisuEndMOySCBmsDMlLFEGbdjHoyVGJZF9eMT3P7hnQ== 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 2023/6/19 14:20, Greg KH wrote: > On Wed, Jun 14, 2023 at 02:45:58PM +0800, mawupeng wrote: >> >> >> On 2023/6/14 14:35, Greg KH wrote: >>> On Wed, Jun 14, 2023 at 02:19:00PM +0800, Wupeng Ma wrote: >>>> From: David Hildenbrand >>>> >>>> virtio-mem soon wants to use offline_and_remove_memory() memory that >>>> exceeds a single Linux memory block (memory_block_size_bytes()). Let's >>>> remove that restriction. >>>> >>>> Let's remember the old state and try to restore that if anything goes >>>> wrong. While re-onlining can, in general, fail, it's highly unlikely to >>>> happen (usually only when a notifier fails to allocate memory, and these >>>> are rather rare). >>>> >>>> This will be used by virtio-mem to offline+remove memory ranges that are >>>> bigger than a single memory block - for example, with a device block >>>> size of 1 GiB (e.g., gigantic pages in the hypervisor) and a Linux memory >>>> block size of 128MB. >>>> >>>> While we could compress the state into 2 bit, using 8 bit is much >>>> easier. >>>> >>>> This handling is similar, but different to acpi_scan_try_to_offline(): >>>> >>>> a) We don't try to offline twice. I am not sure if this CONFIG_MEMCG >>>> optimization is still relevant - it should only apply to ZONE_NORMAL >>>> (where we have no guarantees). If relevant, we can always add it. >>>> >>>> b) acpi_scan_try_to_offline() simply onlines all memory in case >>>> something goes wrong. It doesn't restore previous online type. Let's do >>>> that, so we won't overwrite what e.g., user space configured. >>>> >>>> Reviewed-by: Wei Yang >>>> Cc: "Michael S. Tsirkin" >>>> Cc: Jason Wang >>>> Cc: Pankaj Gupta >>>> Cc: Michal Hocko >>>> Cc: Oscar Salvador >>>> Cc: Wei Yang >>>> Cc: Andrew Morton >>>> Signed-off-by: David Hildenbrand >>>> Link: https://lore.kernel.org/r/20201112133815.13332-28-david@redhat.com >>>> Signed-off-by: Michael S. Tsirkin >>>> Acked-by: Andrew Morton >>>> --- >>>> mm/memory_hotplug.c | 105 +++++++++++++++++++++++++++++++++++++------- >>>> 1 file changed, 89 insertions(+), 16 deletions(-) >>> >>> As you forwarded this patch on, you too need to sign-off on it. >> >> Thanks for reminding me. >> >> Signed-off-by: Ma Wupeng >> >>> >>> Also, what is the git id of the commit in Linus's tree? >> >> Sorry, here is the commit in Linus's tree. >> >> commit 8dc4bb58a146655eb057247d7c9d19e73928715b upstream. > > Please resend the change with both of these things fixed up, so I don't > have to manually do it :) I have resend the patch but use the parent message id for in-reply-to. Sorry. > > thanks, > > greg k-h