Re: [PATCH v2] make dm and dm-crypt forward cgroup context (was:dm-crypt parallelization patches)

From: Tejun Heo
Date: Fri Apr 12 2013 - 14:29:51 EST

On Fri, Apr 12, 2013 at 02:01:08PM -0400, Mikulas Patocka wrote:
> So if you think that reference counts should be incremented by every clone
> of the original bio, what kind of bug should it protect against? If we
> don't increment reference counts for pages, why should we do it for cgroup
> pointers?

These things are called trade-offs. You look at the overhead of the
things and how complex / fragile things get when certain shortcuts are
taken and how well contained and easy to verify / debug when things go
wrong and then make your choice.

Do the two really look the same to you? The page refs are much more
expensive, mostly contained in and the main focus of dm. ioc/css refs
aren't that expensive to begin with, css refcnting is widely scattered
across the kernel, the association interface is likely to be used by
any entity issuing IOs asynchronously soonish, and there is much saner
way to improve it - which would be beneficial not only to block / dm
but everyone else using it.

Something being done in one place doesn't automatically make it okay
everywhere else. We can and do use hackery but *with* discretion.

If you still can't understand, I'm not sure what more I can tell you.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at