[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y0rNSMg+KmVnZ1oe@hirez.programming.kicks-ass.net>
Date: Sat, 15 Oct 2022 17:10:00 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Connor O'Brien <connoro@...gle.com>
Cc: linux-kernel@...r.kernel.org, kernel-team@...roid.com,
John Stultz <jstultz@...gle.com>,
Joel Fernandes <joelaf@...gle.com>,
Qais Yousef <qais.yousef@....com>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Valentin Schneider <vschneid@...hat.com>,
Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>,
"Paul E . McKenney" <paulmck@...nel.org>
Subject: Re: [RFC PATCH 07/11] sched: Add proxy execution
On Mon, Oct 03, 2022 at 09:44:57PM +0000, Connor O'Brien wrote:
> @@ -703,15 +707,28 @@ __mutex_lock_common(struct mutex *lock, unsigned int state, unsigned int subclas
> break;
>
> if (first) {
> + bool acquired;
> +
> + /*
> + * XXX connoro: mutex_optimistic_spin() can schedule, so
I'm thinking it might be better to remove that schedule point for
PROXY_EXEC instead of doing this.
Getting preempted right after acquiring a lock is less of a problem with
PE on than it is without it.
> + * we need to release these locks before calling it.
> + * This needs refactoring though b/c currently we take
> + * the locks earlier than necessary when proxy exec is
> + * disabled and release them unnecessarily when it's
> + * enabled. At a minimum, need to verify that releasing
> + * blocked_lock here doesn't create any races.
> + */
> + raw_spin_unlock(¤t->blocked_lock);
> + raw_spin_unlock_irqrestore(&lock->wait_lock, flags);
> trace_contention_begin(lock, LCB_F_MUTEX | LCB_F_SPIN);
> - if (mutex_optimistic_spin(lock, ww_ctx, &waiter))
> + acquired = mutex_optimistic_spin(lock, ww_ctx, &waiter);
> + raw_spin_lock_irqsave(&lock->wait_lock, flags);
> + raw_spin_lock(¤t->blocked_lock);
> + if (acquired)
> break;
> trace_contention_begin(lock, LCB_F_MUTEX);
> }
Powered by blists - more mailing lists