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: <20160926152639.GF5016@twins.programming.kicks-ass.net>
Date:   Mon, 26 Sep 2016 17:26:39 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     mingo@...nel.org, tglx@...utronix.de, juri.lelli@....com,
        xlpang@...hat.com, bigeasy@...utronix.de,
        linux-kernel@...r.kernel.org, mathieu.desnoyers@...icios.com,
        jdesfossez@...icios.com, bristot@...hat.com,
        Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH -v2 2/9] sched/rtmutex/deadline: Fix a PI crash for
 deadline tasks

On Mon, Sep 26, 2016 at 11:20:58AM -0400, Steven Rostedt wrote:
> > --- a/kernel/locking/rtmutex.c
> > +++ b/kernel/locking/rtmutex.c
> > @@ -256,6 +256,16 @@ rt_mutex_dequeue_pi(struct task_struct *
> >  	RB_CLEAR_NODE(&waiter->pi_tree_entry);
> >  }
> >  
> 
> Shouldn't we add a comment about what locks are expected to be held
> when calling this? Especially if it can be called outside this file.

Comments are somewhat useless.. I would like to do the below, except I
cannot.

> > +void rt_mutex_update_top_task(struct task_struct *p)
> > +{

	lockdep_assert_held(&p->pi_lock);
	lockdep_assert_held(&task_rq(p)->lock); // except that we cannot access rq :/

> > +	if (!task_has_pi_waiters(p)) {
> > +		p->pi_top_task = NULL;
> > +		return;
> > +	}
> > +
> > +	p->pi_top_task = task_top_pi_waiter(p)->task;
> > +}
> > +
> >  /*
> >   * Calculate task priority from the waiter tree priority
> >   *
> > @@ -273,10 +283,7 @@ int rt_mutex_getprio(struct task_struct
> >  
> 
> Any specific locks that must be held when calling this?

#ifdef CONFIG_LOCKDEP
	WARN_ON_ONCE(debug_locks &&
		!lock_is_held(&p->pi_lock) &&
		!lock_is_held(&task_rq(p)->lock)); // again, cannot do this :/
#endif

> >  struct task_struct *rt_mutex_get_top_task(struct task_struct *task)
> >  {
> > -	if (likely(!task_has_pi_waiters(task)))
> > -		return NULL;
> > -
> > -	return task_top_pi_waiter(task)->task;
> > +	return task->pi_top_task;
> >  }
> 
> -- Steve
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ