Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757672AbcJQOYk (ORCPT ); Mon, 17 Oct 2016 10:24:40 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:37331 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755064AbcJQOYb (ORCPT ); Mon, 17 Oct 2016 10:24:31 -0400 Date: Mon, 17 Oct 2016 16:24:28 +0200 From: Sebastian Andrzej Siewior To: Mike Galbraith Cc: Thomas Gleixner , LKML , linux-rt-users , Steven Rostedt Subject: Re: [patch] drivers/zram: Don't disable preemption in zcomp_stream_get/put() Message-ID: <20161017142428.25dyxefk2arjeyfz@linutronix.de> References: <20161006085228.jl6rpszdp5c2p2nr@linutronix.de> <1476587662.1538.8.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1476587662.1538.8.camel@gmail.com> User-Agent: NeoMutt/20161014 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 609 Lines: 14 On 2016-10-16 05:14:22 [+0200], Mike Galbraith wrote: > > In v4.7, the driver switched to percpu compression streams, disabling > preemption (get/put_cpu_ptr()). Use get/put_cpu_light() instead. I am not convinced that this will work. Nothing prevents zram_bvec_write() to be reentrant on the same CPU what I can tell from browsing over the code and since it uses zstrm->buffer for compression it can go wrong. Also I don't know if crypto's tfm handler can be used in parallel for any ops (it usually does not work for crypto). I suggest a local lock or a good reason why the this patch works. Sebastian