Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2948291lqo; Tue, 14 May 2024 14:42:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8Du1WP4RNDJpCtmUBx9oI7qyKMDUwqw3R9CNVVyk7lcHy2xwGXmEUXiX3zieg8b0TizkNKhQsDc8YrFxz1Lcu52NWTAENdHUbtTIExw== X-Google-Smtp-Source: AGHT+IH+hEiGE3TqRBOIm1uX7U7ukqbq0PJS4QgCWYiBTgboRIJiVmKINsR0T1i41v854GHs9cPn X-Received: by 2002:a05:6122:2a49:b0:4df:19c0:8702 with SMTP id 71dfb90a1353d-4df88285831mr12392205e0c.1.1715722934878; Tue, 14 May 2024 14:42:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715722934; cv=pass; d=google.com; s=arc-20160816; b=bJpDGXf2NKZPbY2voDWQo4DU62t5ZgC5LN8SXHGvlO8nWveo/COcdJ4JukB7dfZHHu 3tTlV0g2cbO891tcdURYNwNFoGI730mioJhDw8CwIvIgFMgEejt5GE1u+7rLLPDA13Yq mWUIZfVkxjkZZXE+gKOqPwyGAZiGClJSgn277S9ZSoRTVJsbw6Eu49wRb034cg0a2kOz YccziY0jjp/gI5X4+5bSX/huJJGJA55I+BMANi+VL84DJ1TzkVJy0Pj1F7NrJf2KqQop AQf4GrFKrn9evAecaj55lUCLhRt01bXGvTQLybvlAsZCgbqaX/SZdkodTisYCShVfWvO gHxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=ks6u9E1Xb1SPvmbnr2M2wRzSluaspaKIb88gMsCbdnw=; fh=QzZwURWiOPKkBEJhIb9U0GBEUOZcFlFct9ptobL9AQk=; b=rQ5+6YjEjEzX5xhYauYv7Gm5eShFLr2DFa+rILwNh3Ifk6c3AciS+R0oZ8wRTzBCuB GwCUnxNnnTOghRuUZBpMFWMgOBB6byAViPu7hHFqR8AJdUVz4jz8H+EYFPzCBy00rMcp 4AdOQGD0BVV9twEUCyydWmP4unnuVn522nlo4gU1xbt9YRAp21CUWrypMj3zRFhJKF4H WKPR6o/2da1cl3GTO2ZUm6F9MraIQ8Sqdl5Pkx83HaxaMuxBb5EKAHz5R1KpotN6+sSb sSE9Y7jaVilw1h7jaq9bRrqEg9QFvmC/+tNGCEskUYxoSUewG+ZcI+Ggk/hJls6vjXv6 rz0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=P5UIieNZ; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-179201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179201-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f3053e3si128278956d6.568.2024.05.14.14.42.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 14:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=P5UIieNZ; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-179201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179201-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E7A781C218B0 for ; Tue, 14 May 2024 21:42:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3512D181BBF; Tue, 14 May 2024 21:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="P5UIieNZ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58263180A77 for ; Tue, 14 May 2024 21:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715722926; cv=none; b=reXVKDvrUZ+783D9Qb5cpwVROqyFg9XpDo+hkGnTw9ZUvJuJepbXayZdiOpQbgHjO3ZqRDy092k+I1ycDfYWOww3XT59lLhAOmEDu5lPRynj21Mh09zg2y1HXNVcg2rNsAnBIVxlmkbXHgU+TvWWnUp+QPNcWKjx9YhImkp7DMk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715722926; c=relaxed/simple; bh=x41lt0y2/QQyRA72DsKY8/rDqXNocvlTMgmU6V5lH0I=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=u4xzqqyrYkbD3wJxXbdb+hidXZ/eKB/3pxLOxkvNEfheXngkODE1HPnnQE7cRA9+/6aZ8YDb/XVUmjMdx/lcdl5K++VL0Yj9JAHaSkgegLc/30hVWZ331RwIdK3jLZRwSZ6H0yGcEegBsrMtxoSdaDBawbe0WXS9H8L57YjNwzs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=P5UIieNZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF82EC2BD10; Tue, 14 May 2024 21:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1715722926; bh=x41lt0y2/QQyRA72DsKY8/rDqXNocvlTMgmU6V5lH0I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=P5UIieNZ0IdpOVfPq5FxAu27iLPTufnjnFL1dLaAqkJ5lR/DYq1p6bfBWt8BHIQE9 sSaZEkF6zWQ5F85/BD1R6J6tYPT0fmeTg5oG/UoG/ptjPj79piaR69ajMN1ZkF/s2Z xsWKJgYelqGa2xrkO8vGfVg0wQgYl8JqT0RpvEhI= Date: Tue, 14 May 2024 14:42:04 -0700 From: Andrew Morton To: Yang Shi Cc: Miaohe Lin , nao.horiguchi@gmail.com, xuyu@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -rc7] mm/huge_memory: mark huge_zero_page reserved Message-Id: <20240514144204.88790f125b0275ef68acf6de@linux-foundation.org> In-Reply-To: References: <20240511035435.1477004-1-linmiaohe@huawei.com> <20240514141439.55fba39c81c1af55c9a100e1@linux-foundation.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Tue, 14 May 2024 15:28:12 -0600 Yang Shi wrote: > On Tue, May 14, 2024 at 3:14 PM Andrew Morton wrote: > > > > On Sat, 11 May 2024 11:54:35 +0800 Miaohe Lin wrote: > > > > > When I did memory failure tests recently, below panic occurs: > > > > > > kernel BUG at include/linux/mm.h:1135! > > > invalid opcode: 0000 [#1] PREEMPT SMP NOPTI > > > CPU: 9 PID: 137 Comm: kswapd1 Not tainted 6.9.0-rc4-00491-gd5ce28f156fe-dirty #14 > > > > > > ... > > > > > > --- a/mm/huge_memory.c > > > +++ b/mm/huge_memory.c > > > @@ -208,6 +208,7 @@ static bool get_huge_zero_page(void) > > > __free_pages(zero_page, compound_order(zero_page)); > > > goto retry; > > > } > > > + __SetPageReserved(zero_page); > > > WRITE_ONCE(huge_zero_pfn, page_to_pfn(zero_page)); > > > > > > /* We take additional reference here. It will be put back by shrinker */ > > > @@ -260,6 +261,7 @@ static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink, > > > struct page *zero_page = xchg(&huge_zero_page, NULL); > > > BUG_ON(zero_page == NULL); > > > WRITE_ONCE(huge_zero_pfn, ~0UL); > > > + __ClearPageReserved(zero_page); > > > __free_pages(zero_page, compound_order(zero_page)); > > > return HPAGE_PMD_NR; > > > } > > > > This causes a bit of a mess when staged ahead of mm-stable. So to > > avoid disruption I staged it behind mm-stable. This means that when > > the -stable maintainers try to merge it, they will ask for a fixed up > > version for older kernels so you can please just send them this > > version. > > Can you please drop this from mm-unstable since both I and David > nack'ed a similar patch in another thread. > https://lore.kernel.org/linux-mm/20240511032801.1295023-1-linmiaohe@huawei.com/ That appears to link to the incorrect email thread?