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]
Date:   Tue, 26 Oct 2021 14:23:32 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     NeilBrown <neilb@...e.de>
Cc:     linux-mm@...ck.org, Dave Chinner <david@...morbit.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Christoph Hellwig <hch@...radead.org>,
        Uladzislau Rezki <urezki@...il.com>,
        linux-fsdevel@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
        Ilya Dryomov <idryomov@...il.com>,
        Jeff Layton <jlayton@...nel.org>
Subject: Re: [PATCH 4/4] mm: allow !GFP_KERNEL allocations for kvmalloc

On Tue 26-10-21 21:48:05, Neil Brown wrote:
> On Tue, 26 Oct 2021, Michal Hocko wrote:
[...]
> > > GFP_NOWAIT is not a modifier.  It is a base value that can be modified.
> > > I think you mean that
> > >     __GFP_NORETRY is not supported and __GFP_DIRECT_RECLAIM is required
> > 
> > I thought naming the higher level gfp mask would be more helpful here.
> > Most people do not tend to think in terms of __GFP_DIRECT_RECLAIM but
> > rather GFP_NOWAIT or GFP_ATOMIC.
> 
> Maybe it would.  But the text says "Reclaim modifiers" and then lists
> one modifier and one mask.  That is confusing.
> If you want to mention both, keep them separate.
> 
>   GFP_NOWAIT and GFP_ATOMIC are not supported, neither is the
>   __GFP_NORETRY modifier.
> 
> or something like that.

Fair enough. I went with this
commit fb93996c217cea864a3b3ffa8a8cd482bf0a1f62
Author: Michal Hocko <mhocko@...e.com>
Date:   Tue Oct 26 14:23:00 2021 +0200

    fold me "mm: allow !GFP_KERNEL allocations for kvmalloc"

diff --git a/mm/util.c b/mm/util.c
index fdec6b4b1267..1fb6dd907bb0 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -549,7 +549,7 @@ EXPORT_SYMBOL(vm_mmap);
  * Uses kmalloc to get the memory but if the allocation fails then falls back
  * to the vmalloc allocator. Use kvfree for freeing the memory.
  *
- * Reclaim modifiers - __GFP_NORETRY and GFP_NOWAIT are not supported.
+ * GFP_NOWAIT and GFP_ATOMIC are not supported, neither is the __GFP_NORETRY modifier.
  * __GFP_RETRY_MAYFAIL is supported, and it should be used only if kmalloc is
  * preferable to the vmalloc fallback, due to visible performance drawbacks.
  *
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ