lkml.org 
[lkml]   [2020]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Raw spinlocks and memory allocation
On Fri, Jul 31, 2020 at 01:38:34PM -0700, Andrew Morton wrote:
> On Thu, 30 Jul 2020 16:12:05 -0700 "Paul E. McKenney" <paulmck@kernel.org> wrote:
>
> > So, may we add a GFP_ flag that will cause kmalloc() and friends to return
> > NULL when they would otherwise need to acquire their non-raw spinlock?
> > This avoids adding any overhead to the slab-allocator fastpaths, but
> > allows callback invocation to reduce cache misses without having to
> > restructure some existing callers of call_rcu() and potential future
> > callers of kfree_rcu().
>
> We have eight free gfp_t bits so that isn't a problem.

Whew!!! ;-)

> Adding a test-n-branch to the kmalloc() fastpath may well be a concern.
>
> Which of mm/sl?b.c are affected?

None of them, it turns out. The initial patch will instead directly
invoke __get_free_page(). So we could just leave sl?b.c alone.

> A doesnt-need-to-really-work protopatch would help us understand the
> potential cost?

Makes sense! My guess is that Uladzislau Rezki (CCed) will be sending
one along by the middle of next week.

Thanx, Paul

\
 
 \ /
  Last update: 2020-07-31 22:50    [W:0.077 / U:1.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site