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.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 8BC36C433EB for ; Tue, 21 Jul 2020 12:44:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 47B5220717 for ; Tue, 21 Jul 2020 12:43:59 +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="Ig/x4pHH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47B5220717 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 E64D66B0002; Tue, 21 Jul 2020 08:43:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E172F6B0003; Tue, 21 Jul 2020 08:43:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D2F336B0005; Tue, 21 Jul 2020 08:43:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id BE1446B0002 for ; Tue, 21 Jul 2020 08:43:58 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 29131181AF5E6 for ; Tue, 21 Jul 2020 12:43:58 +0000 (UTC) X-FDA: 77062050156.12.ray60_470030b26f2d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 60FF218116421 for ; Tue, 21 Jul 2020 12:43:19 +0000 (UTC) X-HE-Tag: ray60_470030b26f2d X-Filterd-Recvd-Size: 3091 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Jul 2020 12:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=95YZXz3xxlBOTS58dhuQjh4OGBpdFgqsFCQfxS9mS3k=; b=Ig/x4pHHVBpLErcMn0lsrCPY9M 0BNQWBie4Cz8aoJX0pZEKqzc8nkJlu4m+dUhTgMalQJ9z+8TarVYFNW62Bb0SHNvGL2a0/5kqyGTV sTCtKlD4n1L7yzYRjDWGwGujF7C5js5WlfPgiamtUQIw8K75AEKJWyV0aBi+kotG7nC1xvMsXlk/+ mJv5oF+8g2R+kpNzDk4/zd+Qjscef+YImXtGWEhQLIr9/5hnOjQB2ejJ+wE655ykvI9RsS2L1m5yw E/Rt7duHDyIa3xKMou6IEtHda1xjbeUeT+Va7CicrbG/ghxqafAsFqi7yXoxFxxNNZ8JK3GWUSfAV 36ECX8pQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxrc0-00039d-CK; Tue, 21 Jul 2020 12:43:12 +0000 Date: Tue, 21 Jul 2020 13:43:12 +0100 From: Matthew Wilcox To: Vlastimil Babka Cc: js1304@gmail.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Michal Hocko , "Aneesh Kumar K . V" , Joonsoo Kim , stable@vger.kernel.org Subject: Re: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs Message-ID: <20200721124312.GE15516@casper.infradead.org> References: <1595302129-23895-1-git-send-email-iamjoonsoo.kim@lge.com> <20200721120533.GD15516@casper.infradead.org> <4c484ce0-cfed-0c50-7a20-d1474ce9afee@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4c484ce0-cfed-0c50-7a20-d1474ce9afee@suse.cz> X-Rspamd-Queue-Id: 60FF218116421 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 Tue, Jul 21, 2020 at 02:38:56PM +0200, Vlastimil Babka wrote: > On 7/21/20 2:05 PM, Matthew Wilcox wrote: > > On Tue, Jul 21, 2020 at 12:28:49PM +0900, js1304@gmail.com wrote: > >> @@ -4619,8 +4631,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, > >> wake_all_kswapds(order, gfp_mask, ac); > >> > >> reserve_flags = __gfp_pfmemalloc_flags(gfp_mask); > >> - if (reserve_flags) > >> + if (reserve_flags) { > >> alloc_flags = reserve_flags; > >> + alloc_flags = current_alloc_flags(gfp_mask, alloc_flags); > >> + } > > > > Is this right? Shouldn't you be passing reserve_flags to > > current_alloc_flags() here? Also, there's no need to add { } here. > > Note the "alloc_flags = reserve_flags;" line is not being deleted here. But if > it was, your points would be true, and yeah it would be a bit more tidy. Oh ... I should wake up a little more. Yeah, I'd recommend just doing this: - alloc_flags = reserve_flags; + alloc_flags = current_alloc_flags(gfp_mask, reserve_flags);