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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 835F7C433E0 for ; Wed, 17 Feb 2021 02:56:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 05D2B64DCF for ; Wed, 17 Feb 2021 02:56:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05D2B64DCF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3BC988D001A; Tue, 16 Feb 2021 21:56:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36DDF8D0019; Tue, 16 Feb 2021 21:56:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 284C18D001A; Tue, 16 Feb 2021 21:56:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 101E38D0019 for ; Tue, 16 Feb 2021 21:56:19 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C53271802393A for ; Wed, 17 Feb 2021 02:56:18 +0000 (UTC) X-FDA: 77826246036.07.air90_130334427649 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id A997E1803F9AD for ; Wed, 17 Feb 2021 02:56:18 +0000 (UTC) X-HE-Tag: air90_130334427649 X-Filterd-Recvd-Size: 3785 Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Wed, 17 Feb 2021 02:56:17 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.81,184,1610380800"; d="scan'208";a="104561557" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 17 Feb 2021 10:56:13 +0800 Received: from G08CNEXMBPEKD05.g08.fujitsu.local (unknown [10.167.33.204]) by cn.fujitsu.com (Postfix) with ESMTP id 374484CE72EC; Wed, 17 Feb 2021 10:56:13 +0800 (CST) Received: from irides.mr (10.167.225.141) by G08CNEXMBPEKD05.g08.fujitsu.local (10.167.33.204) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 17 Feb 2021 10:56:11 +0800 Subject: Re: [PATCH v3 05/11] mm, fsdax: Refactor memory-failure handler for dax mapping To: Christoph Hellwig CC: , , , , , , , , , , , , , References: <20210208105530.3072869-1-ruansy.fnst@cn.fujitsu.com> <20210208105530.3072869-6-ruansy.fnst@cn.fujitsu.com> <20210210133347.GD30109@lst.de> From: Ruan Shiyang Message-ID: <45a20d88-63ee-d678-ad86-6ccd8cdf7453@cn.fujitsu.com> Date: Wed, 17 Feb 2021 10:56:11 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210210133347.GD30109@lst.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US X-Originating-IP: [10.167.225.141] X-ClientProxiedBy: G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.200) To G08CNEXMBPEKD05.g08.fujitsu.local (10.167.33.204) X-yoursite-MailScanner-ID: 374484CE72EC.AB75D X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@cn.fujitsu.com Content-Transfer-Encoding: quoted-printable 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 2021/2/10 =E4=B8=8B=E5=8D=889:33, Christoph Hellwig wrote: >> +extern int mf_dax_mapping_kill_procs(struct address_space *mapping, p= goff_t index, int flags); >=20 > No nee for the extern, please avoid the overly long line. OK. I'd like to confirm one thing... I have checked all of this patchset by=20 checkpatch.pl and it did not report the overly long line warning. So, I=20 should still obey the rule of 80 chars one line? >=20 >> @@ -120,6 +121,13 @@ static int hwpoison_filter_dev(struct page *p) >> if (PageSlab(p)) >> return -EINVAL; >> =20 >> + if (pfn_valid(page_to_pfn(p))) { >> + if (is_device_fsdax_page(p)) >> + return 0; >> + else >> + return -EINVAL; >> + } >> + >=20 > This looks odd. For one there is no need for an else after a return. > But more importantly page_mapping() as called below pretty much assumes > a valid PFN, so something is fishy in this function. Yes, a mistake here. I'll fix it. >=20 >> + if (is_zone_device_page(p)) { >> + if (is_device_fsdax_page(p)) >> + tk->addr =3D vma->vm_start + >> + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT); >=20 > The arithmetics here scream for a common helper, I suspect there might > be other places that could use the same helper. >=20 >> +int mf_dax_mapping_kill_procs(struct address_space *mapping, pgoff_t = index, int flags) >=20 > Overly long line. Also the naming scheme with the mf_ seems rather > unusual. Maybe dax_kill_mapping_procs? Also please add a kerneldoc > comment describing the function given that it exported. >=20 OK. Thanks for your guidance. -- Thanks, Ruan Shiyang. >=20