lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 12 Dec 2019 11:23:27 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Dave Chinner <david@...morbit.com>
Cc:     Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
        Phil Auld <pauld@...hat.com>, Ming Lei <ming.lei@...hat.com>,
        linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jeff Moyer <jmoyer@...hat.com>,
        Dave Chinner <dchinner@...hat.com>,
        Eric Sandeen <sandeen@...hat.com>,
        Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
        Ingo Molnar <mingo@...hat.com>, Tejun Heo <tj@...nel.org>,
        Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH v4] sched/core: Preempt current task in favour of bound
 kthread

On Thu, Dec 12, 2019 at 11:14:24AM +0100, Peter Zijlstra wrote:
> On Thu, Dec 12, 2019 at 11:10:31AM +0100, Peter Zijlstra wrote:
> > @@ -4156,13 +4159,13 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
> >  	if (delta_exec < sysctl_sched_min_granularity)
> >  		return;
> >  
> > -	se = __pick_first_entity(cfs_rq);
> > +	se = __pick_next_entity(cfs_rq, NULL);
> >  	delta = curr->vruntime - se->vruntime;
> >  
> >  	if (delta < 0)
> >  		return;
> 
> What I mean with the below comment is, when this isn't enough, try
> something like:
> 
> 	if (se == cfs_rq->next)
> 		ideal_runtime /= 2;
> 
> to make it yield sooner to 'next' buddies. Sadly, due to the whole
> cgroup mess, we can't say what actual task is on the end of it (without
> doing a full hierarchy pick, which is more expensive still).

Just for giggles, that'd look something like:

	while (!entity_is_task(se) {
		cfs_rq = group_cfs_rq(se);
		se = pick_next_entity(cfs_rq, cfs_rq->curr);
	}
	p = task_of(se);

	if (is_per_cpu_kthread(p))
		ideal_runtime /= 2;

the core-scheduling patch set includes the right primitive for this I
think, pick_task_fair().

> > -	if (delta > ideal_runtime)
> > +	if (delta > ideal_runtime) // maybe frob this too ?
> >  		resched_curr(rq_of(cfs_rq));
> >  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ