Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3774816pxb; Mon, 1 Nov 2021 20:54:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPuiDD5Rmz5hugp+1tmlWUlqsjNx1F6kJRSsaRtXl9ZHghF6xmLEwJpFNhBzZq5NgShl9L X-Received: by 2002:a17:906:403:: with SMTP id d3mr41503908eja.321.1635825259472; Mon, 01 Nov 2021 20:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635825259; cv=none; d=google.com; s=arc-20160816; b=aunM6mADUQ1WJAZRAZdJMGgHl9eMmnjDuF1I8hlIOGZrP229d8VRS4hNDFICfuMyFQ G2cx/9+Ud+m2kWNeViTWUEsIxqb8W/Rk/kqbNij3un5RGXaufC4e0w+Ew4Q7oUd0JSZH GtijIFcUsqAXpBHHEIIdc67EBdYFeQI85ThvIGa/NqdZMSaQIDE4OVGnS/B4LNrB1VSQ /PSSGdGnoWi5hyvWcH2CYJP4UlPwTLVSprONXp4N92lYsCbGhRjrX/w55wgoImqbhdz5 ACRy26oP/oBXw1wtAV1BLpfLSIjCbEm2q2fGOdlDD1HkC4zK3ZiFiFSHYDXXdZ9Dr3L7 ne/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AB5n3/LuEh2928VCurg1CoaRmnjr3rvLQBzfgJuYk64=; b=ICgy4uo7LXWJJvDo+CovkLl5Xlchj9udYFxixibh3Ry1jt7LwsiRHDxI6XbEjTgRzX 63k9h7hrjnJ3x7okF6mc9dm1vAWFbMJoMEgNMBHKL1aMwCa6lWJsICJkp4Rb95RQA6oP 2hwIlEJ3afld2Jt+iOYgSDa1wsF1AWuQwtSxryPvbLNjpuMI49xxJv2SpTZzWAPcpQn3 Gwlf0S5280EGfyCtlWBAeg2KIGaHxm2gOO+QyFff19Q7EH0lqkKzrsfEkcfnpnCnpizB YKtQLlGSl5DvgPf3lvAjrinc4jRn4m0lhqO3iZEfccg5EU96CFDnFC453clvt1UzQic9 Jflw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=i2B3uaOz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si22316121edv.227.2021.11.01.20.53.53; Mon, 01 Nov 2021 20:54:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=i2B3uaOz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232720AbhKBDyG (ORCPT + 99 others); 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-kernel@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.