From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754410AbbI1Xz0 (ORCPT ); Mon, 28 Sep 2015 19:55:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34926 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753789AbbI1XzZ (ORCPT ); Mon, 28 Sep 2015 19:55:25 -0400 Date: Mon, 28 Sep 2015 16:55:23 -0700 From: Andrew Morton To: Mel Gorman Cc: Johannes Weiner , Rik van Riel , Vlastimil Babka , David Rientjes , Joonsoo Kim , Michal Hocko , Linux-MM , LKML Subject: Re: [PATCH 06/10] mm, page_alloc: Rename __GFP_WAIT to __GFP_RECLAIM Message-Id: <20150928165523.a52facb27c7ff4c29d902b6c@linux-foundation.org> In-Reply-To: <1442832762-7247-7-git-send-email-mgorman@techsingularity.net> References: <1442832762-7247-1-git-send-email-mgorman@techsingularity.net> <1442832762-7247-7-git-send-email-mgorman@techsingularity.net> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Sep 2015 11:52:38 +0100 Mel Gorman wrote: > __GFP_WAIT was used to signal that the caller was in atomic context and > could not sleep. Now it is possible to distinguish between true atomic > context and callers that are not willing to sleep. The latter should clear > __GFP_DIRECT_RECLAIM so kswapd will still wake. As clearing __GFP_WAIT > behaves differently, there is a risk that people will clear the wrong > flags. This patch renames __GFP_WAIT to __GFP_RECLAIM to clearly indicate > what it does -- setting it allows all reclaim activity, clearing them > prevents it. We have quite a history of remote parts of the kernel using weird/wrong/inexplicable combinations of __GFP_ flags. I tend to think that this is because we didn't adequately explain the interface. And I don't think that gfp.h really improved much in this area as a result of this patchset. Could you go through it some time and decide if we've adequately documented all this stuff? GFP_ATOMIC vs GFP_NOWAIT? GFP_USER vs GFP_HIGHUSER? When should I use GFP_HIGHUSER_MOVABLE instead? Why isn't there a GFP_USER_MOVABLE? What's GFP_IOFS? GFP_RECLAIM_MASK through GFP_SLAB_BUG_MASK are mm-internal, but look the same as the exported interface definitions. __GFP_MOVABLE is documented twice, the second in an odd place. etcetera. It's rather unclear which symbols are part of the exported interface and which are "mm internal only".