From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57336C433FE for ; Tue, 2 Nov 2021 03:51:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C06361075 for ; Tue, 2 Nov 2021 03:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232454AbhKBDyG (ORCPT ); Mon, 1 Nov 2021 23:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbhKBDyF (ORCPT ); Mon, 1 Nov 2021 23:54:05 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB1A2C061714; Mon, 1 Nov 2021 20:51:31 -0700 (PDT) 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=AB5n3/LuEh2928VCurg1CoaRmnjr3rvLQBzfgJuYk64=; b=i2B3uaOzl6E5PPWgRrD2R1JSQK boSK3XI1+/V7bOV7N3LIsuD0VoBv42Kd45inktYeYsqX7H710YuXIgV141GWah6a0ScHomeRewpiN 2wClGB8Ky50+APo0v/J0ziL29R+UgoQpPOS41KgURhjbPMjGoU1BzQlaMDMPKO7GGrZUp8fjB5YrK d+lsNIqbYtz+sLmfFyA1EM7DB2qdZ2jC8TDRm9+iD2cCsf75hc898ywJ8CDRTZOh7E5ZLHALPiSZJ +NwNpCO7r0Kj2zmMVyvCoEK/nSdzR3SJixmSy0ghCKvBzMwaD4/9PBMVvZjp7T9vE9QRrqdc/D81E LTrLljBQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhknW-004E5Z-Rh; Tue, 02 Nov 2021 03:49:43 +0000 Date: Tue, 2 Nov 2021 03:49:18 +0000 From: Matthew Wilcox To: Yang Shi Cc: Jue Wang , Hugh Dickins , Andrew Morton , "Kirill A. Shutemov" , Linux FS-devel Mailing List , LKML , Linux MM , HORIGUCHI =?utf-8?B?TkFPWUEo5aCA5Y+jIOebtOS5nyk=?= , Oscar Salvador , Peter Xu Subject: Re: [v5 PATCH 6/6] mm: hwpoison: handle non-anonymous THP correctly Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Nov 01, 2021 at 01:11:33PM -0700, Yang Shi wrote: > On Mon, Nov 1, 2021 at 12:38 PM Jue Wang wrote: > > > > A related bug but whose fix may belong to a separate series: > > > > split_huge_page fails when invoked concurrently on the same THP page. > > > > It's possible that multiple memory errors on the same THP get consumed > > by multiple threads and come down to split_huge_page path easily. > > Yeah, I think it should be a known problem since the very beginning. > The THP split requires to pin the page and does check if the refcount > is expected or not and freezes the refcount if it is expected. So if > two concurrent paths try to split the same THP, one will fail due to > the pin from the other path, but the other one will succeed. No, they can both fail, if the timing is just right, because they each have a refcount, so neither will succeed.