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.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 90565C433DF for ; Sun, 7 Jun 2020 03:08:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4EDCF20723 for ; Sun, 7 Jun 2020 03:08:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uQ4DOO+t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EDCF20723 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B4EBD80007; Sat, 6 Jun 2020 23:08:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFEB28E0006; Sat, 6 Jun 2020 23:08:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EDA180007; Sat, 6 Jun 2020 23:08:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id 835DC8E0006 for ; Sat, 6 Jun 2020 23:08:53 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3EB77375D for ; Sun, 7 Jun 2020 03:08:53 +0000 (UTC) X-FDA: 76900933746.13.pie73_361460426dad Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 15CD818140B69 for ; Sun, 7 Jun 2020 03:08:53 +0000 (UTC) X-HE-Tag: pie73_361460426dad X-Filterd-Recvd-Size: 2959 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Sun, 7 Jun 2020 03:08:52 +0000 (UTC) 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: X-Rspamd-Queue-Id: 15CD818140B69 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 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.