Re: [Intel-gfx] [RFC 10/12] cgroup/drm: Introduce weight based drm cgroup control

2023-02-02 Thread Tejun Heo
Hello, On Thu, Feb 02, 2023 at 02:26:06PM +, Tvrtko Ursulin wrote: > When you say active/inactive - to what you are referring in the cgroup > world? Offline/online? For those my understanding was offline was a > temporary state while css is getting destroyed. Oh, it's just based on activity.

Re: [Intel-gfx] [RFC 10/12] cgroup/drm: Introduce weight based drm cgroup control

2023-02-02 Thread Tvrtko Ursulin
On 28/01/2023 01:11, Tejun Heo wrote: On Thu, Jan 12, 2023 at 04:56:07PM +, Tvrtko Ursulin wrote: ... + /* +* 1st pass - reset working values and update hierarchical weights and +* GPU utilisation. +*/ + if (!__start_scanning(root, period_us)) +

Re: [Intel-gfx] [RFC 10/12] cgroup/drm: Introduce weight based drm cgroup control

2023-02-02 Thread Michal Koutný
On Thu, Jan 12, 2023 at 04:56:07PM +, Tvrtko Ursulin wrote: > +static int drmcs_can_attach(struct cgroup_taskset *tset) > +{ > + int ret; > + > + /* > + * As processes are getting moved between groups we need to ensure > + * both that the old group does not see a sudden

Re: [Intel-gfx] [RFC 10/12] cgroup/drm: Introduce weight based drm cgroup control

2023-02-02 Thread Michal Koutný
On Fri, Jan 27, 2023 at 01:31:54PM +, Tvrtko Ursulin wrote: > I think you missed the finish_suspend_scanning() part: > > if (root_drmcs.suspended_period_us) > cancel_delayed_work_sync(_drmcs.scan_work); > > So if scanning was in progress migration will wait until it

Re: [Intel-gfx] [RFC 10/12] cgroup/drm: Introduce weight based drm cgroup control

2023-01-27 Thread Tejun Heo
On Thu, Jan 12, 2023 at 04:56:07PM +, Tvrtko Ursulin wrote: ... > + /* > + * 1st pass - reset working values and update hierarchical weights and > + * GPU utilisation. > + */ > + if (!__start_scanning(root, period_us)) > + goto out_retry; /* > +

Re: [Intel-gfx] [RFC 10/12] cgroup/drm: Introduce weight based drm cgroup control

2023-01-27 Thread Tvrtko Ursulin
On 27/01/2023 14:11, Michal Koutný wrote: On Fri, Jan 27, 2023 at 01:31:54PM +, Tvrtko Ursulin wrote: I think you missed the finish_suspend_scanning() part: if (root_drmcs.suspended_period_us) cancel_delayed_work_sync(_drmcs.scan_work); So if scanning was in

Re: [Intel-gfx] [RFC 10/12] cgroup/drm: Introduce weight based drm cgroup control

2023-01-27 Thread Tvrtko Ursulin
On 27/01/2023 13:01, Michal Koutný wrote: On Thu, Jan 12, 2023 at 04:56:07PM +, Tvrtko Ursulin wrote: +static int drmcs_can_attach(struct cgroup_taskset *tset) +{ + int ret; + + /* +* As processes are getting moved between groups we need to ensure +* both

[Intel-gfx] [RFC 10/12] cgroup/drm: Introduce weight based drm cgroup control

2023-01-12 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Similar to CPU scheduling, implement a concept of weight in the drm cgroup controller. Uses the same range and default as the CPU controller - CGROUP_WEIGHT_MIN, CGROUP_WEIGHT_DFL and CGROUP_WEIGHT_MAX. Later each cgroup is assigned a time budget proportionaly based on the