lkml.org 
[lkml]   [2017]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch-rt] drivers/zram: fix zcomp_stream_get() smp_processor_id() use in preemptible code
On Wed, 23 Aug 2017, Mike Galbraith wrote:

>
> Use get_local_ptr() vs this_cpu_ptr().
>
> Signed-off-by: Mike Galbraith <efault@gmx.de>
> ---
> drivers/block/zram/zcomp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- a/drivers/block/zram/zcomp.c
> +++ b/drivers/block/zram/zcomp.c
> @@ -120,7 +120,7 @@ struct zcomp_strm *zcomp_stream_get(stru
> {
> struct zcomp_strm *zstrm;
>
> - zstrm = *this_cpu_ptr(comp->stream);
> + zstrm = *get_local_ptr(comp->stream);

This looks wrong. On mainline the calling code must have preemption disable
somehow, otherwise this_cpu_ptr() would not work.

Looking at the call site it is;

zram_slot_lock()
bit_spin_lock()

which is of course evading lockdep and everything else debugging wise.

Sebastian, do we have migration protection in bitlocked regions? And we
shpuld look into converting that into a spinlock on rt.

Thanks,

tglx

\
 
 \ /
  Last update: 2017-08-31 21:12    [W:0.113 / U:1.124 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site