Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3407675pxb; Mon, 1 Nov 2021 13:14:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzEuGSbplLgo57sjjYpQXkudS6O4CcEAxNEGVp7S6Suk0EEDzQx2M7VDv2kXmmWJD9h77j X-Received: by 2002:a05:6e02:1b8a:: with SMTP id h10mr21862458ili.237.1635797645181; Mon, 01 Nov 2021 13:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635797645; cv=none; d=google.com; s=arc-20160816; b=VpUlmg4h9qCzSGuZG7c4JfkzbaMKN8CODY0eNKK0Z820DLNIYRJecoXYRmtmzAuqdp FYhdSF2wXDSVldgYtNEevollJWntYu1FuW5ZuDhLsMfwyAoci89v/GvtuizZ29Gduk3T FTAtEpScYdUJwftXL5TX8zOSVzyd/ZN0qA9Gt0vvwtx341Lr+JlEBMOSoldufStGjGN1 0oNjvEd+9IJEtMsLJ5O6t2QMp8OrwjhbmEH3x6DafQZIeXRTBqjMMmA+VbRMgWYnZ5wL i9U1BCE4wf/oqiRFn55JUR8UYu93JQuZgAIfwousiHYWxxRumN4llEcSLUFWCEZOfCE/ XtXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=H1dtlr2ttKRw5mcbGdwBwUoqlnFGv0srse18GSEuA/E=; b=NBG2dAdSTxUeR56LApWnIsNWMQsYKblan9vumELPpWY9I+rPBQ1ifDYeXdU1rEQvtC P3koQ9L6oMRRtCqSWjVrPTYxNowM1aLhT00T+72tB4Pd3MLhqZCAMt+7Xk1JmWSajG93 78DFGeYXRLkO1YnoxuPvgF6TyCoC+r+1EQ2bASnUI2T+TpJwu+YkHem8i4s41FA7gfry uChi4q92j7w1H93BQaH/k4AT1kfWezi1qLYV3WYtnva/dvrgpNSU3yCh36vQPEN1MC5Q VX430384JcjcPCjKHNY208VSDPyaTfYSlSBL91S7aAlwix4S0Jjznrx1pJb7HjUeS1sS WLjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lR9c+VPH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q2si15162678jat.117.2021.11.01.13.13.53; Mon, 01 Nov 2021 13:14:05 -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=@gmail.com header.s=20210112 header.b=lR9c+VPH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230246AbhKAUOV (ORCPT + 99 others); Mon, 1 Nov 2021 16:14:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbhKAUOU (ORCPT ); Mon, 1 Nov 2021 16:14:20 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD1B9C061714; Mon, 1 Nov 2021 13:11:46 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id j21so45363849edt.11; Mon, 01 Nov 2021 13:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H1dtlr2ttKRw5mcbGdwBwUoqlnFGv0srse18GSEuA/E=; b=lR9c+VPHFth7/wTuGv19MXV7Sh9KrYJqwW0Lu4dmt+zUbOJ7eXYofScd52+sKnxfzY 7CtK71KbQNvq34HbjcbVVhq1qeUAxVy2OBdXjVvnyURaomVxYHSEiWNPkjGBO3kqXmnH kbUbs+aUrydQUxo+6ZvE0xEwVfuqrZnqo36Mt1JjWlfTJeZn/SLAGiXYRsAOGlCDkITR 5xiG1Rk5ea+qSeASLBhrjplx2BDFcl0jXG+j/LmdCkW5BfDe5Ha/q4z7Bawmt7Ze/w23 qTgpH62oR/23zbked23tUsHC8ACOP1+sP4xKBd/1xERFd90/klBc64D4cA+hfM0UQ/Kc aEtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H1dtlr2ttKRw5mcbGdwBwUoqlnFGv0srse18GSEuA/E=; b=hfN1R8NHaA757rOQ1Q9VgLhrzxdu9PKFJfi6vw+THSDpw8d4saIb/mTVq46tj7FNRQ zuJNSSSSyYoMj1AqO1XE1ljnmA/0/Ig+sMcCfIID2UIr0L6EBiNleaHofU3psBMHpg3D QCyqGhM8fkfUwuHbxJ2SViwsPbn8JC+RvG+hmwB7QBfa1JyzZAhtHaL0NeCvtBIKpPt3 glWDAXY4ewTVa4SLV6J9X1POAC/4C/x5hTRb1nKlEjqsXJxy+pcTt68+IHyGc1q0FTwG P1Wbz56lii6012caaboNw7V4RRUm4jRvAK5BeMb4T7PfuimgPcFIuUoNSGIIPltWt3J7 ATBw== X-Gm-Message-State: AOAM533guo3wxfHhdHGYVbJAAi1a9m3sEWMjonwYl9MOpzVg9/M2xO7r sr9HPzTiufbUj+4oxNbeABkVeoZRnkRyTkz4MDA= X-Received: by 2002:a17:907:2953:: with SMTP id et19mr2320740ejc.311.1635797505564; Mon, 01 Nov 2021 13:11:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Yang Shi Date: Mon, 1 Nov 2021 13:11:33 -0700 Message-ID: Subject: Re: [v5 PATCH 6/6] mm: hwpoison: handle non-anonymous THP correctly To: Jue Wang Cc: Hugh Dickins , Andrew Morton , "Kirill A. Shutemov" , Linux FS-devel Mailing List , LKML , Linux MM , =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , Oscar Salvador , Peter Xu , Matthew Wilcox Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. I don't think of a better way to remediate it other than retrying from the very start off the top of my head. We can't simply check if it is still a THP or not since THP split will just move the refcount pin to the poisoned subpage so the retry path will lose the refcount for its poisoned subpage. Did you run into this problem on any real production environment? Or it is just a artificial test case? I'm wondering if the extra complexity is worth or not. > > Thanks, > -Jue