Re: [PATCH 2/3] mm: avoid slub allocation while holding list_lock

2019-09-11 Thread Yu Zhao
On Thu, Sep 12, 2019 at 03:44:01AM +0300, Kirill A. Shutemov wrote: > On Wed, Sep 11, 2019 at 06:29:28PM -0600, Yu Zhao wrote: > > If we are already under list_lock, don't call kmalloc(). Otherwise we > > will run into deadlock because kmalloc() also tries to grab the same > > lock. > > > >

Re: [PATCH 2/3] mm: avoid slub allocation while holding list_lock

2019-09-11 Thread Kirill A. Shutemov
On Wed, Sep 11, 2019 at 06:29:28PM -0600, Yu Zhao wrote: > If we are already under list_lock, don't call kmalloc(). Otherwise we > will run into deadlock because kmalloc() also tries to grab the same > lock. > > Instead, statically allocate bitmap in struct kmem_cache_node. Given > currently

[PATCH 2/3] mm: avoid slub allocation while holding list_lock

2019-09-11 Thread Yu Zhao
If we are already under list_lock, don't call kmalloc(). Otherwise we will run into deadlock because kmalloc() also tries to grab the same lock. Instead, statically allocate bitmap in struct kmem_cache_node. Given currently page->objects has 15 bits, we bloat the per-node struct by 4K. So we