From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (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 9FE4B309EEB for ; Thu, 2 Jul 2026 02:29:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782959364; cv=none; b=JHYeSCFFc0PYpEkKbjCSGp1BLJr+olR8j0iMxabMyjfbrkqBVrzgY64Tuv8EbRNIl5AEF2KSmp++fi6BYIsXc3jBn4oAUGVIWjpN+QucID1eNn4lp+EJ8FV8zixF2LGnaywVERj8up/Ka/c7g7Wezqr7yOaD2EFZsa12zwyujgk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782959364; c=relaxed/simple; bh=7HjXiuzYFS9n+X2bEJw4Xr6nLDFSSQrlw0jdlhBnNcA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jnhJHmvL+++Y7Zl3yg8tg77shtKgPHHSrc0ABjgpXxDI9FdZIN7X7BPlSiVbHHBw9ovAHRuSgJ6FJWk8UIUaiofmGIlYqLtoW5BeXTk2xciTJ+h0OreVoa6PFoJWhpdxFKdv4ZcW+v4JArGSKe7w9dHwI8S/bSpGZL/0UJxSq4Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=qVP0ZeQ5; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="qVP0ZeQ5" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782959360; h=from:from: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; bh=0OkMMDdPWTy2zGtFEU7OTtAlvxBmug71HMxiUFwZgGg=; b=qVP0ZeQ5/f2IZo5e9f6pdOaGLsMUi37QP2tz76E97Bkem39pJXFrT3V4sGX3pLcvh/9tRT z41YAl7KxRliiYwF++CH2H3CBBDOpqx4PvHbbohlxq4Ohaom7lD+v6u7S9tcyAjlFEXI5z DAdgqk5XUVsr5FmHGXxXOzaKBNOmuos= Date: Thu, 2 Jul 2026 10:29:10 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] mm/huge_memory: set PG_has_hwpoisoned only after new folio head is established Content-Language: en-US To: Rik van Riel Cc: kernel-team@meta.com, "David Hildenbrand (Arm)" , linux-mm@kvack.org, akpm@linux-foundation.org, ljs@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, linux-kernel@vger.kernel.org, liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, yang@os.amperecomputing.com References: <20260701134622.3152896-1-riel@surriel.com> <9df36c6f5819f7decb188f0fcf1b199b68e238e0.camel@surriel.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lance Yang In-Reply-To: <9df36c6f5819f7decb188f0fcf1b199b68e238e0.camel@surriel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2026/7/2 01:24, Rik van Riel wrote: > On Wed, 2026-07-01 at 18:33 +0200, David Hildenbrand (Arm) wrote: >> >> There is some grammatical issue that makes me wonder whether you are >> talking >> about the present or the past. >>> > > Changelog issues fixed for v2. Thank you. > >>> Reproduced by syzkaller: hwpoison-inject a few subpages of a large >>> shmem >>> folio, then MADV_REMOVE (fallocate punch hole) on the same range, >>> which >>> splits the partial folio to a non-zero order. >> >> As Lance says, after we do the TestSetPageHWPoison() in >> memory_failure(), we >> call try_to_split_thp_page(). Does that already suffice, even without >> the >> MADV_REMOCE. > > While fa5a06170036 was created to deal with having > the folio split to >0 order, in this case it looks > like the try_to_split_thp_page() call from memory_failure() > failed, presumably because folio_ref_freeze() could not > freeze the order 7 folio, because the reproducer had > multiple threads poking at that folio simultaneously. > > This test case is rather contrived, like most syzkaller > tests, but given that the try_to_split_thp_page() call > could fail for various reasons, we do need this fallback > path. Should be rare, but yeah, there it is. Wondered if the hwpoison-time split had failed somehow ... turns out it did :) Thanks for spelling that out!