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 C1AB0C36002 for ; Mon, 7 Apr 2025 01:59:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 963026B0005; Sun, 6 Apr 2025 21:59:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 910D86B0007; Sun, 6 Apr 2025 21:59:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DB146B0008; Sun, 6 Apr 2025 21:59:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5FFE36B0005 for ; Sun, 6 Apr 2025 21:59:34 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 97F2DC08FD for ; Mon, 7 Apr 2025 01:59:28 +0000 (UTC) X-FDA: 83305590816.06.DD9BC7D Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf06.hostedemail.com (Postfix) with ESMTP id D57DE18000A for ; Mon, 7 Apr 2025 01:59:26 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=nH3k8PQh; dmarc=none; spf=pass (imf06.hostedemail.com: domain of akpm@linux-foundation.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743991167; a=rsa-sha256; cv=none; b=7nH0yFlIonK/Ic1j85B8hHk/BY91AZIUEb7xMwj18UQkoNxIoI9FHo2nkRJa8wsY6AIFEr jt66DFBQtD8h3rNYelZBYLp4ilZL6uSVo7c92WuHTl4+ZFkrs/bn0jKZ7LBejyC2eF8Q6s PsKrVUzDSjtzaJPkrMYbAxyZp2gy9J4= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=nH3k8PQh; dmarc=none; spf=pass (imf06.hostedemail.com: domain of akpm@linux-foundation.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743991167; 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:dkim-signature; bh=RmCkflft8aaUOej9FLa9cl6EjA5IEqysfkYmg2J79og=; b=0Ub9Z5kJ9jGW6xhDpy69EnzBrnSJQ6wfCLD/fYP4MhEzStkge24Hg0L9fLRVHQVujncTYM vaUNL6InKNkaa8Ov/RS6cRDVJD1ldPLI3UbQQJx1U7wCUVVw3G0XRfNJSGtMeZUY0Gf9RO x8WjGneeQq+2dGGG7gZITU0tTRDrCuE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 5A393A46085; Mon, 7 Apr 2025 01:53:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79807C4CEE3; Mon, 7 Apr 2025 01:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1743991165; bh=1E89Z1s86qmfj/CIH6RaUoZb/Til+Z7eBn8BY/u0S1w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nH3k8PQhVr4GZAjt0Rk1HvxLKMKkpBEEt0AouJsE0C/y1gJ7YTIhCYUVyAzpRB1vn xz6pJ8c4Jm1UIzuFs2IjcuYVnxofgRXO9UfezvH4qok0JrmloSeBHcwSfQgu9ITwRO 5uDeXhzGrIT0yrYZUTFsJxS0WFrf+ZCNwSgR6yE4= Date: Sun, 6 Apr 2025 18:59:24 -0700 From: Andrew Morton To: David Hildenbrand Cc: Jinjiang Tu , osalvador@suse.de, nao.horiguchi@gmail.com, zi.yan@cs.rutgers.edu, linux-mm@kvack.org, wangkefeng.wang@huawei.com, sunnanyong@huawei.com Subject: Re: [PATCH] mm/memory_hotplug: fix call folio_test_large with tail page in do_migrate_range Message-Id: <20250406185924.451276bf79b7a26fe5ae7ae4@linux-foundation.org> In-Reply-To: <0a636dd6-3d19-4a3b-8645-21c7b85a4aff@redhat.com> References: <20250324131750.1551884-1-tujinjiang@huawei.com> <899807c3-931f-43e6-bf3e-188787a4205a@redhat.com> <68ab727b-dc3d-327f-33b6-25bbfce8530e@huawei.com> <20250328163700.82c9b426bf199102f3d90dcd@linux-foundation.org> <0a636dd6-3d19-4a3b-8645-21c7b85a4aff@redhat.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D57DE18000A X-Stat-Signature: tpa45t4ko1o5h9h8atzjr56uauustiwn X-Rspam-User: X-HE-Tag: 1743991166-522902 X-HE-Meta: U2FsdGVkX1+m2OyKTWP6mJtCUcb3IxFt3YkWtnSImNJeDeKz2yxElUg+uBT5jq9pJTKUvySFkQWuDlz6crpJH0I+hZ6cRQSpfBF7EWoLKJ++p7vpzN4II9TJOJjFUK4ZaJ33P5LHCCxSni4efuhpHVGjZ09ljlsV1fhxnAr22W8sQfXuUMy7uQmNxCG+/dqbCZCV7v4QILVfGi3Mh0zovDUxEazPvgeHRi7jfh5wixNQ7LnFVGabbiw0VmKlO+nAaPOj7lpK3z9EjbQRKgXpKlPVnaDFwqnx1/4dfZxFSnhZrYEhRefkZphvtlev8+0tmB3O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-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: On Tue, 1 Apr 2025 18:44:06 +0200 David Hildenbrand wrote: > On 29.03.25 00:37, Andrew Morton wrote: > > On Tue, 25 Mar 2025 20:05:50 +0100 David Hildenbrand wrote: > > > >> On 25.03.25 04:02, Jinjiang Tu wrote: > >>> > >>>> Moving that will not make it able to skip the large frozen > >>>> (refcount==0, e.g., free hugetlb) folio in the continue/put_folio case > >>>> above. Hmmmm .. > >>> For free hugetlb, pfn is increased by 1 in each loop. This leads to skip > >>> free hugetlb slower. > >> > >> Yes. But now I realize that we have the same issue with free buddy pages > >> already (folio_try_get of each individual page :( ). > >> > >>>> > >>>> We could similarly to dumping folios, snapshot them, so we can read > >>>> stable data. > >>> extract the code in __dump_page()? But snapshot may lead to > >>> do_migrate_range() slower too. > >> > >> There is a patch series on the list to do that, but it might take a > >> while to clean that up. Ideally, we'd also jump over free buddy pages. > >> In the future we might have better ways to do that. > >> > >> I don't consider this change here really important, but if all it > >> affects is free hugetlb folios, it's not really worth it to have this > >> code around. > >> > >> Acked-by: David Hildenbrand > >> > >> But: I suspect 8135d8926c08 is not the introducing commit. Please re-verify. > >> > >> We should not CC stable. > > > > Sorry for the late reply. > > > Why shouldn't we cc:stable? A userspace-triggerable BUG? > > My reasoning was that it's a VM_BUG_ON_PAGE, and nothing is actually > broken on !CONFIG_DEBUG_VM systems ... combined with hugetlb allocation > and memory offlining usually being rare and usually privileged operations. > > It would be a different story if the VM_BUG_ON_PAGE revealed an actual > issue; but this is a well documented race. > > One might argue that unplugging a DIMM could automatically trigger it > (rare operation ..), and as we discovered in the meantime, THPs are also > affected. But again, CONFIG_VM_DEBUG ... which even Fedora stopped setting. > > So I don't think CC stable is warranted here, but I wouldn't object if > there are good reasons to do it: like assuming that there are > CONFIG_VM_DEBUG stable users out there that rely on these features. Oh. I thought that quite a few distros use CONFIG_DEBUG_VM. I think I shall add the cc:stable - the patch is pretty simple and will be well tested by the time it hits -stable trees and probably someone will benefit from it.