Loading mm/slub.c +14 −4 Original line number Original line Diff line number Diff line Loading @@ -2704,6 +2704,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) struct kmem_cache *s; struct kmem_cache *s; char *text; char *text; size_t realsize; size_t realsize; unsigned long slabflags; s = kmalloc_caches_dma[index]; s = kmalloc_caches_dma[index]; if (s) if (s) Loading @@ -2725,10 +2726,18 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) (unsigned int)realsize); (unsigned int)realsize); s = kmalloc(kmem_size, flags & ~SLUB_DMA); s = kmalloc(kmem_size, flags & ~SLUB_DMA); /* * Must defer sysfs creation to a workqueue because we don't know * what context we are called from. Before sysfs comes up, we don't * need to do anything because our sysfs initcall will start by * adding all existing slabs to sysfs. */ slabflags = SLAB_CACHE_DMA|SLAB_NOTRACK; if (slab_state >= SYSFS) slabflags |= __SYSFS_ADD_DEFERRED; if (!s || !text || !kmem_cache_open(s, flags, text, if (!s || !text || !kmem_cache_open(s, flags, text, realsize, ARCH_KMALLOC_MINALIGN, realsize, ARCH_KMALLOC_MINALIGN, slabflags, NULL)) { SLAB_CACHE_DMA|SLAB_NOTRACK|__SYSFS_ADD_DEFERRED, NULL)) { kfree(s); kfree(s); kfree(text); kfree(text); goto unlock_out; goto unlock_out; Loading @@ -2737,6 +2746,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) list_add(&s->list, &slab_caches); list_add(&s->list, &slab_caches); kmalloc_caches_dma[index] = s; kmalloc_caches_dma[index] = s; if (slab_state >= SYSFS) schedule_work(&sysfs_add_work); schedule_work(&sysfs_add_work); unlock_out: unlock_out: Loading Loading
mm/slub.c +14 −4 Original line number Original line Diff line number Diff line Loading @@ -2704,6 +2704,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) struct kmem_cache *s; struct kmem_cache *s; char *text; char *text; size_t realsize; size_t realsize; unsigned long slabflags; s = kmalloc_caches_dma[index]; s = kmalloc_caches_dma[index]; if (s) if (s) Loading @@ -2725,10 +2726,18 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) (unsigned int)realsize); (unsigned int)realsize); s = kmalloc(kmem_size, flags & ~SLUB_DMA); s = kmalloc(kmem_size, flags & ~SLUB_DMA); /* * Must defer sysfs creation to a workqueue because we don't know * what context we are called from. Before sysfs comes up, we don't * need to do anything because our sysfs initcall will start by * adding all existing slabs to sysfs. */ slabflags = SLAB_CACHE_DMA|SLAB_NOTRACK; if (slab_state >= SYSFS) slabflags |= __SYSFS_ADD_DEFERRED; if (!s || !text || !kmem_cache_open(s, flags, text, if (!s || !text || !kmem_cache_open(s, flags, text, realsize, ARCH_KMALLOC_MINALIGN, realsize, ARCH_KMALLOC_MINALIGN, slabflags, NULL)) { SLAB_CACHE_DMA|SLAB_NOTRACK|__SYSFS_ADD_DEFERRED, NULL)) { kfree(s); kfree(s); kfree(text); kfree(text); goto unlock_out; goto unlock_out; Loading @@ -2737,6 +2746,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) list_add(&s->list, &slab_caches); list_add(&s->list, &slab_caches); kmalloc_caches_dma[index] = s; kmalloc_caches_dma[index] = s; if (slab_state >= SYSFS) schedule_work(&sysfs_add_work); schedule_work(&sysfs_add_work); unlock_out: unlock_out: Loading