From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933238AbbI3NRc (ORCPT ); Wed, 30 Sep 2015 09:17:32 -0400 Received: from outbound-smtp04.blacknight.com ([81.17.249.35]:48726 "EHLO outbound-smtp04.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754547AbbI3NR2 (ORCPT ); Wed, 30 Sep 2015 09:17:28 -0400 Date: Wed, 30 Sep 2015 14:17:19 +0100 From: Mel Gorman To: Vlastimil Babka Cc: Johannes Weiner , Andrew Morton , Rik van Riel , David Rientjes , Joonsoo Kim , Michal Hocko , Linux-MM , LKML , Oleg Drokin , Andreas Dilger Subject: Re: [PATCH 05/10] mm, page_alloc: Distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd Message-ID: <20150930131719.GO3068@techsingularity.net> References: <1442832762-7247-1-git-send-email-mgorman@techsingularity.net> <1442832762-7247-6-git-send-email-mgorman@techsingularity.net> <20150924205509.GI3009@cmpxchg.org> <20150925125106.GG3068@techsingularity.net> <20150925190138.GA16359@cmpxchg.org> <20150929133547.GI3068@techsingularity.net> <560BD4F0.3080402@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <560BD4F0.3080402@suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2015 at 02:26:24PM +0200, Vlastimil Babka wrote: > [+CC lustre maintainers] > > On 09/29/2015 03:35 PM, Mel Gorman wrote: > >>>Ok, I'll add a TODO to create a patch that removes GFP_IOFS entirely. It > >>>can be tacked on to the end of the series. > >> > >>Okay, that makes sense to me. Thanks! > >> > > > >This? > > Thanks for adding this, I think I also pointed this GFP_IOFS oddness in > earlier versions. > > >---8<--- > >mm: page_alloc: Remove GFP_IOFS > > > >GFP_IOFS was intended to be shorthand for clearing two flags, not a > >set of allocation flags. There is only one user of this flag combination > >now and there appears to be no reason why Lustre had to be protected > > Looks like a mistake to me. __GFP_IO | __GFP_FS have no effect without > (former) __GFP_WAIT, so I doubt __GFP_WAIT was omitted on purpose, while > leaving the other two. The naming of GFP_IOFS suggested it was to be used in > allocations, leading to the mistake. > GFP_IOFS is shorthand clearing bits and should not have been used as an allocation flag. Using it as an allocation flag is almost certainly a mistake. At a stretch, GFP_IOFS could make sense if we supprted page reclaim that does not block (e.g. discard clean pages without buffers to release) but we don't. > But I see you also converted several instances of GFP_NOFS to GFP_KERNEL. Is > that correct? This is a filesystem driver after all... > Only in the cases where a reclaim path is reentrant and could already be holding locks that results in deadlock. I didn't spot such a case but then again, I'm not familiar with the filesystem and it's complex. Lets see what they say because how they are currently using GFP_IOFS is almost certainly wrong or at least surprising. > >diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c > >index effa2af58c13..a7d72f69c4eb 100644 > >--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c > >+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c > >@@ -810,7 +810,7 @@ int cfs_trace_allocate_string_buffer(char **str, int nob) > > if (nob > 2 * PAGE_CACHE_SIZE) /* string must be "sensible" */ > > return -EINVAL; > > > >- *str = kmalloc(nob, GFP_IOFS | __GFP_ZERO); > >+ *str = kmalloc(nob, GFP_KERNEL | __GFP_ZERO); > > This could use kzalloc. > True. -- Mel Gorman SUSE Labs