From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by kanga.kvack.org (Postfix) with ESMTP id E3D466B0038 for ; Thu, 19 Mar 2015 09:56:01 -0400 (EDT) Received: by wgbcc7 with SMTP id cc7so63074536wgb.0 for ; Thu, 19 Mar 2015 06:56:01 -0700 (PDT) Received: from mx2.suse.de (cantor2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id p3si2269287wjz.207.2015.03.19.06.55.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Mar 2015 06:55:59 -0700 (PDT) Date: Thu, 19 Mar 2015 14:55:58 +0100 From: Michal Hocko Subject: Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read Message-ID: <20150319135558.GD12466@dhcp22.suse.cz> References: <1426687766-518-1-git-send-email-mhocko@suse.cz> <20150318154540.GN17241@dhcp22.suse.cz> <20150319083835.2115ba11@notabene.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150319083835.2115ba11@notabene.brown> Sender: owner-linux-mm@kvack.org List-ID: To: NeilBrown Cc: Andrew Morton , Al Viro , Johannes Weiner , Mel Gorman , Rik van Riel , Tetsuo Handa , Sage Weil , Mark Fasheh , linux-mm@kvack.org, LKML On Thu 19-03-15 08:38:35, Neil Brown wrote: [...] > Nearly half the places in the kernel which call mapping_gfp_mask() remove the > __GFP_FS bit. > > That suggests to me that it might make sense to have > mapping_gfp_mask_fs() > and > mapping_gfp_mask_nofs() > > and let the presence of __GFP_FS (and __GFP_IO) be determined by the > call-site rather than the filesystem. Sounds reasonable to me but filesystems tend to use this in a very different ways. - xfs drops GFP_FS in xfs_setup_inode so all page cache allocations are NOFS. - reiserfs drops GFP_FS only before calling read_mapping_page in reiserfs_get_page and never restores the original mask. - btrfs doesn't seem to rely on mapping_gfp_mask for anything other than btree_inode (unless it gets inherrited in a way I haven't noticed). - ext* doesn't seem to rely on the mapping gfp mask at all. So it is not clear to me how we should change that into callsites. But I guess we can change at least the page fault path like the following. I like it much more than the previous way which is too hackish. ---