[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200617112600.GH2531@hirez.programming.kicks-ass.net>
Date: Wed, 17 Jun 2020 13:26:00 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: John Ogness <john.ogness@...utronix.de>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Thomas Gleixner <tglx@...utronix.de>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 1/1] fs/namespace.c: use spinlock instead of busy loop
On Wed, Jun 17, 2020 at 12:46:58PM +0206, John Ogness wrote:
> @@ -459,17 +469,39 @@ void mnt_drop_write_file(struct file *file)
> }
> EXPORT_SYMBOL(mnt_drop_write_file);
>
> +static void mnt_lock_writers(struct mount *mnt)
> +{
> +#ifdef CONFIG_SMP
> + int cpu;
> +
> + for_each_possible_cpu(cpu) {
> + spin_lock(&per_cpu_ptr(mnt->mnt_pcp,
> + cpu)->mnt_writers_lock);
> + }
> +#else
> + spin_lock(&mnt->mnt_writers_lock);
> +#endif
> +}
> +
> +static void mnt_unlock_writers(struct mount *mnt)
> +{
> +#ifdef CONFIG_SMP
> + int cpu;
> +
> + for_each_possible_cpu(cpu) {
> + spin_unlock(&per_cpu_ptr(mnt->mnt_pcp,
> + cpu)->mnt_writers_lock);
> + }
> +#else
> + spin_unlock(&mnt->mnt_writers_lock);
> +#endif
> +}
*groan*.. this is brlock reincarnate :-/ Also broken.
Powered by blists - more mailing lists