Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6164420pxb; Tue, 16 Feb 2021 18:59:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLgAdGG8CuR88XWgTksaH/XvjHSdNcQ0xqfkigDtzlxz3nxrjpvCuITRkNgfCY2M+/PC4M X-Received: by 2002:a05:6402:1cc1:: with SMTP id ds1mr24611364edb.10.1613530764748; Tue, 16 Feb 2021 18:59:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613530764; cv=none; d=google.com; s=arc-20160816; b=GLMI9QZZ1p5ZA9gW7yOL7xPzaeIH4Fqu5kFK74bZrLuZAmrU2FXpt9hVfC3nYuLGkt Wp5Z+mKjNFbefVWJ2IBEEoLzp3lyZn4dNseZMtfN4HGtZKgj5F/IXI9uHS1nl8PCWghm iPbR+cC0JyEjp58mAte2fVA/4wY4HlOXZ0HFzmGw7z+bzZdSUgoOhg0vm4bM2pYAVx+h +0FiIv/F2MzgR2uk88eAAIGTObrqWXl62FQ1iJcLLPdoF6Aa/1w0tyzLzpVrrJqyxE27 lkuXXqDBzgdso6R5oCob8S0ZU9MAqDi4sx/ILL43N255aZ5D6zQ7Q45Fo4UneNGFSCJc p4iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=5HGHDmZmJC0e2jtU9VT8UEBMSTB5VMSFBRVP/HznWfQ=; b=FjXrvnV8vMLJj5m7lXMxnlS/boCGcVxABOIbkp/SQobx3hKuE97O2RaLOsMHsgRCV6 vHVryADeEt9BEVlpqe7ir5wDMwMK7xM9M8c8+SAPgGtMWYGs1f9oCj/D3SxSz10nQHYM PCMSJMVb8OQ8T54vS/NhrLKPax2DrvSLbUAtPsR9wUfwtrwVMBF0mXUJkOBSrsRpcu7r S+/2EKZfAAlEOwrBz4LtnQn6JaejPQtVXhMkFSu7yg2E3F+sXXceDu60ec0Ujhk5flRJ +1zB24yyf5Jo7na2HhZP114PpzqNLzRoRR9thBq8Asoc3XWxPTqrL2nUMl+kK0AzLY/D LNJw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js10si546941ejc.446.2021.02.16.18.59.00; Tue, 16 Feb 2021 18:59:24 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230231AbhBQC5E (ORCPT + 99 others); Tue, 16 Feb 2021 21:57:04 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:9771 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229544AbhBQC5B (ORCPT ); Tue, 16 Feb 2021 21:57:01 -0500 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 Content-Transfer-Encoding: 8bit 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 X-Spam-Status: No Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/10 下午9:33, Christoph Hellwig wrote: >> +extern int mf_dax_mapping_kill_procs(struct address_space *mapping, pgoff_t index, int flags); > > 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 checkpatch.pl and it did not report the overly long line warning. So, I should still obey the rule of 80 chars one line? > >> @@ -120,6 +121,13 @@ static int hwpoison_filter_dev(struct page *p) >> if (PageSlab(p)) >> return -EINVAL; >> >> + if (pfn_valid(page_to_pfn(p))) { >> + if (is_device_fsdax_page(p)) >> + return 0; >> + else >> + return -EINVAL; >> + } >> + > > 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. > >> + if (is_zone_device_page(p)) { >> + if (is_device_fsdax_page(p)) >> + tk->addr = vma->vm_start + >> + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT); > > The arithmetics here scream for a common helper, I suspect there might > be other places that could use the same helper. > >> +int mf_dax_mapping_kill_procs(struct address_space *mapping, pgoff_t index, int flags) > > 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. > OK. Thanks for your guidance. -- Thanks, Ruan Shiyang. >