[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200525165140.r2gkn6avembdaonh@linutronix.de>
Date: Mon, 25 May 2020 18:51:40 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Will Deacon <will@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E . McKenney" <paulmck@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Matthew Wilcox <willy@...radead.org>,
Mike Galbraith <umgwanakikbuti@...il.com>,
Minchan Kim <minchan@...nel.org>,
Nitin Gupta <ngupta@...are.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Subject: Re: [PATCH v2 7/7] zram: Use local lock to protect per-CPU data
On 2020-05-25 09:26:48 [+0200], Ingo Molnar wrote:
>
> * Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:
>
> > --- a/drivers/block/zram/zcomp.h
> > +++ b/drivers/block/zram/zcomp.h
> > @@ -5,11 +5,13 @@
> >
> > #ifndef _ZCOMP_H_
> > #define _ZCOMP_H_
> > +#include <linux/locallock.h>
> >
> > struct zcomp_strm {
> > /* compression/decompression buffer */
> > void *buffer;
> > struct crypto_comp *tfm;
> > + struct local_lock lock;
> > };
>
> I believe the general pattern is to put the lock in front of the
> fields it protects.
>
> I'd also add a comment documenting that both fields ->buffer and ->tfm
> are protected by the lock.
I moved the member, and added a comment.
> Thanks,
>
> Ingo
Sebastian
Powered by blists - more mailing lists