lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150930131719.GO3068@techsingularity.net>
Date:	Wed, 30 Sep 2015 14:17:19 +0100
From:	Mel Gorman <mgorman@...hsingularity.net>
To:	Vlastimil Babka <vbabka@...e.cz>
Cc:	Johannes Weiner <hannes@...xchg.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rik van Riel <riel@...hat.com>,
	David Rientjes <rientjes@...gle.com>,
	Joonsoo Kim <iamjoonsoo.kim@....com>,
	Michal Hocko <mhocko@...nel.org>,
	Linux-MM <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Oleg Drokin <oleg.drokin@...el.com>,
	Andreas Dilger <andreas.dilger@...el.com>
Subject: Re: [PATCH 05/10] mm, page_alloc: Distinguish between being unable
 to sleep, unwilling to sleep and avoiding waking kswapd

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ