[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210921220358.GN4323@worktop.programming.kicks-ass.net>
Date: Wed, 22 Sep 2021 00:03:58 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Nicolas Saenz Julienne <nsaenzju@...hat.com>
Cc: akpm@...ux-foundation.org, frederic@...nel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
tglx@...utronix.de, cl@...ux.com, juri.lelli@...hat.com,
mingo@...hat.com, mtosatti@...hat.com, nilal@...hat.com,
mgorman@...e.de, ppandit@...hat.com, williams@...hat.com,
bigeasy@...utronix.de, anna-maria@...utronix.de,
linux-rt-users@...r.kernel.org
Subject: Re: [PATCH 2/6] mm/swap: Introduce alternative per-cpu LRU cache
locking
On Tue, Sep 21, 2021 at 06:13:20PM +0200, Nicolas Saenz Julienne wrote:
> +static inline void lru_cache_lock(struct lru_cache_locks *locks)
> +{
> + if (static_branch_unlikely(&remote_pcpu_cache_access)) {
> + /* Avoid migration between this_cpu_ptr() and spin_lock() */
> + migrate_disable();
> + spin_lock(this_cpu_ptr(&locks->spin));
> + } else {
> + local_lock(&locks->local);
> + }
> +}
> +static inline void lru_cache_unlock(struct lru_cache_locks *locks)
> +{
> + if (static_branch_unlikely(&remote_pcpu_cache_access)) {
> + spin_unlock(this_cpu_ptr(&locks->spin));
> + migrate_enable();
> + } else {
> + local_unlock(&locks->local);
> + }
> +}
*why* use migrate_disable(), that's horrible!
Powered by blists - more mailing lists