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 8C7E8C636CD for ; Sun, 5 Feb 2023 11:51:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F4866B0072; Sun, 5 Feb 2023 06:51:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A52C6B0073; Sun, 5 Feb 2023 06:51:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 093866B0074; Sun, 5 Feb 2023 06:51:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id EE8F86B0072 for ; Sun, 5 Feb 2023 06:51:55 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BBD68120727 for ; Sun, 5 Feb 2023 11:51:55 +0000 (UTC) X-FDA: 80433074190.01.947DF40 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id 2695DA001C for ; Sun, 5 Feb 2023 11:51:53 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=daogPHFe; 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; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675597914; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3gbpxE81nqEN5LIygYkPi/oBuXUyCIhUuArjW1ldGIE=; b=uSZsn5bFwatVOBwvMd3sAgXy3oLpiYQSFo45W068PjI5wTkbI6yMJblutjwkDIduo2froB lMbOw4FPt1vqTz77/jQrRmaomaATc/+V0FLVEYXY+Nxl1IVVCWHbd59khmhCnBHtxcVVBS xmOL5rSb3ZA+S0HnBUQAi57e1dXQaL4= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=daogPHFe; 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; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675597914; a=rsa-sha256; cv=none; b=db6sP5lQ85VQmab/0q7zP0IfUpxpLLMWb+k2MFYyi0LJVoY07oheExozLGcBuKFezgmIXh VWWn/zrLylVSoq9FAO3AxemCidtOehYRApn7sahYT4uL/WQyGmaBF06stN9apCKJzadiS6 mt/HWyEeiwwNQS3WPxM9Npfpr2dg25U= 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=3gbpxE81nqEN5LIygYkPi/oBuXUyCIhUuArjW1ldGIE=; b=daogPHFeFlcPdXUq2O0cCo4ZxN E9/Zc/FBn9Z7QxFWGf7S9lPsy9gBq+d6/l64ENYUQ0nKTmvI7e9dFG3FAWLynNMGVSy0WbS7vp0ht VjuHHf76ZCu0YMoQrG77gnAHheousfZ2xPQyEhtP7eyIL/+z9erC23t26NFow5NGFgRRM7XFt6F+u T+H384g8N3YLzesb2IGoD7teOt1dA6dP/Bh+X4WHtI8UUqgygOOrcnD5HqV0iakSGoVcIDe0H04jR mKHRuKzAs3o1MVS9WSEWAt8kAA0F/mgItMJDhv494hn+BgZTcma0RPYKSFPq6y5XShYY44BSOPWHZ 7JUZnW2A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOdYf-00FswH-FE; Sun, 05 Feb 2023 11:51:45 +0000 Date: Sun, 5 Feb 2023 11:51:45 +0000 From: Matthew Wilcox 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 v9 2/3] fs: move drop_pagecache_sb() for others to use Message-ID: References: <1675522718-88-1-git-send-email-ruansy.fnst@fujitsu.com> <1675522718-88-3-git-send-email-ruansy.fnst@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1675522718-88-3-git-send-email-ruansy.fnst@fujitsu.com> X-Stat-Signature: 3bn5a34mf5q96z1eo374no3dke31jujk X-Rspam-User: X-Rspamd-Queue-Id: 2695DA001C X-Rspamd-Server: rspam06 X-HE-Tag: 1675597913-789852 X-HE-Meta: U2FsdGVkX193JkVc1jGvBoSNf+pEtkKhyky5KqFGLPyp+4y1mdL+0/zp/2s4qpsWoGCzraSXCDEKUhrsYmsbR9Y0vevuebnkU9WHG102Q9BQmKCMYYTxftt+Ya9xUt6jYbGQXKdXZqGt9Rcb0Nk45l4eiSYsQcBuGH+LqQeSMH6rOGrWzJpFZEg1AzJC4OrOZOPt1doHqsk6Cp23ZBOcGZGAgn+65pkMeIQ/WbADvY6vyL/TrruHvt4P2ld1941Y9nhqdpK/66zZPXdnKRBTCDJSmIi37yGxFXHwqhurT+kR5Teq2Vba3Vx3/diYrF8Wh/0m2VHAIjXTbRJ+KwIN1+V1RAu3OSnBcWKNUVxEeuTw0slAEUT7brj94ib1DKQWaelPLwfT8SW0tQpoa3OIzcmn17i8WrBbjkf3PZSerGBrretAX6/H6V+3EK3S906uiTb4RG80dBdh7Qhjmm3IgLYWL4EqO+X8pTnJpHs8aT7zV2otX8pnKk2bJ5RRmiB9y/iViLfyRmYjfkEk/6GvkCUjsU4U6JnZfqnddfusdrchH3rE3zaamEnknoR/HyhmY0WL4dn/yqw9PP5MA+l1WBj6+j6HQLYfAz4PZ2jl+f7Nh39OiiL+3srg8BcGkR3P/YThPLz48z1V1Bh1SoKXO3+jRhQsXbFP/1enB7ojN03P1MlKq5r4d4N9C6RPJ4XdEh/ziZDyj/4KmdLMgGMWHhNxYImDTwMhUzI/431StpUU1LvkR+YZBcGI2HMxXd192WT0CxBY3E1SK7bZm8gvpPnZWXtZXgrdgT+OJha/BVcfuFq6gy3Ww9ymXLZtAQZyBiiFRobdHIN4gCqL7fwgP+1Bre6TP7+n4uvl5qoZKQ/2E+8YLtzJ9776XBH0bO3gOhxzx/TvVyROY67gDi/roLzsv0fWmm5yj3mi2axHI4BW0vsQ/wHe0dVJumirgQDkPNUve2JKOhy9vhhJ4EU J1o7ruX/ Kdf6YE6sNv96Xldk3UI7T9DEaiFsoQhxK8Q57yqSRC0e0CvWmM8FLReqGi/yrsbJNK0RgJFZE3esKA8B64v/v0tO2Rb1/ljLXojxGtdettozA/UtJWcvuTKUTy54gSBCGvW4rPoqCJPYNNcZcRx3Wv7IGTvUH260zX7gQQv12Q0D8nUuif41j1cZqKI+ixRh279gHUQA8W+50BuE= 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 Sat, Feb 04, 2023 at 02:58:37PM +0000, Shiyang Ruan wrote: > @@ -678,6 +679,48 @@ void drop_super_exclusive(struct super_block *sb) > } > EXPORT_SYMBOL(drop_super_exclusive); > > +/* You've gone to the trouble of writing kernel-doc, just add the extra '*' and make it actually part of the documentation! > + * super_drop_pagecache - drop all page caches of a filesystem > + * @sb: superblock to invalidate > + * @arg: invalidate method, such as invalidate_inode_pages(), > + * invalidate_inode_pages2() > + * > + * Scans the inodes of a filesystem, drop all page caches. > + */ > +++ b/include/linux/fs.h > @@ -3308,6 +3308,7 @@ extern struct super_block *get_super(struct block_device *); > extern struct super_block *get_active_super(struct block_device *bdev); > extern void drop_super(struct super_block *sb); > extern void drop_super_exclusive(struct super_block *sb); > +void super_drop_pagecache(struct super_block *sb, void *unused); But the arg isn't unused. Call it 'invalidator' here. > +/** > + * invalidate_inode_pages - Invalidate all clean, unlocked cache of one inode > + * @mapping: the address_space which holds the cache to invalidate > + * > + * This function removes all pages that are clean, unmapped and unlocked, > + * as well as shadow entries. It will not block on IO activity. > + */ > +int invalidate_inode_pages(struct address_space *mapping) > +{ > + invalidate_mapping_pages(mapping, 0, -1); > + > + return 0; > +} > +EXPORT_SYMBOL(invalidate_inode_pages); I might make this a static function in super.c but maybe you need it in the next patch.