Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-22 Thread Vineeth Remanan Pillai
> > I do not have a strong opinion on both. Probably a better approach > > would be to replace both cpu_prio_less/core_prio_less with prio_less > > which takes the third arguement 'bool on_same_rq'? > > > > Fwiw, I find the two names easier to read than a boolean flag. Could still > be wrapped to

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-10 Thread Peter Zijlstra
On Mon, Apr 29, 2019 at 11:36:22AM +0800, Aaron Lu wrote: > On Tue, Apr 23, 2019 at 04:18:16PM +, Vineeth Remanan Pillai wrote: > > +/* > > + * l(a,b) > > + * le(a,b) := !l(b,a) > > + * g(a,b) := l(b,a) > > + * ge(a,b) := !l(a,b) > > + */ > > + > > +/* real prio, less is less */ > > +static

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-09 Thread Tim Chen
On 5/9/19 10:50 AM, Subhra Mazumdar wrote: > >>> select_task_rq_* seems to be unchanged. So the search logic to find a cpu >>> to enqueue when a task becomes runnable is same as before and doesn't do >>> any kind of cookie matching. >> Okay, that's true in task wakeup path, and also load_balance

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-09 Thread Subhra Mazumdar
select_task_rq_* seems to be unchanged. So the search logic to find a cpu to enqueue when a task becomes runnable is same as before and doesn't do any kind of cookie matching. Okay, that's true in task wakeup path, and also load_balance seems to pull task without checking cookie too. But my

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-09 Thread Aubrey Li
On Thu, May 9, 2019 at 10:14 AM Subhra Mazumdar wrote: > > > On 5/8/19 6:38 PM, Aubrey Li wrote: > > On Thu, May 9, 2019 at 8:29 AM Subhra Mazumdar > > wrote: > >> > >> On 5/8/19 5:01 PM, Aubrey Li wrote: > >>> On Thu, May 9, 2019 at 2:41 AM Subhra Mazumdar > >>> wrote: > On 5/8/19 11:19

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-08 Thread Subhra Mazumdar
On 5/8/19 6:38 PM, Aubrey Li wrote: On Thu, May 9, 2019 at 8:29 AM Subhra Mazumdar wrote: On 5/8/19 5:01 PM, Aubrey Li wrote: On Thu, May 9, 2019 at 2:41 AM Subhra Mazumdar wrote: On 5/8/19 11:19 AM, Subhra Mazumdar wrote: On 5/8/19 8:49 AM, Aubrey Li wrote: Pawan ran an experiment

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-08 Thread Aubrey Li
On Thu, May 9, 2019 at 8:29 AM Subhra Mazumdar wrote: > > > On 5/8/19 5:01 PM, Aubrey Li wrote: > > On Thu, May 9, 2019 at 2:41 AM Subhra Mazumdar > > wrote: > >> > >> On 5/8/19 11:19 AM, Subhra Mazumdar wrote: > >>> On 5/8/19 8:49 AM, Aubrey Li wrote: > > Pawan ran an experiment setting up

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-08 Thread Subhra Mazumdar
On 5/8/19 5:01 PM, Aubrey Li wrote: On Thu, May 9, 2019 at 2:41 AM Subhra Mazumdar wrote: On 5/8/19 11:19 AM, Subhra Mazumdar wrote: On 5/8/19 8:49 AM, Aubrey Li wrote: Pawan ran an experiment setting up 2 VMs, with one VM doing a parallel kernel build and one VM doing sysbench, limiting

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-08 Thread Aubrey Li
On Thu, May 9, 2019 at 2:41 AM Subhra Mazumdar wrote: > > > On 5/8/19 11:19 AM, Subhra Mazumdar wrote: > > > > On 5/8/19 8:49 AM, Aubrey Li wrote: > >>> Pawan ran an experiment setting up 2 VMs, with one VM doing a > >>> parallel kernel build and one VM doing sysbench, > >>> limiting both VMs to

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-08 Thread Subhra Mazumdar
On 5/8/19 11:19 AM, Subhra Mazumdar wrote: On 5/8/19 8:49 AM, Aubrey Li wrote: Pawan ran an experiment setting up 2 VMs, with one VM doing a parallel kernel build and one VM doing sysbench, limiting both VMs to run on 16 cpu threads (8 physical cores), with 8 vcpu for each VM. Making the

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-08 Thread Subhra Mazumdar
On 5/8/19 8:49 AM, Aubrey Li wrote: Pawan ran an experiment setting up 2 VMs, with one VM doing a parallel kernel build and one VM doing sysbench, limiting both VMs to run on 16 cpu threads (8 physical cores), with 8 vcpu for each VM. Making the fix did improve kernel build time by 7%. I'm

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-08 Thread Aubrey Li
On Fri, May 3, 2019 at 8:06 AM Tim Chen wrote: > > On 5/1/19 4:27 PM, Tim Chen wrote: > > On 4/28/19 11:15 PM, Aaron Lu wrote: > >> On Tue, Apr 23, 2019 at 04:18:16PM +, Vineeth Remanan Pillai wrote: > >>> +/* > >>> + * Find left-most (aka, highest priority) task matching @cookie. > >>> + */

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-02 Thread Tim Chen
On 5/1/19 4:27 PM, Tim Chen wrote: > On 4/28/19 11:15 PM, Aaron Lu wrote: >> On Tue, Apr 23, 2019 at 04:18:16PM +, Vineeth Remanan Pillai wrote: >>> +/* >>> + * Find left-most (aka, highest priority) task matching @cookie. >>> + */ >>> +struct task_struct *sched_core_find(struct rq *rq,

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-05-01 Thread Tim Chen
On 4/28/19 11:15 PM, Aaron Lu wrote: > On Tue, Apr 23, 2019 at 04:18:16PM +, Vineeth Remanan Pillai wrote: >> +/* >> + * Find left-most (aka, highest priority) task matching @cookie. >> + */ >> +struct task_struct *sched_core_find(struct rq *rq, unsigned long cookie) >> +{ >> +struct

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-04-29 Thread Aaron Lu
On Tue, Apr 23, 2019 at 04:18:16PM +, Vineeth Remanan Pillai wrote: > +/* > + * Find left-most (aka, highest priority) task matching @cookie. > + */ > +struct task_struct *sched_core_find(struct rq *rq, unsigned long cookie) > +{ > + struct rb_node *node = rq->core_tree.rb_node; > +

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-04-28 Thread Aaron Lu
On Tue, Apr 23, 2019 at 04:18:16PM +, Vineeth Remanan Pillai wrote: > +/* > + * l(a,b) > + * le(a,b) := !l(b,a) > + * g(a,b) := l(b,a) > + * ge(a,b) := !l(a,b) > + */ > + > +/* real prio, less is less */ > +static inline bool __prio_less(struct task_struct *a, struct task_struct *b, > bool

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-04-25 Thread Phil Auld
On Wed, Apr 24, 2019 at 08:43:36PM + Vineeth Remanan Pillai wrote: > > A minor nitpick. I find keeping the vruntime base readjustment in > > core_prio_less probably is more straight forward rather than pass a > > core_cmp bool around. > > The reason I moved the vruntime base adjustment to

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-04-24 Thread Tim Chen
On 4/24/19 1:43 PM, Vineeth Remanan Pillai wrote: >> A minor nitpick. I find keeping the vruntime base readjustment in >> core_prio_less probably is more straight forward rather than pass a >> core_cmp bool around. > > The reason I moved the vruntime base adjustment to __prio_less is > because,

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-04-24 Thread Vineeth Remanan Pillai
> The sched_core_* functions are used only in the core.c > they are declared in. We can convert them to static functions. Thanks for pointing this out, will accomodate this in v3. Thanks

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-04-24 Thread Vineeth Remanan Pillai
> A minor nitpick. I find keeping the vruntime base readjustment in > core_prio_less probably is more straight forward rather than pass a > core_cmp bool around. The reason I moved the vruntime base adjustment to __prio_less is because, the vruntime seemed alien to __prio_less when looked as a

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-04-23 Thread Tim Chen
> + > +void sched_core_enqueue(struct rq *rq, struct task_struct *p) > +{ ... > +} > + > +void sched_core_dequeue(struct rq *rq, struct task_struct *p) > +{ ... > +} > + > +/* > + * Find left-most (aka, highest priority) task matching @cookie. > + */ > +struct task_struct

Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-04-23 Thread Tim Chen
On 4/23/19 9:18 AM, Vineeth Remanan Pillai wrote: > +/* real prio, less is less */ > +static inline bool __prio_less(struct task_struct *a, struct task_struct *b, > bool core_cmp) > +{ > + u64 vruntime; > + > + int pa = __task_prio(a), pb = __task_prio(b); > + > + if (-pa < -pb) > +

[RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

2019-04-23 Thread Vineeth Remanan Pillai
From: Peter Zijlstra (Intel) Introduce task_struct::core_cookie as an opaque identifier for core scheduling. When enabled; core scheduling will only allow matching task to be on the core; where idle matches everything. When task_struct::core_cookie is set (and core scheduling is enabled) these