Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3360725pxu; Sat, 19 Dec 2020 23:50:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlIJiO1Rf7hVMbCePtKPEOs2VfIGEimPQyGAGqbCbNuBIQStS2L5KVAfdVUG6tDQIFOqZR X-Received: by 2002:a17:906:2499:: with SMTP id e25mr11106995ejb.446.1608450658232; Sat, 19 Dec 2020 23:50:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608450658; cv=none; d=google.com; s=arc-20160816; b=rIZO/2ZyXKTUpYByfleFhKmW277bCVUiADJWs4ZsiJbaQMjDWnpKuYgC5Jn0FSW0Mp s6Ov97CYFQha4yFqc66JuSz0rt4DOOhBmL+6NgeT9KWHCuBlvtjnNU0v2oe+GNerYFYF NZtrO0o71/ruQQuudfGNI6FE0zIzt/I1yh1LJrsqCZEGxnP8T/3ujbjNTUjfZCkAo1EL BsgmSiOhTInYQ6wBzMygNL7ytlKkmK1OaR/zdZ7QKllTGDy1Ny/YcngLSULQAnHiKffO fB4hVankX5Jj0+oa+TqpksRNGITMEKn3LWoWpsCJwnZ3dLHA6h0EUCRJYh/Ugwzzg5Ax Uaog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=SUXl7kVPL517MC0U6WGGuXxZ2IdQhGEhtiyoxSZjiqg=; b=RbilZqabcORt0eMd6P1F+LbfuUP0UbIuQM2lAnL0e0NaXNDXKLja0Y8sp4QFkwBPer 5RBsrkch3LKzxIRXRay2Ctvymf7M+xvib4FAnh0DFfj8/V6W0UqBYnK6vIfokIgqih06 wqppbUFyyHwqHasDuJ/NVMypddj7+U2CZ/GpBBtXd/IqksJxN8/XHU8uZObeW3629lnI HMYb4M/xH1wgnUfHBxMxBi7JTJ0/HBmgbKz4tCxqtckCPRtjCmYvvU1WwP4pmc7+euEI mBP9/m8Rg5lLY+o24DK7XFo+3IjH3YEbyrW+LXBQoc1kGpl23OLc4m+mmHFHwBaRrMDD +1Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=kAj4f1Km; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k4si9156973eds.355.2020.12.19.23.50.36; Sat, 19 Dec 2020 23:50:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=kAj4f1Km; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727162AbgLTHt3 (ORCPT + 99 others); Sun, 20 Dec 2020 02:49:29 -0500 Received: from mout.gmx.net ([212.227.15.15]:46695 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbgLTHt3 (ORCPT ); Sun, 20 Dec 2020 02:49:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608450459; bh=hC9mkbhkVbkM2JfCnZeNhXgWTKs8omxwsyFa6gq/fVo=; h=X-UI-Sender-Class:Subject:From:To:Cc:Date:In-Reply-To:References; b=kAj4f1KmW28vhJCmT1tc6U9DRRCqnGNZC/aNTI2jQ5u/sVhm4KCHmyREBfag45Ijs gW3FaX5o2m8ivGl/aZgZhRG67/5uEBNjW+k8adjk9pdpr1I2RW0b4rjEanduUx5fqZ dDZ0aqlIzOKwLKbpDzSM03mHceFcq9693PnXaDGk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from homer.fritz.box ([185.221.150.14]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MiacH-1kBWwO0Gkp-00fgCC; Sun, 20 Dec 2020 08:47:39 +0100 Message-ID: <80d3be3d47356bf0bd6c5a9d9dc658ca3da292be.camel@gmx.de> Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock From: Mike Galbraith To: Vitaly Wool , LKML , linux-mm Cc: Barry Song , Sebastian Andrzej Siewior , Minchan Kim , NitinGupta Date: Sun, 20 Dec 2020 08:47:36 +0100 In-Reply-To: References: <18669bd607ae9efbf4e00e36532c7aa167d0fa12.camel@gmx.de> <20201220002228.38697-1-vitaly.wool@konsulko.com> Content-Type: text/plain; charset="ISO-8859-15" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:BEWUdf9ul6EOKr9afLfEzREe+fgorRGni7ZtyFo1O7O0xftClFM cJp58ggnNkYcFI7D2MyrVEtAagEP9lNO5O9MPdkclzr8f1bMG4zisBFioRzyCxpDrfKqlk5 CuK3INdE+jdnxj6HrN6UmGFx3B6I7NWlZpRV4kiNopHjryejuq1wF6hDAOXGZy9rAOjoBcx Lb1U0Mo/KpzWytH68a+pQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:klTbygR4sAg=:gJ8fQ+VTkcrSWzunc63eJY 8EVSuhQkDunPNgxN+aw9YaC/ofWLGHK5ztsKfpOu6xv6pHEGSsF42Ql2McqiqMJfRe8BMZP0e +qb5fTbdPJuMotuJN156A2Go7C3892Luw8H5Kr3JfZcBvgQsDyEb+Gaftzq/F6ddU3NctPAzO 6QChU4VIDaKixgxpowW79zccaNvjuDCgqeamMTsK5Qk/e4BlTP4RSLY/6ULKjQ0t2Bk8Ik0WO kxTS1uZbYQBdk5G2HpyEaH+GGcpdsDmxJjXP/X22HqWrL0FWXWEe+7fzo1Q3E1+2LsRsr64We guH1gvFq45wc8wNIR6BF3fpL3v4zib9t0WSb0PntjVLI2ji2Tsx3do8jnPBsgFjskoemCG7xY WjAO6RHzw8SSoDzKklLyLnIFrRRC8BBHz0yIBEZECOJFm75WIkYeRdjHyCKC3seYSBeWVVaQt Kfd+SFJEas97DNn1/Glv6IdZE0DIrU77r5yCqTEfsA68881rKHdWMlsyNtIZ3dm795/yKp2IY yt8hvJXlRZ6pDh12vv7uwHHTHl+KUkyZ/FkGMSlUOJ2ESsFDS75sGZ+Xe2qjY4pBnOzRSqPZk 0M05jxhjkffuNZ9YjzZa3L3LFAV9rfPweo0C7S7ke2H7WsPiVMSQ42XEcaMBa9C1LwIqaOKGV zcRwIk0VtoU/JkuiiPeympWKv0BIo8CnbQsuvAkfr9uMx4x+ZtJqJcO29oBgYnV0Tts1JOGvB bAaWetmmCNNCxz56nVAs+uQJ50YlaF65KDnCGNN56jdxgU3I0tzxwlCnfpe1vM7hiRQ8otRs3 iQcL56HELkvSjzPhGjzEtZM1I+9Eop+H1/elbsYm2pUHXx5DeSLC8BF2ODtht8otZofEq/yNa ItQWm8lVbuWU9c0lAJag== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2020-12-20 at 02:23 +0100, Mike Galbraith wrote: > On Sun, 2020-12-20 at 02:22 +0200, Vitaly Wool wrote: > > zsmalloc takes bit spinlock in its _map() callback and releases it > > only in unmap() which is unsafe and leads to zswap complaining > > about scheduling in atomic context. > > > > To fix that and to improve RT properties of zsmalloc, remove that > > bit spinlock completely and use a bit flag instead. > > It also does get_cpu_var() in map(), put_cpu_var() in unmap(). That aside, the bit spinlock removal seems to hold up to beating in RT. I stripped out the RT changes to replace the bit spinlocks, applied the still needed atm might_sleep() fix, and ltp zram and zswap test are running in a loop with no signs that it's a bad idea, so I hope that makes it in (minus the preempt disabled spin which I whacked), as it makes zsmalloc markedly more RT friendly. RT changes go from: 1 file changed, 79 insertions(+), 6 deletions(-) to: 1 file changed, 8 insertions(+), 3 deletions(-) -Mike