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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6DF3C433F5 for ; Tue, 14 Dec 2021 15:47:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CFE76B0071; Tue, 14 Dec 2021 10:47:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 658F56B0073; Tue, 14 Dec 2021 10:47:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FA0D6B0074; Tue, 14 Dec 2021 10:47:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 3D7C96B0071 for ; Tue, 14 Dec 2021 10:47:35 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 071868120F for ; Tue, 14 Dec 2021 15:47:25 +0000 (UTC) X-FDA: 78916829250.21.CF190C6 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf01.hostedemail.com (Postfix) with ESMTP id DCEE940011 for ; Tue, 14 Dec 2021 15:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=JdGM5GreK4d7P/yIjP2xXXomBloxaPX0WunYOhiASqQ=; b=1t0q1phicf74iJb3TdVamaNu/E ALQjjbsbHzat42qdfFdXeZ8/krNQ0BKEUCaYu1OJOLwp7OA9GTUdELbLXQSQ/jJtjsl4X2RR8a+y5 scFmoWCOdmhR8c68Q8SUn2SBN6bXa6zXbV6I/PGDnHRSsTIbd0KO4A37z0jlaZfULSAgQvfJ7aRRD mpBF/gREdBnS/qwnTfSZ0qxlgIekcml5LTnuQuH78MbLXzbqkCT7D4ptACW5q7e9kTn45M7zeqX0C yJLpJeTMnvoOWHbgvH3SwhQXVgmbwBtLr1jL+LKCmigz6pNmOkkSXLDPD5VbjK+7VhO+sl4RYZPxW VDpScrgA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxA1R-00Ek1e-8E; Tue, 14 Dec 2021 15:47:21 +0000 Date: Tue, 14 Dec 2021 07:47:21 -0800 From: Christoph Hellwig To: Shiyang Ruan Cc: linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org, dan.j.williams@intel.com, david@fromorbit.com, hch@infradead.org, jane.chu@oracle.com Subject: Re: [PATCH v8 6/9] mm: Introduce mf_dax_kill_procs() for fsdax case Message-ID: References: <20211202084856.1285285-1-ruansy.fnst@fujitsu.com> <20211202084856.1285285-7-ruansy.fnst@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211202084856.1285285-7-ruansy.fnst@fujitsu.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1t0q1phi; spf=none (imf01.hostedemail.com: domain of BATV+86a4492529da8568e983+6687+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+86a4492529da8568e983+6687+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DCEE940011 X-Stat-Signature: 1wbzc8n8dnj7acyb47qt8qhrudkdy654 X-HE-Tag: 1639496840-534701 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 Thu, Dec 02, 2021 at 04:48:53PM +0800, Shiyang Ruan wrote: > @@ -254,6 +254,15 @@ static inline bool dax_mapping(struct address_space *mapping) > { > return mapping->host && IS_DAX(mapping->host); > } > +static inline unsigned long pgoff_address(pgoff_t pgoff, > + struct vm_area_struct *vma) Empty lines between functions please. Also this name is a bit generic for something in dax.h, but then again it does not seem to be DAX-specific, so it might want to move into a generic MM header with a proper name and kerneldoc comment. I think a calling conventions that puts the vma before the pgoff would seem a little more logical as well. Last but not least such a move should be in a separate patch. > +extern int mf_dax_kill_procs(struct address_space *mapping, pgoff_t index, > + unsigned long count, int mf_flags); No need for the extern here. > -static unsigned long dev_pagemap_mapping_shift(struct page *page, > +static unsigned long dev_pagemap_mapping_shift(unsigned long address, > struct vm_area_struct *vma) Passing the vma first would seem more logical again. > + if (is_zone_device_page(p)) { > + /* > + * Since page->mapping is no more used for fsdax, we should > + * calculate the address in a fsdax way. > + */ /* * Since page->mapping is not used for fsdax, we need * calculate the address based on the vma. */ > +static void collect_procs_fsdax(struct page *page, struct address_space *mapping, > + pgoff_t pgoff, struct list_head *to_kill) Overly long line here.