[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180726153605.GB27612@bombadil.infradead.org>
Date: Thu, 26 Jul 2018 08:36:05 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Mike Rapoport <rppt@...ux.vnet.ibm.com>
Cc: Michal Hocko <mhocko@...nel.org>, Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-doc@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 7/7] docs/core-api: mm-api: add section about GFP flags
On Thu, Jul 26, 2018 at 06:18:53PM +0300, Mike Rapoport wrote:
> On Thu, Jul 26, 2018 at 04:20:39PM +0200, Michal Hocko wrote:
> > > Functions which need to allocate memory often use GFP flags to express
> > > how that memory should be allocated. The GFP acronym stands for "get
> > > free pages", the underlying memory allocation function.
> >
> > OK.
> >
> > > Not every GFP
> > > flag is allowed to every function which may allocate memory. Most
> > > users will want to use a plain ``GFP_KERNEL`` or ``GFP_ATOMIC``.
> >
> > Or rather than mentioning the two just use "Useful GFP flag
> > combinations" comment segment from gfp.h
>
> The comment there includes GFP_DMA, GFP_NOIO etc so I'd prefer Matthew's
> version and maybe even omit GFP_ATOMIC from it.
I'm totally OK with that.
> Some grepping shows that roughly 80% of allocations are GFP_KERNEL, 12% are
> GFP_ATOMIC and ... I didn't count the usage of other flags ;-)
;-) You'll find a lot of GFP_NOFS and GFP_NOIO in the filesystem/block
code ...
Powered by blists - more mailing lists