From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbdHaTLN (ORCPT ); Thu, 31 Aug 2017 15:11:13 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:34636 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbdHaTLL (ORCPT ); Thu, 31 Aug 2017 15:11:11 -0400 Date: Thu, 31 Aug 2017 21:11:08 +0200 (CEST) From: Thomas Gleixner To: Mike Galbraith cc: Sebastian Andrzej Siewior , LKML , linux-rt-users , Steven Rostedt , Peter Zijlstra Subject: Re: [patch-rt] drivers/zram: fix zcomp_stream_get() smp_processor_id() use in preemptible code In-Reply-To: <1503482249.4970.7.camel@gmx.de> Message-ID: References: <20170818120939.b2rj2whb2hgfzjpm@linutronix.de> <1503482249.4970.7.camel@gmx.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Aug 2017, Mike Galbraith wrote: > > Use get_local_ptr() vs this_cpu_ptr(). > > Signed-off-by: Mike Galbraith > --- > 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