From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 C01FE408612 for ; Thu, 13 Aug 2026 10:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786616390; cv=none; b=VAf0Yx80T9dWgb0/qtql/1NjQohEkCpMtbyi5VFZWAFC42MkZFyp0hUatkmNX6R1ecelhdueJtxJ7t3Ho7R+xIeuh5libjZ41rsUgmUAkfMQcG/HHjVcuIDcDqWcwpBhOGaj7H0rVIkTea5OviA5swOLv9prdmGdTHXT2BEjrWk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786616390; c=relaxed/simple; bh=ZRn4/vwZGdvFMZgZun4aj9R5yRRJcQHaBYwwfevNeD4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jDiepiNy27AkGoUfisJd+TUI00P8r5Cwo7ZFkk7ODL0fMCRLpV94TyD4el/DUV8wA/gWmgPT2hgrrQ8oX5l3qHsUs7SA08ElzRz3SpURapRNzJmx1mrrhgEeR215KpV6Xip1t1n9sdYgleppGkJo7xvPHfISn5YphylqGi8RfEA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=wWHO0cgq; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="wWHO0cgq" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qdAeuLqcTg0r3BctkPvFE7yUe+SHFHuPonXE6/RBmLw=; b=wWHO0cgqWKxsqqTEf9XD1q7ptH W0ilpGHM5+3y5MzIcVSHDLVUdi1zLN+UQFT2Q1tvKSwGvP7dSYtkYRPkH8NmAwMSx39duVmwpLU5M 3mo6PEPYeY2Jb1MrizS3YAgerjBQR6o/4TL+7k/Ne1OnEYQHyTFGaCDGklBCRkGG3ZNtVKDjWJfLd NU0lPT3m+/kKNQrnqpkd4ic0S77aCV2KRW9nNCV8Ksf1HUxfAl73S2CzvmFZprw8Sx0lVUeR6A+1T IgUifsVYwD0HO1zBMe/H4zuY353uS3RmrG/SVjDWYfKTXUoSHvma015fSllLmIn6/TQ3dDu31RF+F mE5zfNjA==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wuSX4-0052dW-3D; Thu, 13 Aug 2026 10:19:31 +0000 Date: Thu, 13 Aug 2026 03:19:26 -0700 From: Breno Leitao To: Miaohe Lin Cc: SJ Park , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, kernel-team@meta.com, Andrew Morton , Naoya Horiguchi , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , david@kernel.org Subject: Re: [PATCH v2] tools/mm: add hwpoison-panic tool Message-ID: References: <20260803-memory_failure_rewrite_test-v2-1-ed020ce42129@debian.org> 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: X-Debian-User: leitao Hello Miaohe, First of all, thanks for looking at this one. On Thu, Aug 13, 2026 at 03:32:34PM +0800, Miaohe Lin wrote: > On 2026/8/3 19:31, Breno Leitao wrote: > > +static int pick_kpageflags_phys_addr(uint64_t want, uint64_t *phys_addr) > > +{ > > + uint64_t pfn = (16UL << 20) / page_size; > > Could we use SZ_16M macro here? Sure, for that I will include ../../include/linux/sizes.h in the next version. > > +/* hard_offline_page() injects with MF_SW_SIMULATED, so unpoison is allowed. */ > > +static void unpoison_pfn(uint64_t pfn) > > +{ > > + char path[PATH_MAX], buf[32]; > > + const char *debugfs; > > + int fd, len; > > + > > + debugfs = debugfs__mount(); > > I might be miss something but I can't find the implementation of debugfs__mount. It is an ugly macro declared in tools/lib/api/fs/fs.h: #define FS(name) \ const char *name##__mountpoint(void); \ const char *name##__mount(void); \ bool name##__configured(void); And then: FS(debugfs) > > + if (access(INJECT_PATH, W_OK)) > > + fatal("%s not present (no MEMORY_HOTPLUG?)\n", INJECT_PATH); > > MEMORY_HOTPLUG? lol. it should be MEMORY_FAILURE I will get these points fixed and respin. --breno