Re: [PATCH 2/6] mm/swap: Introduce alternative per-cpu LRU cache locking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux