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=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FSL_HELO_FAKE,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 F259FC433F5 for ; Thu, 23 Sep 2021 23:07:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56596611B0 for ; Thu, 23 Sep 2021 23:07:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 56596611B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 747A46B006C; Thu, 23 Sep 2021 19:07:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F712900002; Thu, 23 Sep 2021 19:07:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BEB76B0073; Thu, 23 Sep 2021 19:07:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id 4D3946B006C for ; Thu, 23 Sep 2021 19:07:02 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id EF6BC1833A4DB for ; Thu, 23 Sep 2021 23:07:01 +0000 (UTC) X-FDA: 78620375442.22.7F07DB9 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf04.hostedemail.com (Postfix) with ESMTP id 9891C50000B2 for ; Thu, 23 Sep 2021 23:07:01 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id v19so5499608pjh.2 for ; Thu, 23 Sep 2021 16:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cANRKGNUVuiIVCX3zGdoVorcXNdooqogZd0RjtIykFg=; b=b46KGHjoNIuABM5GSQ6OU2m3h2d1uHPEKdfv78jJIJxPVkp9hVv0rrtjBa7hoRMfSz EMiqRHKKl0fNSTVoA80N2T9Kr+wDbOyeL73scPFHDvjOXjjuz44kdhPcq94u5ems3TCY 6vPxiczzNIGaeJFoPio+hl/3amGl99AMAN6U80PUfWKeBffkff50xUi6mKvK4oaHK82e JEcrezxfisf4o/kfM9xOH5836l53ab5BIUQnG+6katClGzI8RP9ljDCikB8rEDhcXnlF TwsM2Kj+1HlhcdaMLD+H7bt2xqk5nq2McVRWvncZyf0JPOalanmNDJzw48tV3GVEzLen gl1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=cANRKGNUVuiIVCX3zGdoVorcXNdooqogZd0RjtIykFg=; b=QLLRbTqe4EkCQIwrNjQxdvGVcFd3bMYinGwSxde3GQnOLRoLWWwZeGCo+YQwBlKK0p dXlN1nbPVXkGpukw95xDO7NFpNe70Kpx/QRvgk+h80pHxFAZG2Kb4j+wwMJCf4ugyr65 v4A1xGjO7IXTVS6RMOwzn6r+8iSnX0IpIPzc1VAlP148fqhchyIy4MUKQYTpiwGv3aCx tZITuZEWy1+3OJZd+SN1iHZCfzmEIsOXJgFDpvkIFfN6EvgAi5u2RKQzBsMsvEEkFTWH OWZZ3cxwYANdEPzUL1z3VW4MQyaEHH4W++YSUMP1dFhe2gpnUBF7cxuC/VUeDPUkCaAU lk9A== X-Gm-Message-State: AOAM530t/QvLtfN1o9PCjwk2f5tCwytoLf8IkAf4O65Ai+Uoy5sMRcr7 1mUIhnWrkFD0RA/rWQhFVt8= X-Google-Smtp-Source: ABdhPJwLJF4T/8WvibVnTmmd8goYAW3PTPT9hELh9VFE05hW+NNfm38/c+4EUX6ZTfhv6x7RDC3zAQ== X-Received: by 2002:a17:90a:8b89:: with SMTP id z9mr8127610pjn.89.1632438420442; Thu, 23 Sep 2021 16:07:00 -0700 (PDT) Received: from google.com ([2620:15c:211:201:5571:502d:54ea:90d6]) by smtp.gmail.com with ESMTPSA id d14sm6666626pfr.123.2021.09.23.16.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Sep 2021 16:07:00 -0700 (PDT) Date: Thu, 23 Sep 2021 16:06:58 -0700 From: Minchan Kim To: Sebastian Andrzej Siewior Cc: linux-mm@kvack.org, Andrew Morton , Thomas Gleixner Subject: Re: [PATCH] mm: Disable zsmalloc on PREEMPT_RT Message-ID: References: <20210923170121.1860133-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210923170121.1860133-1-bigeasy@linutronix.de> X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9891C50000B2 X-Stat-Signature: hho55fymm4hfecx4i4xunu4gwxessqgi Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=b46KGHjo; spf=pass (imf04.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) X-HE-Tag: 1632438421-733308 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000022, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. > > 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. > > 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. > > Signed-off-by: Sebastian Andrzej Siewior > --- > mm/Kconfig | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/Kconfig b/mm/Kconfig > index 9f1e0098522c2..541371e64c477 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -640,6 +640,7 @@ config ZSWAP_ZPOOL_DEFAULT_Z3FOLD > > config ZSWAP_ZPOOL_DEFAULT_ZSMALLOC > bool "zsmalloc" > + depends on !PREEMPT_RT > select ZSMALLOC > help > Use the zsmalloc allocator as the default allocator. > @@ -690,7 +691,7 @@ config Z3FOLD > > config ZSMALLOC > tristate "Memory allocator for compressed pages" > - depends on MMU > + depends on MMU && !PREEMPT_RT > help > zsmalloc is a slab-based memory allocator designed to store > compressed RAM pages. zsmalloc uses virtual memory mapping > -- > 2.33.0 > >