Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1629703pxb; Fri, 20 Aug 2021 09:59:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwby5j09+XFP3l6JvYUOJ5a/LMW3ZFK8nhWAu7C3FgTtgFE1clLbhnV0f/qajvScK2YntjN X-Received: by 2002:aa7:d951:: with SMTP id l17mr23106632eds.92.1629478749660; Fri, 20 Aug 2021 09:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629478749; cv=none; d=google.com; s=arc-20160816; b=jnbEwXREvhk8r8uoUzddasTOSLpC2B3GMhjWNQQa95ksuglIyRbEU7qykrgHuTKsne ap8cwaJOWLZMpywl6MKLLd1A97Uh471jwXG92lbWBk8zofDClpLWDiOvRXVUSMVsVFfD B1D3HOKaBx8HLMdP6LQzhuQovkWrtvZAF+bgOB6ayISTjqkTtwDcCdmnfnG7JAiSEny2 QMW02Xk0TdyyPW3UYLhv+Fyoox+3nQYmjZ1h+7CMMjMNHvSdBnSGGUeoShZGdM8BVI3j qoQmMvkCWdViRPUrI3ZSGTG1Y0HvkcMA6yCXvmXPTNBq9YI+6jg0u949XuBxlQr+6vW9 Etmw== 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=x/jv/65/o/pr3Arrh3DCsUW+kuq3VQXikqXf2iTWhR0=; b=pR3JjfhEAdj3jZCBn8eW1pPqxVylq0t64PyZFfcd0YKbHr3dNtxfFL9ax9tQVxwdRV J1Hf6++mIzjndaSML5iCjYpdPbxh6/znMahvtnCD9vzB7z3x0jdbo6lRHTtrq22G7gSE SjZwsLO0CWTSingZq/1lWBxN9HqMBaWVk8tB5yWtfS/QMCa3Qnhfy3yKH41QVR8fcWHD mVW5TH7Z3A8PXvYnpNztDFez7PBV6SvaZXfQNsnRIz5YHESQH/W497gN2mfhKQPN0X43 4Ky7aY1/eN+LPtKNJ+ILoS5n1G2+94w3wWcbQOcBDZ4x4jP+NuK3yTXsVC8e2EVS8a4f T34g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=wmKOKlHK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si8973450ejo.390.2021.08.20.09.58.43; Fri, 20 Aug 2021 09:59:09 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=wmKOKlHK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232598AbhHTQy4 (ORCPT + 99 others); Fri, 20 Aug 2021 12:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbhHTQyz (ORCPT ); Fri, 20 Aug 2021 12:54:55 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03900C061757 for ; Fri, 20 Aug 2021 09:54:18 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id y23so9746421pgi.7 for ; Fri, 20 Aug 2021 09:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x/jv/65/o/pr3Arrh3DCsUW+kuq3VQXikqXf2iTWhR0=; b=wmKOKlHKACOKqcXgGfzOyuS+T8nTPa0UTHRKzXqyEB7n1oMhL9ybIy4re4kL145HF1 bMtrau52pfw/I1Kc5cdxzuDtd0Et/jJkS5US+hv/mTQyQM7TcCklar0bSyyEBZaFQivs wSYZ7huQEIGoNty7O9v1HlhEnIt+psE5sGUDc9it5+LPZ7q/ulbelZHxwf3w1Cir636k IGP2ByU9d0ypCXvfCnbVJxTWgVNrKwxvWAw8s1imwihI5Uzzw1LN35likbg8w9wlGZNJ vEpJZYYjxE1je5/O/8C/dWmlALP8frPW0a+yHWctwSdYLH99P7ISs6wJ2ZSV9hwtj/V7 R6+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x/jv/65/o/pr3Arrh3DCsUW+kuq3VQXikqXf2iTWhR0=; b=LKqxHBZrGMprsR+v/8+zDW/OuHLSvprUZaPhB4QcsAs5MOT2cwx9ec1XtkM5GAE/ab fnqRUUu4pFwIX5hkGiS6QLAG++uNX8r+VsT58l8UxNwMTL0rWbROzCp9aHJeGF4zFLBZ VLTyrZMNRIi+u/1WDaTWwtF88j98rpf1iuegkN4fxQUCDc+kCCOWHF+BzPzn4Azue0ZH pROUjLxMaVQaXbXmiCvl8T0D9S5Xua2AbFLmgjjwATaQu6Tfp6sUyhwWV/gdSvK7uuDk eLnBikYZhjwXP2mAdqMoDuFuDTOa7E2l7FKlyi4+EOwX6tSqkG+RoepH8aM2K6RyYqhW l+SQ== X-Gm-Message-State: AOAM53224dSq+C0RY1eSK1swmE61uU/KQ6TV7HvL8cFs9BL/ou1SKRmN r7PCaZH5nRl/io2aIpdml/TVQ16ItREyU3uJjUVkpA== X-Received: by 2002:a65:6642:: with SMTP id z2mr7510515pgv.240.1629478457626; Fri, 20 Aug 2021 09:54:17 -0700 (PDT) MIME-Version: 1.0 References: <20210730100158.3117319-1-ruansy.fnst@fujitsu.com> <20210730100158.3117319-4-ruansy.fnst@fujitsu.com> In-Reply-To: From: Dan Williams Date: Fri, 20 Aug 2021 09:54:06 -0700 Message-ID: Subject: Re: [PATCH RESEND v6 3/9] mm: factor helpers for memory_failure_dev_pagemap To: Jane Chu Cc: Shiyang Ruan , Linux Kernel Mailing List , linux-xfs , Linux NVDIMM , Linux MM , linux-fsdevel , device-mapper development , "Darrick J. Wong" , david , Christoph Hellwig , Alasdair Kergon , Mike Snitzer Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 5, 2021 at 6:01 PM Jane Chu wrote: > > > On 7/30/2021 3:01 AM, Shiyang Ruan wrote: > > - /* > > - * Prevent the inode from being freed while we are interrogating > > - * the address_space, typically this would be handled by > > - * lock_page(), but dax pages do not use the page lock. This > > - * also prevents changes to the mapping of this pfn until > > - * poison signaling is complete. > > - */ > > - cookie = dax_lock_page(page); > > - if (!cookie) > > - goto out; > > - > > if (hwpoison_filter(page)) { > > rc = 0; > > - goto unlock; > > + goto out; > > } > > why isn't dax_lock_page() needed for hwpoison_filter() check? Good catch. hwpoison_filter() is indeed consulting page->mapping->host which needs to be synchronized against inode lifetime.