[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110824074959.GA14170@htj.dyndns.org>
Date: Wed, 24 Aug 2011 09:49:59 +0200
From: Tejun Heo <tj@...nel.org>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: rjw@...k.pl, paul@...lmenage.org, lizf@...fujitsu.com,
linux-pm@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
containers@...ts.linux-foundation.org
Subject: Re: [PATCHSET] cgroup: introduce cgroup_taskset and consolidate
subsys methods
Hello, Frederic.
On Wed, Aug 24, 2011 at 03:14:30AM +0200, Frederic Weisbecker wrote:
> > 0001-cgroup-subsys-attach_task-should-be-called-after-mig.patch
> > 0002-cgroup-improve-old-cgroup-handling-in-cgroup_attach_.patch
> > 0003-cgroup-introduce-cgroup_taskset-and-use-it-in-subsys.patch
> > 0004-cgroup-don-t-use-subsys-can_attach_task-or-attach_ta.patch
> > 0005-cgroup-cpuset-don-t-use-ss-pre_attach.patch
> > 0006-cgroup-kill-subsys-can_attach_task-pre_attach-and-at.patch
>
> I don't understand the point on patches 3,4,5,6
>
> Why pushing the task iterations down to the subsystems?
I'll try again.
It seems like methods were added to serve the immediate need of the
particular user at the time and that in turn led to addition of
callbacks which were both superflous and incomplete (the bullet points
in the original message list them). This seems to have happened
because extra interface was added without trying to make the existing
interface complete.
The interface is complicated and cumbersome to use - are
[can_]attach() called first or [can_]attach_task()? What about
cancelation? What if a subsys wants to perform operations across
multiple tasks atomically?
In general, iteration-by-callback is painful to use. Establishing
common context (be it synchronization domain or shared variables)
becomes very cumbersome and implementation becomes fragmented and
difficult to follow. For example, imagine how it would be like to use
list if we had call_for_each_list_entry(func, list_head) instead of
the control-loop style iterators we have know.
So, using iterators enables making all relevant information to each
stage of attach so that only one callback is required for each step -
the way it should be. In addition, it makes it far easier for
subsystems to implement more involved logic in their methods.
I tried to make cgroup_freezer behave better which requires better
synchronization against the freezer and, with the current interface,
it's extremely ugly and painful. The new interface is complete, easy
to understand and use with far less subtleties.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists