[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200522151705.vwfua5a4lhzcagea@linutronix.de>
Date: Fri, 22 May 2020 17:17:05 +0200
From: "Sebastian A. Siewior" <bigeasy@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: "Ahmed S. Darwish" <a.darwish@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E. McKenney" <paulmck@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
linux-mm@...ck.org
Subject: Re: [PATCH v1 02/25] mm/swap: Don't abuse the seqcount latching API
On 2020-05-22 16:57:07 [+0200], Peter Zijlstra wrote:
> > @@ -725,21 +735,48 @@ void lru_add_drain_all(void)
> > if (WARN_ON(!mm_percpu_wq))
> > return;
> >
>
> > + this_gen = READ_ONCE(lru_drain_gen);
> > + smp_rmb();
>
> this_gen = smp_load_acquire(&lru_drain_gen);
> >
> > mutex_lock(&lock);
> >
> > /*
> > + * (C) Exit the draining operation if a newer generation, from another
> > + * lru_add_drain_all(), was already scheduled for draining. Check (A).
> > */
> > + if (unlikely(this_gen != lru_drain_gen))
> > goto done;
> >
>
> > + WRITE_ONCE(lru_drain_gen, lru_drain_gen + 1);
> > + smp_wmb();
>
> You can leave this smp_wmb() out and rely on the smp_mb() implied by
> queue_work_on()'s test_and_set_bit().
This is to avoid smp_store_release() ?
Sebastian
Powered by blists - more mailing lists