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]
Message-ID: <1299048447.11469.22.camel@marge.simson.net>
Date:	Wed, 02 Mar 2011 07:47:27 +0100
From:	Mike Galbraith <efault@....de>
To:	Paul Turner <pjt@...gle.com>
Cc:	Venkatesh Pallipadi <venki@...gle.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH] sched: next buddy hint on sleep and preempt path

On Tue, 2011-03-01 at 21:43 -0800, Paul Turner wrote:
> On Tue, Mar 1, 2011 at 3:33 PM, Venkatesh Pallipadi <venki@...gle.com> wrote:

> >        for_each_sched_entity(se) {
> >                cfs_rq = cfs_rq_of(se);
> >                dequeue_entity(cfs_rq, se, flags);
> >
> >                /* Don't dequeue parent if it has other entities besides us */
> > -               if (cfs_rq->load.weight)
> > +               if (cfs_rq->load.weight) {
> > +                       /*
> > +                        * Bias pick_next to pick a task from this cfs_rq, as
> > +                        * p is sleeping when it is within its sched_slice.
> > +                        */
> > +                       if (task_flags & DEQUEUE_SLEEP && se->parent)
> > +                               set_next_buddy(se->parent);
> 
> re-using the last_buddy would seem like a more natural fit here; also
> doesn't have a clobber race with a wakeup

Hm, that would break last_buddy no?  A preempted task won't get the CPU
back after light preempting thread deactivates.  (it's disabled atm
unless heavily overloaded anyway, but..) 

This wants a tweak either way though.

static inline struct task_struct *task_of(struct sched_entity *se)
{
#ifdef CONFIG_SCHED_DEBUG
        WARN_ON_ONCE(!entity_is_task(se));
#endif
        return container_of(se, struct task_struct, se);
}

static void set_next_buddy(struct sched_entity *se)
{
        if (likely(task_of(se)->policy != SCHED_IDLE)) {
                for_each_sched_entity(se)
                        cfs_rq_of(se)->next = se;
        }
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ