Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1608250 > unrolled thread

__link_block_group uses GFP_KERNEL

Started byDenis Kirjanov <dkirjanov@cloudlinux.com>
First post2017-03-24 10:10 +0100
Last post2017-03-25 07:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  __link_block_group uses GFP_KERNEL Denis Kirjanov <dkirjanov@cloudlinux.com> - 2017-03-24 10:10 +0100
    Re: __link_block_group uses GFP_KERNEL Jeff Mahoney <jeffm@suse.com> - 2017-03-25 00:20 +0100
      Re: __link_block_group uses GFP_KERNEL Denis Kirjanov <dkirjanov@cloudlinux.com> - 2017-03-25 07:50 +0100

#1608250 — __link_block_group uses GFP_KERNEL

FromDenis Kirjanov <dkirjanov@cloudlinux.com>
Date2017-03-24 10:10 +0100
Subject__link_block_group uses GFP_KERNEL
Message-ID<toton-7Is-35@gated-at.bofh.it>
Hi guys,

Looks like that current code does GFP_KERNEL allocation inside
__link_block_group.
the function invokes kobject_add and internally creates sysfs files
with the GFP_KERNEL flag set.
But since do_chunk_alloc executes insides the btrfs transaction it's
not allowed to sleep.

Thanks!

[toc] | [next] | [standalone]


#1609019

FromJeff Mahoney <jeffm@suse.com>
Date2017-03-25 00:20 +0100
Message-ID<toGEV-m5-13@gated-at.bofh.it>
In reply to#1608250

[Multipart message — attachments visible in raw view] — view raw

On 3/24/17 5:02 AM, Denis Kirjanov wrote:
> Hi guys,
> 
> Looks like that current code does GFP_KERNEL allocation inside
> __link_block_group.
> the function invokes kobject_add and internally creates sysfs files
> with the GFP_KERNEL flag set.

Yep, that's a bug.

> But since do_chunk_alloc executes insides the btrfs transaction it's
> not allowed to sleep.

It's allowed to sleep but isn't allowed to do reclaim that involves file
system writeback.  Michal Hocko's allocation context idea would fix
this, but it's not there yet, so we'll need to defer the kobject_add
until we can use GFP_KERNEL.

-Jeff

-- 
Jeff Mahoney
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1609109

FromDenis Kirjanov <dkirjanov@cloudlinux.com>
Date2017-03-25 07:50 +0100
Message-ID<toNGp-5pq-1@gated-at.bofh.it>
In reply to#1609019
On 3/25/17, Jeff Mahoney <jeffm@suse.com> wrote:
> On 3/24/17 5:02 AM, Denis Kirjanov wrote:
>> Hi guys,
>>
>> Looks like that current code does GFP_KERNEL allocation inside
>> __link_block_group.
>> the function invokes kobject_add and internally creates sysfs files
>> with the GFP_KERNEL flag set.
>
> Yep, that's a bug.
>
>> But since do_chunk_alloc executes insides the btrfs transaction it's
>> not allowed to sleep.
>
> It's allowed to sleep but isn't allowed to do reclaim that involves file
> system writeback.  Michal Hocko's allocation context idea would fix
> this, but it's not there yet, so we'll need to defer the kobject_add
> until we can use GFP_KERNEL.

Ok, I see. Can you point out to the initial patchset?

Thanks!

>
> -Jeff
>
> --
> Jeff Mahoney
> SUSE Labs
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web