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=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 7E4D4C433E0 for ; Tue, 9 Jun 2020 17:38:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 412BF20774 for ; Tue, 9 Jun 2020 17:38:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nf8qYs3f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 412BF20774 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CAF016B0003; Tue, 9 Jun 2020 13:38:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C381B6B0005; Tue, 9 Jun 2020 13:38:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B00046B0006; Tue, 9 Jun 2020 13:38:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id 921636B0003 for ; Tue, 9 Jun 2020 13:38:54 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 49996181F0FEA for ; Tue, 9 Jun 2020 17:38:54 +0000 (UTC) X-FDA: 76910383788.01.army32_401342e26dc4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 17EB9181EA1DF for ; Tue, 9 Jun 2020 17:38:54 +0000 (UTC) X-HE-Tag: army32_401342e26dc4 X-Filterd-Recvd-Size: 4170 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Tue, 9 Jun 2020 17:38:53 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id g1so17044631edv.6 for ; Tue, 09 Jun 2020 10:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PhIgWmwqTHHYLFRj9bS4pjY8kRjpr8XQeQwjE1P6dO4=; b=Nf8qYs3ffgfdyGaKS/hwyfl6ID0k2oY8vglNmHU7kHmrSL+IPnb5vv3zWboci731Ve NlOON4kxYp54uiVEzZRF24LHoVla7fuhD96R88F5kq220CrRi+FkhrU0aarJp1nXx/+k qqT4UUlljP2X4lg0BMYWvdZjSqEk8OZ4BW2/CTxjXaor7ZZqxYa6LVvB76koCFD9bh2Q Cfm+xQ/z5kU3e6cLR8tz1iSil5yxALM61WQJquhHjQywrkxP7DaBxEQURjCu1NT+7YMZ /I2xKNmTnkyT1uVfTxM/zt0y6oV2hhz32F+dAqYE4Qowysuju+ACLA9+lRYDqatzp/uW Xdew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PhIgWmwqTHHYLFRj9bS4pjY8kRjpr8XQeQwjE1P6dO4=; b=Nmsh5YVyvQ8bj00GjpY6c5ru8GaiNOoClr94R26SetkcV1cbmLUKQ3C8AXPy3qN8R/ HetIenXKNG9GWdx4n0g2EWkoUBItsH0WMBQUYJ8KRwXRGbkcbpMDWUTfUPoisg7zyq6J NyfcStpxM+nIuKJNT+EvBrSzyxBCi9vX8dZcBgDaGH21oGdJAOHFZIOzWedcXE+BmRKI mHSO4UcvH0Z20vJgWl6TJSUPlxVTYLIupD5TNbEoWjtDPnZc+Blx9x7KO8HLsQHSx2VX sp3EcPew+gIzNQbT/okTRv/aA3HNeEd2RR9luV5LA4sTluw9HXs9447w3V9sVM6w7GY6 280w== X-Gm-Message-State: AOAM533MnofP+9JsFykx0k8pbGC7yV66QxUKU+S7WiotGXdGWB95Q1+K 6hFSq58Xhfe0hry8bRKKz9Tknwf9POTp1INwsrQ= X-Google-Smtp-Source: ABdhPJyzF/oqxiQcpDv42b2V3XczCloQQHDIKu/J7WPLxZzRjf0KJt9cN0SEvPjPXZu2usVEJrk/nEELX6Iv0IkLcsU= X-Received: by 2002:a50:9e21:: with SMTP id z30mr26917408ede.347.1591724332496; Tue, 09 Jun 2020 10:38:52 -0700 (PDT) MIME-Version: 1.0 References: <20200429133657.22632-1-willy@infradead.org> <20200429133657.22632-18-willy@infradead.org> <20200607030847.GS19604@bombadil.infradead.org> In-Reply-To: <20200607030847.GS19604@bombadil.infradead.org> From: Yang Shi Date: Tue, 9 Jun 2020 10:38:09 -0700 Message-ID: Subject: Re: [PATCH v3 17/25] mm: Add __page_cache_alloc_order To: Matthew Wilcox Cc: Linux FS-devel Mailing List , Linux MM , Linux Kernel Mailing List , "Kirill A . Shutemov" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 17EB9181EA1DF X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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, Jun 6, 2020 at 8:08 PM Matthew Wilcox wrote: > > 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. Aha, yes, correct. I missed that. Thanks for finding that commit.