[RFC,0/2] sched/cpuset: Fix DL BW accounting in case can_attach() fails

Message ID 20230322135959.1998790-1-dietmar.eggemann@arm.com
Headers
Series sched/cpuset: Fix DL BW accounting in case can_attach() fails |

Message

Dietmar Eggemann March 22, 2023, 1:59 p.m. UTC
  I followed Longman's idea to add a `deadline task transfer count` into
cpuset and only update the `dl task count` in cpuset_attach().

Moreover, I switched from per-task DL BW request to a per-cpuset one.
This way we don't have to free per-task in case xxx_can_attach() fails.

The DL BW freeing is handled in cpuset_cancel_attach() for the case
`multiple controllers and one of the non-cpuset can_attach() fails`.

Only lightly tested on cgroup v1 with exclusive cpusets so far.

Dietmar Eggemann (2):
  sched/deadline: Create DL BW alloc, free & check overflow interface
  cgroup/cpuset: Free DL BW in case can_attach() fails

 include/linux/sched.h   |  4 ++-
 kernel/cgroup/cpuset.c  | 55 +++++++++++++++++++++++++++++++++++++----
 kernel/sched/core.c     | 19 +++-----------
 kernel/sched/deadline.c | 53 +++++++++++++++++++++++++++++----------
 kernel/sched/sched.h    |  2 +-
 5 files changed, 97 insertions(+), 36 deletions(-)
  

Comments

Juri Lelli March 23, 2023, 9:33 a.m. UTC | #1
Hi,

On 22/03/23 14:59, Dietmar Eggemann wrote:
> I followed Longman's idea to add a `deadline task transfer count` into
> cpuset and only update the `dl task count` in cpuset_attach().
> 
> Moreover, I switched from per-task DL BW request to a per-cpuset one.
> This way we don't have to free per-task in case xxx_can_attach() fails.
> 
> The DL BW freeing is handled in cpuset_cancel_attach() for the case
> `multiple controllers and one of the non-cpuset can_attach() fails`.
> 
> Only lightly tested on cgroup v1 with exclusive cpusets so far.

This makes sense to me. Thanks for working on it!

Guess I might incorporate these in my (RFC) series and re-post the whole
lot?

Best,
Juri
  
Dietmar Eggemann March 24, 2023, 2:56 p.m. UTC | #2
On 23/03/2023 10:33, Juri Lelli wrote:
> Hi,
> 
> On 22/03/23 14:59, Dietmar Eggemann wrote:

[...]

> This makes sense to me. Thanks for working on it!
> 
> Guess I might incorporate these in my (RFC) series and re-post the whole
> lot?

Yes, please do so.