Re: deferring __fput()

From: Oleg Nesterov
Date: Sat Jun 23 2012 - 16:40:58 EST


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?

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/