Thread (10 messages) flat view 10 messages, 3 authors, 2016-06-18

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

From: Cong Wang <hidden>
Date: 2016-06-16 21:44:11
Also in: lkml

On Thu, Jun 16, 2016 at 1:50 PM, Alexey Khoroshilov
[off-list ref] 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.
      -> 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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help