Re: [RFD] CAT user space interface revisited

From: Marcelo Tosatti
Date: Wed Nov 25 2015 - 17:02:42 EST


On Tue, Nov 24, 2015 at 03:31:24PM +0800, Chao Peng wrote:
> On Wed, Nov 18, 2015 at 07:25:03PM +0100, Thomas Gleixner wrote:
> >
> > Let's look at partitioning itself. We have two options:
> >
> > 1) Per task partitioning
> >
> > 2) Per CPU partitioning
> >
> > So far we only talked about #1, but I think that #2 has a value as
> > well. Let me give you a simple example.
>
> I would second this. In practice per CPU partitioning is useful for
> realtime as well. And I can see three possible solutions:
>
> 1) What you suggested below, to address both problems in one
> framework. But I wonder if it would end with too complex.
>
> 2) Achieve per CPU partitioning with per task partitioning. For
> example, if current CAT patch can solve the kernel threads
> problem, together with CPU pinning, we then can set a same CBM
> for all the tasks/kernel threads run on an isolated CPU.

As for the kernel threads problem, it seems its a silly limitation of
the code which handles writes to cgroups:

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f89d929..0603652 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2466,16 +2466,6 @@ static ssize_t __cgroup_procs_write(struct
kernfs_open_file *of, char *buf,
if (threadgroup)
tsk = tsk->group_leader;

- /*
- * Workqueue threads may acquire PF_NO_SETAFFINITY and become
- * trapped in a cpuset, or RT worker may be born in a cgroup
- * with no rt_runtime allocated. Just say no.
- */
- if (tsk == kthreadd_task || (tsk->flags & PF_NO_SETAFFINITY)) {
- ret = -EINVAL;
- goto out_unlock_rcu;
- }
-
get_task_struct(tsk);
rcu_read_unlock();

For a cgroup hierarchy with no cpusets (such as CAT only) this
limitation makes no sense (looking for a place where to move this to).

Any ETA on per-socket bitmasks?

>
> 3) I wonder if it feasible to separate the two requirements? For
> example, divides the work into three components: rdt-base,
> per task interface (current cgroup interface/IOCTL or something)
> and per CPU interface. The two interfaces are exclusive and
> selected at build time. One thing to reject this option would be
> even with per CPU partitioning, we still need per task partitioning,
> in that case we will go to option 1) again.
>
> Thanks,
> Chao
--
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/