All of lore.kernel.org
 help / color / mirror / Atom feed
* Handling of GFP_WAIT in the slub and slab allocators
@ 2013-06-10 14:09 Nicolas Palix
  2013-06-10 15:18 ` Christoph Lameter
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Palix @ 2013-06-10 14:09 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, Matt Mackall, linux-mm

Hi,

In the SLUB allocator, the GFP_WAIT mask bit is used
in allocate_slab to decide if local_irq_enable must be called.
This test is done again later to decide if local_irq_disable
must be called.

I notice that in the SLAB allocator, local_irq_save and
local_irq_restore are called in slab_alloc_node and slab_alloc without
checking the GFP_WAIT bit of the flags parameter.

Am I missing something or is there something to be fixed in the SLAB allocator ?

As I understand the code so far, this could change the state of the irqs
during the execution of start_kernel (init/main.c) for instance.

Could someone give me enlightenment about those points ?

Regards,
--
Nicolas Palix

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Handling of GFP_WAIT in the slub and slab allocators
  2013-06-10 14:09 Handling of GFP_WAIT in the slub and slab allocators Nicolas Palix
@ 2013-06-10 15:18 ` Christoph Lameter
  2013-06-10 21:27   ` Nicolas Palix
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Lameter @ 2013-06-10 15:18 UTC (permalink / raw)
  To: Nicolas Palix; +Cc: Pekka Enberg, Matt Mackall, linux-mm

On Mon, 10 Jun 2013, Nicolas Palix wrote:

> I notice that in the SLAB allocator, local_irq_save and
> local_irq_restore are called in slab_alloc_node and slab_alloc without
> checking the GFP_WAIT bit of the flags parameter.

SLAB does the same as SLUB. Have a look at mm/slab.c:cache_grow()

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Handling of GFP_WAIT in the slub and slab allocators
  2013-06-10 15:18 ` Christoph Lameter
@ 2013-06-10 21:27   ` Nicolas Palix
  2013-06-10 23:39     ` Christoph Lameter
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Palix @ 2013-06-10 21:27 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: Pekka Enberg, Matt Mackall, linux-mm

On Mon, Jun 10, 2013 at 5:18 PM, Christoph Lameter <cl@gentwo.org> wrote:
> On Mon, 10 Jun 2013, Nicolas Palix wrote:
>
>> I notice that in the SLAB allocator, local_irq_save and
>> local_irq_restore are called in slab_alloc_node and slab_alloc without
>> checking the GFP_WAIT bit of the flags parameter.
>
> SLAB does the same as SLUB. Have a look at mm/slab.c:cache_grow()

I agree and it is the same for mm/slab.c:fallback_alloc() but
why is it not also required for mm/slab.c:slab_alloc_node()
and mm/slab.c:slab_alloc() which both manipulate the local irqs?



--
Nicolas Palix

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Handling of GFP_WAIT in the slub and slab allocators
  2013-06-10 21:27   ` Nicolas Palix
@ 2013-06-10 23:39     ` Christoph Lameter
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Lameter @ 2013-06-10 23:39 UTC (permalink / raw)
  To: Nicolas Palix; +Cc: Pekka Enberg, Matt Mackall, linux-mm

On Mon, 10 Jun 2013, Nicolas Palix wrote:

> On Mon, Jun 10, 2013 at 5:18 PM, Christoph Lameter <cl@gentwo.org> wrote:
> > On Mon, 10 Jun 2013, Nicolas Palix wrote:
> >
> >> I notice that in the SLAB allocator, local_irq_save and
> >> local_irq_restore are called in slab_alloc_node and slab_alloc without
> >> checking the GFP_WAIT bit of the flags parameter.
> >
> > SLAB does the same as SLUB. Have a look at mm/slab.c:cache_grow()
>
> I agree and it is the same for mm/slab.c:fallback_alloc() but
> why is it not also required for mm/slab.c:slab_alloc_node()
> and mm/slab.c:slab_alloc() which both manipulate the local irqs?

Because cache_grow calls into the page allocator and we cannot do reclaim
with interrupts off.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-10 23:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10 14:09 Handling of GFP_WAIT in the slub and slab allocators Nicolas Palix
2013-06-10 15:18 ` Christoph Lameter
2013-06-10 21:27   ` Nicolas Palix
2013-06-10 23:39     ` Christoph Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.