Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3365627ybg; Sat, 6 Jun 2020 20:13:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxunlZOu4mfUbTd2RqimpPHHvSzNVG/uwcoz++oj0I2IXNTC6sP4yqztgE6ANI67ipjD6zh X-Received: by 2002:a17:906:71b:: with SMTP id y27mr8443342ejb.537.1591499619210; Sat, 06 Jun 2020 20:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591499619; cv=none; d=google.com; s=arc-20160816; b=V1y+tSmcsGfyp9Lbo7+4NK7a3H8LzoUQjt9IGWs0gTCemUbfYGGPsjXcV24PlnP/P5 kYFwt6USYBAYGcFtxfCLBJKpRuyLLxyJJw1rIl+SFXUPbT0vZ1iSEgGqqJvlvs6w/Ebt 0HlEsu/FwfRWcyLZm5nPz8DiCwMC6TRjxyXIYNpQ9QNJ8b2SkLT8TNnDNoH/ldMqN/U6 LbEsLwc0oUneHW5IQJRUtePIT2qcTDgYoWqGmCL2qYoxgAJiRxXCZeOury8B3p7Wsc0t UYUoxXab7fo7qzX+A5YCcZqD7prZ9K71a3kn48Sw8gBiHLEGc99Gqy3wa5IjQi9fV1Vy aqJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gLx0oFTqTzuTph0zmnGYQpCnALOvQER933NotuJjbjs=; b=aha4h/bfA3r91mqbFy9TaoMknmfQZ9RdYxKX8B8re2jSsgQNrIl2QdAMLr7C25jso3 LRi+eUnasBl/O3jINO8byDwnfH3Z/wpzUocUjYX0m2nfg/B5+/yRoK1/VdaNurX0Y7DA gHUwwdIQzTQEJB1HrCpKsFgkgwmT4fD66O75MHE48wU5aFrCTfup/6eaUi6KWBZ+s4Gs +Q2o8Y8S9Sj8+uAcD0pkfszP30nsiGwrCddY8v1n3ikGK0SBKGHPW5F1Be4V0RmYM0FB +87zIVlnL1t/wP6+FeX6mNB7ptGwGk6GesI64GF0ABgbcqXK5CcjCe40TFxzQ3Gh8Hee TYdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uQ4DOO+t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si6317681ejb.294.2020.06.06.20.12.51; Sat, 06 Jun 2020 20:13:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uQ4DOO+t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726290AbgFGDIs (ORCPT + 99 others); Sat, 6 Jun 2020 23:08:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbgFGDIs (ORCPT ); Sat, 6 Jun 2020 23:08:48 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24F87C08C5C2; Sat, 6 Jun 2020 20:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=gLx0oFTqTzuTph0zmnGYQpCnALOvQER933NotuJjbjs=; b=uQ4DOO+t1aAve27ytLL1YyVEUw J7MHx6VEhJJN6aPkOVbP/C2zgJo40/DhkCf2NIAyN3WruvgdI6VHwYo/2/V1lLlMTbr2bo70HKg4M fVqEE42W/B5Z5twy+9qmbCOkvGa3iIoFacHwa+Qb6c5OQS35AxLiSxbBCgBTJHqw0MkU1qm7dWy3U 9YLvAXJJf4nmKN5gNsQ/0YLYHQtljA00b7bioHKmkDTLqCsCX+F7BN0kNRpnb23k4c0vEI4Zfm5UX 4mO3UzqTlHCjjpH6GOvra0mSU+Iw030ZJDWVuVgZzeBH9sCLI9Cod26uiAMQWAQzRDuKgW8O6pCsg y90WIgxQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jhlfz-0002SO-LG; Sun, 07 Jun 2020 03:08:47 +0000 Date: Sat, 6 Jun 2020 20:08:47 -0700 From: Matthew Wilcox To: Yang Shi Cc: Linux FS-devel Mailing List , Linux MM , Linux Kernel Mailing List , "Kirill A . Shutemov" Subject: Re: [PATCH v3 17/25] mm: Add __page_cache_alloc_order Message-ID: <20200607030847.GS19604@bombadil.infradead.org> References: <20200429133657.22632-1-willy@infradead.org> <20200429133657.22632-18-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 06, 2020 at 11:03:06AM -0700, Yang Shi wrote: > > diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h > > index 55199cb5bd66..1169e2428dd7 100644 > > --- a/include/linux/pagemap.h > > +++ b/include/linux/pagemap.h > > @@ -205,15 +205,33 @@ static inline int page_cache_add_speculative(struct page *page, int count) > > return __page_cache_add_speculative(page, count); > > } > > > > +static inline gfp_t thp_gfpmask(gfp_t gfp) > > +{ > > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > > + /* We'd rather allocate smaller pages than stall a page fault */ > > + gfp |= GFP_TRANSHUGE_LIGHT; > > This looks not correct. GFP_TRANSHUGE_LIGHT may set GFP_FS, but some > filesystem may expect GFP_NOFS, i.e. in readahead path. Apologies, I overlooked this mail. In one of the prerequisite patches for this patch set (which is now merged as f2c817bed58d9be2051fad1d18e167e173c0c227), we call memalloc_nofs_save() in the readahead path. That ensures all allocations will have GFP_NOFS set by the time the page allocator sees them. Thanks for checking on this.