Received: by 10.213.65.68 with SMTP id h4csp3931054imn; Tue, 10 Apr 2018 06:50:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx489eyTjatLel+C3sgKcDeLupBoj/ERs4SjNkr3qAMc4zL7B9v/BsLs/0AaZoZGiDyLTTSs6 X-Received: by 2002:a17:902:585e:: with SMTP id f30-v6mr540217plj.254.1523368254125; Tue, 10 Apr 2018 06:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523368254; cv=none; d=google.com; s=arc-20160816; b=zpqOl7hwmRefVi287vHalU0bfyImQ1B/IuBhuXyZe+kym/pjJKhrL0EQLnp1M1hd3Q QTVo9ewByUeGcaL1k/5chmPf4EhRFxGTCTT1h72AZkCSphi1kpdgDDG0DiCDOjZhwYps ewG4FvY+ubhxvw/OtSEyP+HsWf7S2f5jD6MWr/paI81Pj1pkt3cIk7Prh79Yv4SbRrxe tWXy30oZMmHNy758vcvQ1C6I5AR/Z0h1m7avmLkaAKwsgAqcKm84bjP5TyVc7SfB7VlJ 7C7BDzvJwGd3Epy1xWn1jmJKOUgwWgg3gDOKtACkuHx6fwN4GuSJaHUM5R8pPoywIJXe LgJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ZeAVmPM/KYKLrh4bEBY8yPDCNJ70OuW8CwOLSICbt9Y=; b=ylrzAcpSZ67TNfpm6HacDHqdEMEqGEvx8Rlmnf37kuAKXd/LEujU7QnBlp0Sr/0nMh OWo+uqETeZ/DJeDlTqt5jiKXnF39k6IrQ6AlQWkI+6B1WJ1KbOU1AxTZ0m5w7CZ9XAnA yWA+bLm+Zd5y67TRJxRT4uDmE10s8UI1Ha91ayao6Oa3Mt2u7j7pfiGKGNW5L2dmUV8h 4s6vFaApIKfTk4+Dak0DCu6c05fCE9Le3IqQOwAPmfFnS1Xb8HfviZ1VIGaSYNeDo7WO itqjrC8RUJkozXEnberckPghFgtMo0CG76gM461SimdQGxR/bJNfe7r6KvX+8K5GACNj Ge+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=PygIAya+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si1797986pga.391.2018.04.10.06.50.17; Tue, 10 Apr 2018 06:50:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=PygIAya+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753950AbeDJNp4 (ORCPT + 99 others); Tue, 10 Apr 2018 09:45:56 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:36761 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752721AbeDJNpy (ORCPT ); Tue, 10 Apr 2018 09:45:54 -0400 Received: by mail-pl0-f65.google.com with SMTP id 91-v6so7564001pld.3; Tue, 10 Apr 2018 06:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZeAVmPM/KYKLrh4bEBY8yPDCNJ70OuW8CwOLSICbt9Y=; b=PygIAya+er+cm/eQ2DG+/I9nAGk6JYZ+T+Gk9uBWF6jj9YFq0t/T0yIvUlJE2Wgn+3 jdSmdH6TI4vZKNbkqB4mpYMHoU/xrot/5RZfGTUv7E2J6koZ0dUXZhUW9VbVtACygIRV 6tDYyp531+JrSPUyjcsUNLPzLjDVSQPUzsAr7q+WnHZ5LXSFxQW0eBUlQ5xcrTwnv4nk piaD0gYAI/awBI+5T84Ckz7hywcy3QsVEcmMyeZM2Fp1z5mmqhQIwLqZVajb9a0Av6km MDhLttpxb0v6KVoCpqs65sej515gA7ALIq6EHjl883RcrQ9Hh2NL3JlEw9E6/EJZwceU KRlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ZeAVmPM/KYKLrh4bEBY8yPDCNJ70OuW8CwOLSICbt9Y=; b=SOomVLwrhuuDbf0Hnu2r7RC/zO+DRYLY3GYEGRyWNpeSeSGYPt4Sh39LTaaY6VsE5M W1PE3B5gs+2TVAG4S0gI1rGb0uz3zFEdHrBaYpCwWQL6w+Q2S2KCctEleFSMKHj9uo0w NPAXoZZiMIRtons6lwR/jZPfYeXMsTh5GC7vIEVQs4kfssrX2rvcMSspuvNvNqRtkyF8 rFyJxyuesZK6Pwx1nILyJvVFlfhUsi8o2X0YFDa7htllNOEHUyCkcfIM7ruLjs+QCofh Z09GKfFaTW8x8rpl5rcl5dBIkCTTq8yPOZO7FRfRa+SXsK5lA0Oc4/jNQVvEVtE8gUEt PDsg== X-Gm-Message-State: ALQs6tCylkROTLz2j6b/nW6B6SIEBqJpWeSCMLScC3iconnJtYLTETAN Zdutxl8AEQSaniTbPynwYX6tCLwc X-Received: by 2002:a17:902:5c6:: with SMTP id f64-v6mr502571plf.77.1523367954142; Tue, 10 Apr 2018 06:45:54 -0700 (PDT) Received: from rodete-laptop-imager.corp.google.com ([122.38.223.241]) by smtp.gmail.com with ESMTPSA id q62sm7387968pfd.61.2018.04.10.06.45.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Apr 2018 06:45:52 -0700 (PDT) Date: Tue, 10 Apr 2018 22:45:45 +0900 From: Minchan Kim To: Matthew Wilcox Cc: linux-mm@kvack.org, Matthew Wilcox , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org, Jan Kara , Jeff Layton , Mel Gorman , stable@vger.kernel.org, jaegeuk@kernel.org Subject: Re: [PATCH 2/2] page cache: Mask off unwanted GFP flags Message-ID: <20180410134545.GA35354@rodete-laptop-imager.corp.google.com> References: <20180410125351.15837-1-willy@infradead.org> <20180410125351.15837-2-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180410125351.15837-2-willy@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 05:53:51AM -0700, Matthew Wilcox wrote: > From: Matthew Wilcox > > The page cache has used the mapping's GFP flags for allocating > radix tree nodes for a long time. It took care to always mask off the > __GFP_HIGHMEM flag, and masked off other flags in other paths, but the > __GFP_ZERO flag was still able to sneak through. The __GFP_DMA and > __GFP_DMA32 flags would also have been able to sneak through if they > were ever used. Fix them all by using GFP_RECLAIM_MASK at the innermost > location, and remove it from earlier in the callchain. > > Fixes: 19f99cee206c ("f2fs: add core inode operations") Why this patch fix 19f99cee206c instead of 449dd6984d0e? F2FS doesn't have any problem before introducing 449dd6984d0e? > Reported-by: Minchan Kim > Signed-off-by: Matthew Wilcox > Cc: stable@vger.kernel.org > --- > mm/filemap.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/mm/filemap.c b/mm/filemap.c > index c2147682f4c3..1a4bfc5ed3dc 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -785,7 +785,7 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask) > VM_BUG_ON_PAGE(!PageLocked(new), new); > VM_BUG_ON_PAGE(new->mapping, new); > > - error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM); > + error = radix_tree_preload(gfp_mask & GFP_RECLAIM_MASK); > if (!error) { > struct address_space *mapping = old->mapping; > void (*freepage)(struct page *); > @@ -841,7 +841,7 @@ static int __add_to_page_cache_locked(struct page *page, > return error; > } > > - error = radix_tree_maybe_preload(gfp_mask & ~__GFP_HIGHMEM); > + error = radix_tree_maybe_preload(gfp_mask & GFP_RECLAIM_MASK); > if (error) { > if (!huge) > mem_cgroup_cancel_charge(page, memcg, false); > @@ -1574,8 +1574,7 @@ struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset, > if (fgp_flags & FGP_ACCESSED) > __SetPageReferenced(page); > > - err = add_to_page_cache_lru(page, mapping, offset, > - gfp_mask & GFP_RECLAIM_MASK); > + err = add_to_page_cache_lru(page, mapping, offset, gfp_mask); > if (unlikely(err)) { > put_page(page); > page = NULL; > @@ -2378,7 +2377,7 @@ static int page_cache_read(struct file *file, pgoff_t offset, gfp_t gfp_mask) > if (!page) > return -ENOMEM; > > - ret = add_to_page_cache_lru(page, mapping, offset, gfp_mask & GFP_KERNEL); > + ret = add_to_page_cache_lru(page, mapping, offset, gfp_mask); > if (ret == 0) > ret = mapping->a_ops->readpage(file, page); > else if (ret == -EEXIST) > -- > 2.16.3 >