Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1819052rdd; Thu, 11 Jan 2024 10:04:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGt5uBCChN65FGS722o3A/3fgNATJuTdwHRruxcbPPPrH8x7LJaip2M9eetpEoqr8vCCVrN X-Received: by 2002:a17:906:600c:b0:a2c:8e99:5a6a with SMTP id o12-20020a170906600c00b00a2c8e995a6amr18156ejj.212.1704996278150; Thu, 11 Jan 2024 10:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704996278; cv=none; d=google.com; s=arc-20160816; b=eejsAo8gxKxA4sqbaJFgrAwL7aseGous07wkZHHffEkFq303yDFqg08otJXy2k8QQm bhqTobrlkToGStecq+5euVEOmO0pxnoedyn4Is6peZwST/j3+a+ybVsCHqHlC7SKKL0C bNMDTqsocoMzYsV63pHMYFpsWurWD3ENMo1qtMlevmHSbKYdUeOVQR+paemBO51oBJbY hh+17jFLFY+mqoJWd+8qZzh/zB03vgcuCCnZxZnkbO5aPhEfuDJABi1M1ohbAenvZgbH sSe+pQZCjdlLoYY82Uo0wDJ6pU1cZDok4Rn8wCHKEqbulF7glcn3Tp/SapElAaECTcP7 WlZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VqEajgKYUCRG8Rpm6+M9Aezz8/e9dXscDdOmwHGM7AM=; fh=3TnE/gUM9GUqhEM4nileeqDaSeF+jgKE00iRf+dnO48=; b=Es5umK6HWfQAy6jo7pXB9OYy5XpFFrJo5go8HY4Li+UcHoyIBpttlNoh5X1JdWJr8A lzgVxOIzpq/GKQiuBwc/G2rlBnqF4OW1VHK82u20hftT8JaOkVXsAhFTbn9mC/pac0Fx c0aF9C1MVP9P3+rjopTAtCjh+239Dj+vks7dWbwm8ZpvBlg6GUmF4rGs5PtvvFtoZ7uw IwPxYBihwhPYkrHmrl1RXj0DmM/+71aagPZ+P2W4W4cyxfEW6NxDFNPbiAQY+SmQontO CgjD6d1kyAgGYOo1vhIplf5zvls9QuUIE0EoFZ+BpvnOBO6clxp6uC6zSh8geCIR30co udLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tkDWBWFF; spf=pass (google.com: domain of linux-kernel+bounces-23956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23956-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o11-20020a170906774b00b00a2b07d9119esi674050ejn.286.2024.01.11.10.04.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 10:04:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tkDWBWFF; spf=pass (google.com: domain of linux-kernel+bounces-23956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23956-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 am.mirrors.kernel.org (Postfix) with ESMTPS id CCFE31F256A1 for ; Thu, 11 Jan 2024 18:04:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEE9F537E6; Thu, 11 Jan 2024 18:04:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="tkDWBWFF" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 8C8753A1BE for ; Thu, 11 Jan 2024 18:04:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VqEajgKYUCRG8Rpm6+M9Aezz8/e9dXscDdOmwHGM7AM=; b=tkDWBWFFGAttTj4drcch5XyXvQ /vAw9ozrGxZ1GlZ1XZN99Bh4Tlv08VGBISNUZib+O8GUd765lTT7ndy82gdokPwyBZzhxFSCVXSzM ipYEsMKh1AuZZ7nZu8vkzCYYCaBWGsT10BubbNozvKPGrgDrNK8IWlj0o1HxzQ0WG2BN/iz37F9Rw rAIHbvpn47GKDdQXrbbaWso73/ZrWla9A3ZpjQI2H15g3aUxkCgRYIpi3Mkg9Q+rLwbfdjTU2OwyF S0bH+jt0e3k9XcD985AMjhHCU2KLpucYcl+QNPpPKumOGYpdihRnav3Xjx+tUTMW6HRfPgRku+X+7 SEqHVhYw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rNzPJ-00EVS2-CT; Thu, 11 Jan 2024 18:03:57 +0000 Date: Thu, 11 Jan 2024 18:03:57 +0000 From: Matthew Wilcox To: Sidhartha Kumar Cc: Jiaqi Yan , Muhammad Usama Anjum , linmiaohe@huawei.com, mike.kravetz@oracle.com, naoya.horiguchi@nec.com, akpm@linux-foundation.org, songmuchun@bytedance.com, shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jthoughton@google.com, "kernel@collabora.com" Subject: Re: [PATCH v4 4/4] selftests/mm: add tests for HWPOISON hugetlbfs read Message-ID: References: <20230713001833.3778937-1-jiaqiyan@google.com> <20230713001833.3778937-5-jiaqiyan@google.com> <079335ab-190f-41f7-b832-6ffe7528fd8b@collabora.com> <6bacbd7c-88cb-1399-8bd0-db98c93a1adf@oracle.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <6bacbd7c-88cb-1399-8bd0-db98c93a1adf@oracle.com> On Thu, Jan 11, 2024 at 09:51:47AM -0800, Sidhartha Kumar wrote: > On 1/11/24 9:34 AM, Jiaqi Yan wrote: > > > - if (!folio_test_has_hwpoisoned(folio)) > > > + if (!folio_test_hwpoison(folio)) > > > > Sidhartha, just curious why this change is needed? Does > > PageHasHWPoisoned change after commit > > "a08c7193e4f18dc8508f2d07d0de2c5b94cb39a3"? > > No its not an issue PageHasHWPoisoned(), the original code is testing for > the wrong flag and I realized that has_hwpoison and hwpoison are two > different flags. The memory-failure code calls folio_test_set_hwpoison() to > set the hwpoison flag and does not set the has_hwpoison flag. When > debugging, I realized this if statement was never true despite the code > hitting folio_test_set_hwpoison(). Now we are testing the correct flag. > > From page-flags.h > > #ifdef CONFIG_MEMORY_FAILURE > PG_hwpoison, /* hardware poisoned page. Don't touch */ > #endif > > folio_test_hwpoison() checks this flag ^^^ > > /* At least one page in this folio has the hwpoison flag set */ > PG_has_hwpoisoned = PG_error, > > while folio_test_has_hwpoisoned() checks this flag ^^^ So what you're saying is that hugetlb behaves differently from THP with how memory-failure sets the flags?