lkml.org 
[lkml]   [2020]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@linutronix.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

\
 
 \ /
  Last update: 2020-05-25 18:52    [W:0.057 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site