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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21376C11F66 for ; Tue, 29 Jun 2021 11:47:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE26F61D22 for ; Tue, 29 Jun 2021 11:47:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE26F61D22 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0CF978D0144; Tue, 29 Jun 2021 07:47:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 07F6F8D00F0; Tue, 29 Jun 2021 07:47:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E630B8D0144; Tue, 29 Jun 2021 07:47:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id BADFB8D00F0 for ; Tue, 29 Jun 2021 07:47:37 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A8C8E180CA1BA for ; Tue, 29 Jun 2021 11:47:37 +0000 (UTC) X-FDA: 78306586554.39.3717F4F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id EC9546000165 for ; Tue, 29 Jun 2021 11:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=cL/xYeDGSOOq6GehMead9WT6za7RednhXlwnl3lBZ1c=; b=UJY9KjIL7mnbS95nK+aQtN4TNO 3LOzuuk00vShr1RzEBAF5ktTgmCGYQyFg27kqspYsu9CqVD6WYt4Y8GegqWeVmu0/V7xIOb5GcHng qB3FpA68Q2a0jMBSBnQSNwtfz97XBAy/yRDwKOj0fEnzSAn47qKcGtbk+fPuUohuSJ6VUYOOKtVqh SbAW57gFaVN5MHS4IaKKoGAffGEeAP6uWHNXtDIIBYedISUPYfCWzCukQYIa30Tlbk0yiAxGAi9xI iijHpCxdJcTr4L6fU360399XSyjQ9mDx+yfh3umTWqbPBhs4MfcuTgoA8J0w0ywoXrrixc2/VZVVf Qq1DfAeg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyCCI-0043Q8-DZ; Tue, 29 Jun 2021 11:46:40 +0000 Date: Tue, 29 Jun 2021 12:46:34 +0100 From: Matthew Wilcox To: "ruansy.fnst@fujitsu.com" Cc: "linux-kernel@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "nvdimm@lists.linux.dev" , "linux-mm@kvack.org" , "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , "darrick.wong@oracle.com" , "dan.j.williams@intel.com" , "david@fromorbit.com" , "hch@lst.de" , "agk@redhat.com" , "snitzer@redhat.com" , "rgoldwyn@suse.de" Subject: Re: [PATCH v5 5/9] mm: Introduce mf_dax_kill_procs() for fsdax case Message-ID: References: <20210628000218.387833-1-ruansy.fnst@fujitsu.com> <20210628000218.387833-6-ruansy.fnst@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=UJY9KjIL; dmarc=none; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam02 X-Stat-Signature: g4d656zip5ezf9x5dkoa7fwq7hmuip49 X-Rspamd-Queue-Id: EC9546000165 X-HE-Tag: 1624967255-106782 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 Tue, Jun 29, 2021 at 07:49:24AM +0000, ruansy.fnst@fujitsu.com wrote: > > But I think this is unnecessary; why not just pass the PFN into mf_dax_kill_procs? > > Because the mf_dax_kill_procs() is called in filesystem recovery function, which is at the end of the RMAP routine. And the PFN has been translated to disk offset in pmem driver in order to do RMAP search in filesystem. So, if we have to pass it, every function in this routine needs to add an argument for this PFN. I was hoping I can avoid passing PFN through the whole stack with the help of this dax_load_pfn(). OK, I think you need to create: struct memory_failure { phys_addr_t start; phys_addr_t end; unsigned long flags; }; (a memory failure might not be an entire page, so working in pfns isn't the best approach) Then that can be passed to ->memory_failure() and then deeper to ->notify_failure(), and finally into xfs_corrupt_helper().