Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4439477pxb; Tue, 2 Nov 2021 09:44:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy00HNn6oL5Ql4XEECR1JxaMhMtz84lMQ4ImNPF4pDRXV4qbZog6YgZ8eebwwOMYDrM1jil X-Received: by 2002:a02:b054:: with SMTP id q20mr14952571jah.21.1635871466241; Tue, 02 Nov 2021 09:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635871466; cv=none; d=google.com; s=arc-20160816; b=TDqdkwqkAEvq+8WiyueHI+TQOe6zscjijWjKGRCYlTJDY8wnJ6nlHtsE/dD/Yx5b30 fZoeVdLn96lPuTcv55JZ+rwvIk7saTQMYZL3/1iOqqSyY102wrqjuKn9wiXzFR6jak60 C4HJ7kii4w93Oc5roRNrfeV5SbSDRxgKNvzqWWkZnevX/lh1ziRi8gIhI5gRKqYf58VW NYSVrUAz4apTomtm2HPlC/FANZaotcEQLTs/iJlWL4ywpqKxv/CZPy3WtNWpQS00uHeR S+llMUpQ4SxV19hIc7oG8gPZcs+DCFW+kbAWRXXyfWZ/TkaruuAx4jcxPVnIBKNFdkWo WExA== 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=P9fLE2sZ7FZWPP/ecK148FNaLK2v6+054zpNZUAw408=; b=YYHOuHyBYFHqDaSbl7OoEAD7j97sVxK4Ysgdjywaik/N6vCdsGCfwWQ0Err6p7CpnU 86+jGyZJDc6Aal24MJ7bKzpw5CvBcMKGfTxvRZYzQGLmYQORNkIOAIOFvWB8lFsmIC3u KYLwljylb2VmcJlIVMVF/g5Mm1wqZAtgpuSH/QjbyendVXS6dG5OtvV4qH79BLv1Ws6s RNCCutTxW+Rq1kfCMEdu2tBk8/wmrWE8Xh7Yyqf6KcSQmeADPJAXyvKyi61RXOZTwO/u gFpSRyEx3YFyNByVg66bwHSqw+OqnJlwi0jh5U+2Lwgyxg7sD26+LfPVkk2e6Dm5BMr9 fLqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GIC0or1l; 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 8si19221382ilx.88.2021.11.02.09.44.10; Tue, 02 Nov 2021 09:44:26 -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=GIC0or1l; 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 S234808AbhKBQoe (ORCPT + 99 others); Tue, 2 Nov 2021 12:44:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234722AbhKBQod (ORCPT ); Tue, 2 Nov 2021 12:44:33 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEF68C061714; Tue, 2 Nov 2021 09:41:57 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id f4so20000593edx.12; Tue, 02 Nov 2021 09:41:57 -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=wBUqbHzbtAmm5gO22G6aiVHw4MHYtKCH+FgE+oYXJeK5XL6PrpWT3dryVlbiuP+8op jVQoDYDM2q8MFkFEW3nwJKDPmcvDozlgj2dgnIydvAlNsveERJO+jtDa4Az8X0FRgrDu FECJs8Y0SGbACIdaM7SJOH7/UMCfatZ4XMw4zgnXnP+teOMEBHKkQxMLs+MEbhW3Pfl4 Za7mEWwL1hj/pUJu7A5e21KdA3xxf3v/3+ASC/P9QWY641rV/lz+6S0VXdSkfzA2HsOM 3HZDlJWOIEydTjn766Oi14rpZ5qMUagx+fXMBL3VKUhCdDzyUz2jpDwYgApC49p1Tiw1 cY9A== X-Gm-Message-State: AOAM531G9NpNME0xLIoQxEvlRr6k1lPu9eiCSthOK2mw6ASZ3tYkXN9R 2grylmh5AAaHPkq7w4wXl2dOGWa+aWt3kxvd7GE= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.