Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp204586lfu; Wed, 30 Mar 2022 20:52:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcdbnQ1ad90p1lQeOZSbTjJS/CDoo+6AqnReM9932d7hz3vZZXvyyri5e52vBlbMlS2dk6 X-Received: by 2002:a17:903:40c4:b0:154:a24b:d1e7 with SMTP id t4-20020a17090340c400b00154a24bd1e7mr3312573pld.27.1648698729358; Wed, 30 Mar 2022 20:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648698729; cv=none; d=google.com; s=arc-20160816; b=RhPYAQBEY/4f68E9TkmUc3+LfEkTaLXggfeDy2hEpjprPTOYcfemnClNQxvfvtiVKS AI40iT7avUjRa/lMqFhnjXLOwoqTIq7w+mQowpVvUS0OzSCuZaiMUa+cvn+VxzpHOwyw WYnpKPkUrh7/H6c29ygQrSa4IGXJ1kxBOcAbONY4KBKfrdRQpei90wY34S0PUZJL1yTn 14sPHhw2AGm92hLxNS3e/XgZfdFDbkOCX3Us5/VUNpfxPRxllTm4PLKKhJwTTuQVFLz8 VU4sSQ9SSZOHuQQPaHsO7ghLkNzRBGx1Cvu5vsAb6DTRuBepD+20MPOtBATB8EHP8WkR 4W2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yCZ5d17EFD2aEB3EGnA7ZMwaYGzMjCaqvwamMb8/d/A=; b=dojGwlbOggiVOet4DQ0nJP52tkIgXACsflnUHKUiO71HiGKlXVZKEf3h1vNW40sHno IabZnPZbVmcDzqtkIRFwUoMW0OOaBw+nbatet25QRWu0d6FUIXBd3FcQfuowfJj1PT+t 9lwUGz+7mQ2SI8T658yy/UVwl5JPzU45J4NPCwZBMNeGYUbIEBuq+9lEqWHeB0wrFIBM HjqKiUhHQOM9V8Sf4FhnC5aSovmZjCeb8MBAnbbR2R9qhgIs5n14MFN0z+0xTF8pc6qt 9squ1tP+rqDznBgktAHovOhu89bdNz8/tlYYHswqBg3d7S2YQoYru3ADZC5iqatiGmuu 9Qqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=FATsTjus; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b23-20020a17090aa59700b001c9cffe92basi2031335pjq.44.2022.03.30.20.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 20:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=FATsTjus; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 50CB2FD6F7; Wed, 30 Mar 2022 20:05:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243066AbiC3Fx1 (ORCPT + 99 others); Wed, 30 Mar 2022 01:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237762AbiC3FxY (ORCPT ); Wed, 30 Mar 2022 01:53:24 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEEE2193D3; Tue, 29 Mar 2022 22:51:39 -0700 (PDT) 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=yCZ5d17EFD2aEB3EGnA7ZMwaYGzMjCaqvwamMb8/d/A=; b=FATsTjusksvtlMN1pOJstU1ijI IMnbWlp05UKcwa3gWEEqTw6N8GcV5QSf6C1y/3IqRg5rAxSuHtGDN19cfAmfLDTqTHXhVqoa51SPr p1X8tLumGNCsMQaxn9Mz5I3Akb7d4fs8GLRIrTjiUWcYH6FQTO4kK+0LMJuxRQj63nI/fJB8uR3hN z/j4J39qan+FX7gHBjxu6JEBpIbAzspjMkOE9bFCMTYA9Xl8fnJrkGdNbWYw2IFRd5EUbDItvuZhK 0jbOcmIegmH+WknmWMSTnY4jhygaaKjh65GyKkfllEuIZPk6hetptPV+FmBF21A/G91xtA0uQAblX f6EVCdYQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZRF4-00ENLP-Ne; Wed, 30 Mar 2022 05:51:38 +0000 Date: Tue, 29 Mar 2022 22:51:38 -0700 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 v11 6/8] mm: Introduce mf_dax_kill_procs() for fsdax case Message-ID: References: <20220227120747.711169-1-ruansy.fnst@fujitsu.com> <20220227120747.711169-7-ruansy.fnst@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220227120747.711169-7-ruansy.fnst@fujitsu.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 27, 2022 at 08:07:45PM +0800, Shiyang Ruan wrote: > This function is called at the end of RMAP routine, i.e. filesystem > recovery function, to collect and kill processes using a shared page of > DAX file. I think just throwing RMAP inhere is rather confusing. > The difference with mf_generic_kill_procs() is, it accepts > file's (mapping,offset) instead of struct page because different files' > mappings and offsets may share the same page in fsdax mode. > It will be called when filesystem's RMAP results are found. So maybe I'd word the whole log as something like: This new function is a variant of mf_generic_kill_procs that accepts a file, offset pair instead o a struct to support multiple files sharing a DAX mapping. It is intended to be called by the file systems as part of the memory_failure handler after the file system performed a reverse mapping from the storage address to the file and file offset. Otherwise looks good: Reviewed-by: Christoph Hellwig > index 9b1d56c5c224..0420189e4788 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -3195,6 +3195,10 @@ enum mf_flags { > MF_SOFT_OFFLINE = 1 << 3, > MF_UNPOISON = 1 << 4, > }; > +#if IS_ENABLED(CONFIG_FS_DAX) > +int mf_dax_kill_procs(struct address_space *mapping, pgoff_t index, > + unsigned long count, int mf_flags); > +#endif /* CONFIG_FS_DAX */ No need for the ifdef here, having the stable declaration around is just fine. > +#if IS_ENABLED(CONFIG_FS_DAX) No need for the IS_ENABLED as CONFIG_FS_DAX can't be modular. A good old #ifdef will do it. Otherwise looks good: Reviewed-by: Christoph Hellwig