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


Groups > linux.kernel > #1424565

Re: [BUG] act_ife: sleeping functions called in atomic context

From Jamal Hadi Salim <jhs@mojatatu.com>
Newsgroups linux.kernel
Subject Re: [BUG] act_ife: sleeping functions called in atomic context
Date 2016-06-17 02:40 +0200
Message-ID <rKPZf-7Fj-29@gated-at.bofh.it> (permalink)
References <rKMym-4B7-3@gated-at.bofh.it> <rKNkK-5aq-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

On 16-06-16 05:43 PM, Cong Wang wrote:
> On Thu, Jun 16, 2016 at 1:50 PM, Alexey Khoroshilov
> <khoroshilov@ispras.ru> wrote:
>> tcf_ife_init() contains a big chunk of code executed with
>> ife->tcf_lock spinlock held. But that code contains several calls
>> to sleeping functions:
>>    populate_metalist() and use_all_metadata()
>>      -> add_metainfo()
>>        -> find_ife_oplist(metaid)
>>          -> read_lock()
>>          -> try_module_get(o->owner)
>>        -> kzalloc(sizeof(*mi), GFP_KERNEL);
>
> Hmm, we don't need to hold that spinlock when we create a new ife action,
> since we haven't inserted it yet. We do need it when we modify an existing
> one. So I am thinking if we can refactor that code to avoid spinlock
> whenever possible.
>

Does attached (compile tested) patch help?

>>        -> ops->alloc(mi, metaval);
>>        -> module_put(ops->owner);
>>    _tcf_ife_cleanup()
>>      -> module_put()
>>
>> The same problem is actual for tcf_ife_cleanup() as well.
>>
>
> Huh? Both module_put() and kfree() should not sleep, right?
>

I dont think there is any sleeping there ;->

cheers,
jamal

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[BUG] act_ife: sleeping functions called in atomic context Alexey Khoroshilov <khoroshilov@ispras.ru> - 2016-06-16 23:00 +0200
  Re: [BUG] act_ife: sleeping functions called in atomic context Cong Wang <xiyou.wangcong@gmail.com> - 2016-06-16 23:50 +0200
    Re: [BUG] act_ife: sleeping functions called in atomic context Jamal Hadi Salim <jhs@mojatatu.com> - 2016-06-17 02:40 +0200
      Re: [BUG] act_ife: sleeping functions called in atomic context Cong Wang <xiyou.wangcong@gmail.com> - 2016-06-17 04:20 +0200
        Re: [BUG] act_ife: sleeping functions called in atomic context Cong Wang <xiyou.wangcong@gmail.com> - 2016-06-17 07:40 +0200
          Re: [BUG] act_ife: sleeping functions called in atomic context Alexey Khoroshilov <khoroshilov@ispras.ru> - 2016-06-17 13:10 +0200
            Re: [BUG] act_ife: sleeping functions called in atomic context Cong Wang <xiyou.wangcong@gmail.com> - 2016-06-17 19:20 +0200
          Re: [BUG] act_ife: sleeping functions called in atomic context Jamal Hadi Salim <jhs@mojatatu.com> - 2016-06-17 13:10 +0200
            Re: [BUG] act_ife: sleeping functions called in atomic context Cong Wang <xiyou.wangcong@gmail.com> - 2016-06-17 19:40 +0200
              Re: [BUG] act_ife: sleeping functions called in atomic context Jamal Hadi Salim <jhs@mojatatu.com> - 2016-06-18 16:50 +0200

csiph-web