[lkml]   [2012]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: deferring __fput()
    On 06/23, Al Viro wrote:
    > BTW, I really wonder why do we need to have that void *data in task_work; we can
    > always embed the sucker into a bigger struct (if nothing else, task_work +
    > void *data) and get to it via container_of(). And in quite a few cases we don't
    > want that data thing at all.

    Yes, it is not strictly needed. From the changelog:

    "struct task_work" can be embedded in another struct, still it has "void
    *data" to handle the most common/simple case.

    Namely, for keyctl_session_to_parent(). Probably it has ->data just because
    I failed to invent the good name for the struct with task_work + cred.

    > Moreover, the reasons to use hlist_head instead of
    > a single forward pointer are very thin on the ground:

    Oh, yes, there is no any reason. Except the code looks a bit simpler.

    > Oleg, do you see any reasons why trimming it down to forward pointer + callback
    > pointer wouldn't work?

    OK. will do.

    > Matter of fact, it would become identical to struct rcu_head
    > after that...

    This is not clear to me... Why this is good?

    I understand that sizeof(task_work) == sizeof(rcu_head) would be
    nice, probably you meant just this?


     \ /
      Last update: 2012-06-23 23:21    [W:0.022 / U:10.652 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site