From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751672AbdIAHk1 (ORCPT ); Fri, 1 Sep 2017 03:40:27 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:35935 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751567AbdIAHk0 (ORCPT ); Fri, 1 Sep 2017 03:40:26 -0400 Date: Fri, 1 Sep 2017 09:40:23 +0200 From: Sebastian Andrzej Siewior To: Thomas Gleixner Cc: Mike Galbraith , 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 Message-ID: <20170901074023.2ctuzw3ohlnlmtid@linutronix.de> References: <20170818120939.b2rj2whb2hgfzjpm@linutronix.de> <1503482249.4970.7.camel@gmx.de> <20170831192637.ffzw2km3zfiafx7s@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-08-31 21:32:30 [+0200], Thomas Gleixner wrote: > > zram_lock_table() is bit_spin_lock() on !RT and spin_lock(&table->lock); > > on RT. So this is done. > > !RT has this running in a kmap_atomic() section so they have no > > preemption there. > > zcomp_stream_get() returns a per-CPU object which is protected with a > > spinlock and only accessed locked. > > So when we are inside a spinlocked section, why is this_cpu_ptr() not > working? That does not make sense. zram_decompress_page() invokes zcomp_stream_get() within a spin_lock section (zram_lock_table()). This is fine. zram_bvec_write() does not invoke zcomp_stream_get() within a spin_lock section. > Thanks, > > tglx Sebastian