From mboxrd@z Thu Jan 1 00:00:00 1970 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 B6FA34316B for ; Wed, 15 May 2024 07:28:34 +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=1715758114; cv=none; b=VfN8of+s29uqr6I1J5cz3FWhGM7l2c/H7XJCjQk3/pjsEoer34W04W6y9cT791d4roJoifwdO0fff2yylEd9Esgkddgl36QhykPL3KVZ9bfSN9AvRuvJVDIU14tC8QXJv9tQJ/iIYPlqx8h+KEpYasXRGJTbzwCiL9xqlnY2rLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715758114; c=relaxed/simple; bh=UzGsJREsrm5TsgJkDsjQE+/P0Hg32vH0deHEFYLx9jk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fhuww/hwPs2FruRb24nfVtri2hRg9/1m04SBxuMSK7rHoaShWX/rbe8BsWRJ4xwplwpsk54vBwjGj/ybFcry1ix0dPt8Wl4DlN2iX2Rsq4D4bjOZvAuUi7WQpdAS4EFWEeKlUskwUcoT6VfmVPoXZPoE0pUJecH5eB83H3BYvWE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1QoPqTuI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1QoPqTuI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6F73C116B1; Wed, 15 May 2024 07:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715758114; bh=UzGsJREsrm5TsgJkDsjQE+/P0Hg32vH0deHEFYLx9jk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1QoPqTuIMe3rK+BG+0AJFNVEYXHZbud9XMQSQFMqXF4sYCV0DaRlhz4LlNeTn6foZ ZfenlfwivzKWx8OklPNrTYQ1Qve95GY47/YfKGvGJOdZTeANjYN3WuQQgS91XmmX1L VdiRmdqlKIZGDFdeAiLZAg11y0TN7kWBHWkzX1eA= Date: Wed, 15 May 2024 09:28:31 +0200 From: Greg KH To: Miaohe Lin Cc: stable@vger.kernel.org, Oscar Salvador , Tony Luck , Peter Xu , David Hildenbrand , Andrew Morton Subject: Re: [PATCH 6.1.y] mm,swapops: update check in is_pfn_swap_entry for hwpoison entries Message-ID: <2024051523-transfer-buffed-7829@gregkh> References: <2024042309-rural-overlying-190b@gregkh> <20240507092822.3460106-1-linmiaohe@huawei.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240507092822.3460106-1-linmiaohe@huawei.com> On Tue, May 07, 2024 at 05:28:22PM +0800, Miaohe Lin wrote: > From: Oscar Salvador > > Tony reported that the Machine check recovery was broken in v6.9-rc1, as > he was hitting a VM_BUG_ON when injecting uncorrectable memory errors to > DRAM. > > After some more digging and debugging on his side, he realized that this > went back to v6.1, with the introduction of 'commit 0d206b5d2e0d > ("mm/swap: add swp_offset_pfn() to fetch PFN from swap entry")'. That > commit, among other things, introduced swp_offset_pfn(), replacing > hwpoison_entry_to_pfn() in its favour. > > The patch also introduced a VM_BUG_ON() check for is_pfn_swap_entry(), but > is_pfn_swap_entry() never got updated to cover hwpoison entries, which > means that we would hit the VM_BUG_ON whenever we would call > swp_offset_pfn() for such entries on environments with CONFIG_DEBUG_VM > set. Fix this by updating the check to cover hwpoison entries as well, > and update the comment while we are it. > > Link: https://lkml.kernel.org/r/20240407130537.16977-1-osalvador@suse.de > Fixes: 0d206b5d2e0d ("mm/swap: add swp_offset_pfn() to fetch PFN from swap entry") > Signed-off-by: Oscar Salvador > Reported-by: Tony Luck > Closes: https://lore.kernel.org/all/Zg8kLSl2yAlA3o5D@agluck-desk3/ > Tested-by: Tony Luck > Reviewed-by: Peter Xu > Reviewed-by: David Hildenbrand > Acked-by: Miaohe Lin > Cc: [6.1.x] > Signed-off-by: Andrew Morton > (cherry picked from commit 07a57a338adb6ec9e766d6a6790f76527f45ceb5) > Signed-off-by: Miaohe Lin > --- > include/linux/swapops.h | 105 ++++++++++++++++++++-------------------- > 1 file changed, 53 insertions(+), 52 deletions(-) Now queued up, thanks. greg k-h