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 A3F87C433EF for ; Mon, 1 Nov 2021 20:11:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D52961058 for ; Mon, 1 Nov 2021 20:11:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4D52961058 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id B4ECA940029; Mon, 1 Nov 2021 16:11:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFF0D94000F; Mon, 1 Nov 2021 16:11:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C646940029; Mon, 1 Nov 2021 16:11:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id 89AA594000F for ; Mon, 1 Nov 2021 16:11:47 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 44E6554A56 for ; Mon, 1 Nov 2021 20:11:47 +0000 (UTC) X-FDA: 78761457054.31.62EECBF Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf16.hostedemail.com (Postfix) with ESMTP id 05E1CF00008C for ; Mon, 1 Nov 2021 20:11:39 +0000 (UTC) Received: by mail-ed1-f44.google.com with SMTP id r12so68476055edt.6 for ; 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=ARpcCaixTdfAHZLMPnL7QZ/Km27OcGVdvbS9uiWVsnMA9jktgyy84LE8D/aMhwPhdn ojsMx2Mi+hnFzjl2sfhaNyMoYxPd0uYCD6pmAhGbRH2U6+govr+cEywT67JuQ4hC3qEX JyrLN7hc90qzkv1iHlMEVCMlnlgCMI0l2MNBPgP+S20lYX/q/7/ZKX7aZIAn42V0ddw7 KzfRhyfEvVX5i42tqlazzEGmTWPivX7oE55Vl/nzjmr2X3JYP/XbBDMO+mNhDBiStwVB xNHjbEcE388dGummNpGbp2QO0IuGX3RRU8whjxws2eKnOvvbLMG7232cpj2zcyKqrI0h HLkA== X-Gm-Message-State: AOAM533Gz4m9XIUhXI0jQDlc0yMPYTAECzsPwufBLwK6aTN/8BLuqftF XTIPlMFAaleoYKSKBsDrVvCA8boppqW+985kQK4= X-Google-Smtp-Source: ABdhPJxzEafZO0APCZgW5QUTNPh/n1I4XHakLQ9mc8d0LoGJcSYim8KSK74eWHhVtpIV0msHmDj6fm2bWHKeML6kq6E= 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" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 05E1CF00008C X-Stat-Signature: qsqt9ofibqikansscheoccssiepj75ki Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lR9c+VPH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of shy828301@gmail.com designates 209.85.208.44 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-HE-Tag: 1635797499-4498 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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