From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACF52C433F5 for ; Fri, 24 Sep 2021 07:08:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2F9616124D for ; Fri, 24 Sep 2021 07:08:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2F9616124D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5CFEE6B006C; Fri, 24 Sep 2021 03:08:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5593D900002; Fri, 24 Sep 2021 03:08:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4208E6B0073; Fri, 24 Sep 2021 03:08:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 2E4E06B006C for ; Fri, 24 Sep 2021 03:08:29 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D2F6F30C92 for ; Fri, 24 Sep 2021 07:08:28 +0000 (UTC) X-FDA: 78621588696.17.676DDA0 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf19.hostedemail.com (Postfix) with ESMTP id 70118B000093 for ; Fri, 24 Sep 2021 07:08:28 +0000 (UTC) Date: Fri, 24 Sep 2021 09:08:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1632467306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X/cLDy4xHO+rHDRHZ7h4ikqNM8VeyYuHp0pz3C/UESQ=; b=FJ8opqUbjUbTLwnaKlAGNyYqE20l6NbYMJCunlj1PNa+/uJW86u2ahTSbNx607O/GJ+a1b 3j+Ms4fiFFCebGvoKEJl8/yHccjOu76Bx6TM62rhIsOVIXb5UMy6/HWYMrASV7Gg0fl5y+ DHCU/LTTR2xZQiCI+JhS2XbWWtvwDG6vdGshMcubIVqRJ3aay5mJySfu6JEzZFSx6yANou hv/WvGdw1sBSp4gttfX8zJcM7Q7aaxlQ2Xbq6LIPpDsveXwUrECX5zWmE7+3sOICbSbwRy BdeuYJmTY89CfXwAHP51lbD4CdZTPsFUqlo75l9qQOPnZt4B7otiVdQ0D48G+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1632467306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X/cLDy4xHO+rHDRHZ7h4ikqNM8VeyYuHp0pz3C/UESQ=; b=mkHgxgVWPsUkOW/PZIIh+j+FIH0OtjDVicxKmc4q9wG0rFIXZ5r6uzbKhjW6pzJU8eK3AH 8pRz2gySg15y9UBQ== From: Sebastian Andrzej Siewior To: Minchan Kim Cc: linux-mm@kvack.org, Andrew Morton , Thomas Gleixner Subject: Re: [PATCH] mm: Disable zsmalloc on PREEMPT_RT Message-ID: <20210924070825.zqsi7hxgtojd67wv@linutronix.de> References: <20210923170121.1860133-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 70118B000093 X-Stat-Signature: spqskt7mfzu5azfc3um398ddsxonkebk Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=FJ8opqUb; dkim=pass header.d=linutronix.de header.s=2020e header.b=mkHgxgVW; spf=pass (imf19.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de X-HE-Tag: 1632467308-236131 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2021-09-23 16:06:58 [-0700], Minchan Kim wrote: > On Thu, Sep 23, 2021 at 07:01:21PM +0200, Sebastian Andrzej Siewior wrote: > > For efficiency reasons, zsmalloc is using a slim `handle'. The value is > > the address of a memory allocation of 4 or 8 bytes depending on the size > > of the long data type. The lowest bit in that allocated memory is used > > as a bit spin lock. > > The usage of the bit spin lock is problematic because with the bit spin > > lock held zsmalloc acquires a rwlock_t and spinlock_t which are both > > sleeping locks on PREEMPT_RT and therefore must not be acquired with > > disabled preemption. > > I am not sure how long the preemption disabled section takes since it > just disable for a page copy mostly. after the bit-spin-lock, there are sleeping locks. These are problematic. > > > > There is a patch which extends the handle on PREEMPT_RT so that a full > > spinlock_t fits (even with lockdep enabled) and then eliminates the bit > > spin lock. I'm not sure how sensible zsmalloc on PREEMPT_RT is given > > that it is used to store compressed user memory. > > I don't see what's relation between PREEMPT_RT and compressed user > memory so you can reach such conclustion. Disable zsmalloc also makes > disable zram. I think in-compress memory swap rather than storage > swap/block sometimes would be useful for even RT. The only user of zsmalloc I found was zswap which compressed user pages. Maybe I didn't collect all the dots. > > Disable ZSMALLOC on PREEMPT_RT. If there is need for it, we can try to > > get it to work. > > Please send the patch which extends handle with spin_lock rather than > simply disabing. Okay. I will clean it up a little and post it then. Sebastian