Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp690005ybh; Tue, 21 Jul 2020 05:43:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdOnT6xkMOQW4L5CHqHyBjVlJ5J/7TTn3nApLaqMXoDV6+IM9PniyiNxPrRINfluzprgCN X-Received: by 2002:a17:906:2799:: with SMTP id j25mr25181764ejc.466.1595335431996; Tue, 21 Jul 2020 05:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595335431; cv=none; d=google.com; s=arc-20160816; b=BlfS/sQjEdZfIuPQ9JAEgK6893WacfWqgk2J78sqV6jAhLH1BD8lwl0v+mCscjK127 D3/OgLm2jcD3l3j5icvy8vIu3lFLGadhYNVkExtc4aVUvfFsFn8EZPU6l2jo9V5i05vq sBGH6ryJEKvPGP7cKRIS43f7/X78zv56byJSApbnhoBTsfvip4Dpm9usR1qOpZ1R2/29 wyGWQRUzdUON4MQcwtnUgNFn6+VZ9iji4WdOl+2CZjJARzQ7+Dn22FR0HWw1WFv2P3PW 6AIAjE89DKp/FfDiSXZ+EsOeyDUyH3GjbSxGdBp6s1sAtBfWZsvt/vTkWvyQzkdHVo0G wtEw== 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=95YZXz3xxlBOTS58dhuQjh4OGBpdFgqsFCQfxS9mS3k=; b=PrnbZEuWjpZzLvLq5yLJsmrHYe8mWCd5i6CpljNkLBshIVfbXkG5jcW7/MxkpCeOvl vSTBkQt9I8X0ptS6lc4pWJ034qaInesUpnJWtnb2fkm+Xc26OrmvS5OTRpBv/OVE2uJC kiH4AmVmPTBpvG3fDNAdQBe3BqwJ05ZNBMbBOLFMVoShoirFF7gXvOwAmxwJovkMNpa7 C04FaqbXJGd6VWbDKDqMcgtJzVK1NFhgmTW9ar86MvUe/hc2MjK8Jlpw+A+eD1Cw7ISn Nx+J/THhn0OWITiiE29k/RkmHnhuRQLusKU5ZMb26/9rq1L/ZjJSlCoVBr3wa+6YUB5H Rfvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b="Ig/x4pHH"; 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 h21si12479779ejb.246.2020.07.21.05.43.29; Tue, 21 Jul 2020 05:43:51 -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=casper.20170209 header.b="Ig/x4pHH"; 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 S1728699AbgGUMnS (ORCPT + 99 others); Tue, 21 Jul 2020 08:43:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726904AbgGUMnR (ORCPT ); Tue, 21 Jul 2020 08:43:17 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4082C061794; Tue, 21 Jul 2020 05:43:17 -0700 (PDT) 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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);