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 40E94C433F5 for ; Tue, 2 Nov 2021 16:42:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D680560E90 for ; Tue, 2 Nov 2021 16:42:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D680560E90 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 55211940009; Tue, 2 Nov 2021 12:42:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5018F940008; Tue, 2 Nov 2021 12:42:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C934940009; Tue, 2 Nov 2021 12:42:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 293D8940008 for ; Tue, 2 Nov 2021 12:42:02 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E04525C4CB for ; Tue, 2 Nov 2021 16:42:01 +0000 (UTC) X-FDA: 78764557242.10.7FFA9BB Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by imf15.hostedemail.com (Postfix) with ESMTP id 1BD8ED00009B for ; Tue, 2 Nov 2021 16:41:51 +0000 (UTC) Received: by mail-ed1-f49.google.com with SMTP id o8so6272679edc.3 for ; Tue, 02 Nov 2021 09:42:01 -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=P9fLE2sZ7FZWPP/ecK148FNaLK2v6+054zpNZUAw408=; b=GIC0or1lIv/x6KQ6dzmOaG72s2IQPXTII1ERwaYomoiFx+bptqPQe+uikUc5izujFr dpVr2v8+y3TnmrFnFMjREDsY7E0uCosKQ+rOnXHP8LoaSgGAz/daBOBE5dSeyazWLO9R HbQCOX7g6VUk7D7G6+vTPEQsTo7/aQl8spZd2TF1f5l0nEOV0eLjOR7C14DueTzMLDGF tZF/apg9alp1dilggx1wwo5VME145khVjtJLD9MljtlJNx9+bcq8yVrSrpG3jj1Ho1Cb XFFoR/pYN+xwvdg+X/WiuRmozIOuZPTc++y0ZE6zhC1YwQom7ps9DyyLmMtj4ZzClubW 2uNQ== 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=P9fLE2sZ7FZWPP/ecK148FNaLK2v6+054zpNZUAw408=; b=hhnlBDqYqUtWwUHVlepWlPiKvXfKWBI7HWawAxxXfy1G/4nex7t7vl5zMJcrprJMX/ Nz/VUAurC9VO+NqQAW2SoHoWvD85Kc/KhvhlrERBuRtqqoFyYnC75GfuWVVvvIBGSdVg FACaCbdR2XR4kQZBiYUKyhVTaloPqcemrGtWovyYdKsJyo97tzfClqVg0he5SMtebXkf 2qXQHyT7dr75/GQxsTBLDNJRj3UQ2GuQuoqe9nFlSzmKJP9Red92bXffnU2lkcz+j1pH TEAVffBmLqJv3dZwn3aZz9qCQVvxPkRz1Hws37F4Ap1rN9qmx2+iVHKwwiQalaT8/nVC VhjA== X-Gm-Message-State: AOAM531qhjIOeprQoixAMY3D0FFEUwxdwD9yjbFEuMoY3NT5olbSiW0l Ku7QXlu+uOaBpFzkmNR99aAFqL/RKYVwJb3lda8= X-Google-Smtp-Source: ABdhPJxNeZEbOBiIM49ywxwCSNfzBI/QMJoNQe6/4NSu5+j4OYAjl7q4OkVEUsDhoUS2abnWGBw07ql4nTXVWnAqi5c= X-Received: by 2002:a17:906:3f83:: with SMTP id b3mr47174068ejj.233.1635871315881; Tue, 02 Nov 2021 09:41:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Yang Shi Date: Tue, 2 Nov 2021 09:41:43 -0700 Message-ID: Subject: Re: [v5 PATCH 6/6] mm: hwpoison: handle non-anonymous THP correctly To: Matthew Wilcox Cc: Jue Wang , Hugh Dickins , Andrew Morton , "Kirill A. Shutemov" , Linux FS-devel Mailing List , LKML , Linux MM , =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , Oscar Salvador , Peter Xu Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1BD8ED00009B X-Stat-Signature: n55j3wenhto7ppycttebmsrxf1z5guum Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GIC0or1l; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of shy828301@gmail.com designates 209.85.208.49 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-HE-Tag: 1635871311-497018 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 8:50 PM Matthew Wilcox wrote: > > 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. Oh, yes, if there is race between unlock_page and put_page.