From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752560AbcGSW21 (ORCPT ); Tue, 19 Jul 2016 18:28:27 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:34674 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952AbcGSW2X (ORCPT ); Tue, 19 Jul 2016 18:28:23 -0400 Date: Tue, 19 Jul 2016 15:28:16 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Vlastimil Babka cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Mel Gorman , Joonsoo Kim , Rik van Riel Subject: Re: [PATCH 2/8] mm, page_alloc: set alloc_flags only once in slowpath In-Reply-To: <20160718112302.27381-3-vbabka@suse.cz> Message-ID: References: <20160718112302.27381-1-vbabka@suse.cz> <20160718112302.27381-3-vbabka@suse.cz> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Jul 2016, Vlastimil Babka wrote: > In __alloc_pages_slowpath(), alloc_flags doesn't change after it's initialized, > so move the initialization above the retry: label. Also make the comment above > the initialization more descriptive. > > The only exception in the alloc_flags being constant is ALLOC_NO_WATERMARKS, > which may change due to TIF_MEMDIE being set on the allocating thread. We can > fix this, and make the code simpler and a bit more effective at the same time, > by moving the part that determines ALLOC_NO_WATERMARKS from > gfp_to_alloc_flags() to gfp_pfmemalloc_allowed(). This means we don't have to > mask out ALLOC_NO_WATERMARKS in numerous places in __alloc_pages_slowpath() > anymore. The only two tests for the flag can instead call > gfp_pfmemalloc_allowed(). > > Signed-off-by: Vlastimil Babka Acked-by: David Rientjes Looks good, although maybe a new name for gfp_pfmemalloc_allowed() would be in order.