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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,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 A60FEC433E2 for ; Thu, 21 May 2020 21:55:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5EC08207D3 for ; Thu, 21 May 2020 21:55:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5EC08207D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fromorbit.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E8A9880008; Thu, 21 May 2020 17:55:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3B8380007; Thu, 21 May 2020 17:55:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D514580008; Thu, 21 May 2020 17:55:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id B910F80007 for ; Thu, 21 May 2020 17:55:30 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 754DE181AEF23 for ; Thu, 21 May 2020 21:55:30 +0000 (UTC) X-FDA: 76842083220.10.tiger65_12ea4d0f38725 X-HE-Tag: tiger65_12ea4d0f38725 X-Filterd-Recvd-Size: 3362 Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 May 2020 21:55:29 +0000 (UTC) Received: from dread.disaster.area (pa49-195-157-175.pa.nsw.optusnet.com.au [49.195.157.175]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 9F4AD1A7F66; Fri, 22 May 2020 07:55:27 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1jbt9v-0000Si-Bl; Fri, 22 May 2020 07:55:23 +1000 Date: Fri, 22 May 2020 07:55:23 +1000 From: Dave Chinner To: Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 07/36] fs: Add a filesystem flag for large pages Message-ID: <20200521215523.GR2005@dread.disaster.area> References: <20200515131656.12890-1-willy@infradead.org> <20200515131656.12890-8-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200515131656.12890-8-willy@infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=W5xGqiek c=1 sm=1 tr=0 a=ONQRW0k9raierNYdzxQi9Q==:117 a=ONQRW0k9raierNYdzxQi9Q==:17 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=JfrnYn6hAAAA:8 a=7-415B0cAAAA:8 a=khlJBHKmE670Q-po3lMA:9 a=70w1-rSo-Nt5nqzG:21 a=UBtUr0dm7oXX99_u:21 a=CjuIK1q_8ugA:10 a=1CNFftbPRP8L7MoqJWF3:22 a=biEYGPWJfzWAr4FL6Ov7:22 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 Fri, May 15, 2020 at 06:16:27AM -0700, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > The page cache needs to know whether the filesystem supports pages > > PAGE_SIZE. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > include/linux/fs.h | 1 + > include/linux/pagemap.h | 5 +++++ > 2 files changed, 6 insertions(+) > > diff --git a/include/linux/fs.h b/include/linux/fs.h > index 55c743925c40..777783c8760b 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -2241,6 +2241,7 @@ struct file_system_type { > #define FS_HAS_SUBTYPE 4 > #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */ > #define FS_DISALLOW_NOTIFY_PERM 16 /* Disable fanotify permission events */ > +#define FS_LARGE_PAGES 8192 /* Remove once all fs converted */ > #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ > int (*init_fs_context)(struct fs_context *); > const struct fs_parameter_spec *parameters; > diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h > index 36bfc9d855bb..c6db74b5e62f 100644 > --- a/include/linux/pagemap.h > +++ b/include/linux/pagemap.h > @@ -116,6 +116,11 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) > m->gfp_mask = mask; > } > > +static inline bool mapping_large_pages(struct address_space *mapping) > +{ > + return mapping->host->i_sb->s_type->fs_flags & FS_LARGE_PAGES; > +} If you've got to dereference 4 layers deep to check a behaviour flag, the object needs it's own flag. Can you just propagate this to the address space when the inode is instantiated and the address space initialised? Cheers, Dave. -- Dave Chinner david@fromorbit.com