Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3350737pxu; Sat, 19 Dec 2020 23:23:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzm/cbCLDkPiekUoMopIt733nNjhgnf45evhbz/IKjQaq0dtG9Alh3uzq6pgQeEJYwb3dU X-Received: by 2002:a17:906:cd06:: with SMTP id oz6mr10978980ejb.25.1608449002088; Sat, 19 Dec 2020 23:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608449002; cv=none; d=google.com; s=arc-20160816; b=iGZdGXqTTJS3SWuUJwP0OLvwNW/3HJXvFfwThYJkjA3gHyhkgI/MZkqcin/YObJFzL iteed6NITemZeHKvaTOnIrpui8hApdPo+wO/6OeF6VUXYCQW8g23KhoO/4Wn7sHS6rBy xsCvi8YMVun6yr1pn2Z8kF+Yhp9OoUV99d2aNVtA9ZK1tttgF/8EA9SAzLDSf4NbszmM JajaUb5qg45zpICdq31hg2S9KMXa64yi84nFqcicSSKy4XJ1PBlapgqzqx9XYphyULh5 7WNzWFkGE8lqIBUzAgxi+Z+P3VzbDKYSE+7wWlhUi1xs/uyKOYwJQmzkR42ytI1yZwHy 1DTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jXiZzoYj9lJLqDb1wsKkQ4wESyAhEIsfYGKtUX0HLnc=; b=ihGZIEAacJe33WP9WojSmzK4LBgib2CRzlPQkc/igQkt9wNiyyRuXLYul9W6cIb31T 9Y/lkQ04HQOnD+YAUSvazuuhWeW5C8iJ43vzAZU4wTc/KhVIsdJ0k3SPLmjQdwRlnw52 3Ub6kmSYBDHh9TOYowcf8XfsiLxLT/SZPxszGLpg24vQDp2LzHsCM0NAeMbN0HrPmvrG 85VRwhjGcMaT0hX8JMinBA4s68l24UlOYx84mHoo+0r0xsklWy504VavMlYMNDV5tbxh BjsWEw303E+ERh/WZ4ljtHFFcHEOWw5wovGgsAy0vHOt0nAI3ZjETqq/g30yDLWLCFHL OdNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@konsulko.com header.s=google header.b="g/9cEBTA"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si9100385eda.177.2020.12.19.23.22.59; Sat, 19 Dec 2020 23:23:22 -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=@konsulko.com header.s=google header.b="g/9cEBTA"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727068AbgLTHWa (ORCPT + 99 others); Sun, 20 Dec 2020 02:22:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbgLTHWa (ORCPT ); Sun, 20 Dec 2020 02:22:30 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6047AC0613CF for ; Sat, 19 Dec 2020 23:21:50 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id o13so16184039lfr.3 for ; Sat, 19 Dec 2020 23:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jXiZzoYj9lJLqDb1wsKkQ4wESyAhEIsfYGKtUX0HLnc=; b=g/9cEBTAaK+DLhL3dladM+Lv1zA/K9YTJHlPOgkLfQmxtfptGUoPXQW2+CCSI0mB8+ Dyx9GsSkWE2H+oLiI+VgTCIAPzkuzbw7fMp0CShaSUjaUpBwbPDB6//J4d+XYLgX1iUs ImtiwuRnWur7onCRWYeQTTRB2UJnINy4IBIos= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jXiZzoYj9lJLqDb1wsKkQ4wESyAhEIsfYGKtUX0HLnc=; b=p42yvFjrHjICBnLs0iuQ50gYUlmYZWAz+t7+b0gzBCciwNzgRa82VkX7Gi5IimOCnI 44RdK75KJpNT/DGAx0ktJnGzTPcKBsBXNUQGMAfyZb+azqaZRgQU9zQZSbb4zZoQAw9c i2dtXs6iNmkFbJw+Vk4QiImdvx1WaMdXXJLCxj6EbXt7GD38oM9uVbcPKlHPAtQ7nKF1 22Z0ds38ODjEQFxlPQRu1oL998aDnxfmUzzFn6AX6ZwhVkZAS3m8z5Nllx62HF0i7zCT bvVm33hZ06Y4h2WqpSgijtlhnMFKCyvBt5ZgvDWHL+8kQOT0kiFNl7KUt1KoymPdsK29 qr+w== X-Gm-Message-State: AOAM532DiiWTAMSDinviJwKvDeCpeWnzHt+lj8mpwYWf8c5PDUDzAMON y8+oPlSmYv319kGQ6HArNx7prZXdgz5EKW1b7qvgqg== X-Received: by 2002:a2e:b8c4:: with SMTP id s4mr2165743ljp.269.1608448908747; Sat, 19 Dec 2020 23:21:48 -0800 (PST) MIME-Version: 1.0 References: <18669bd607ae9efbf4e00e36532c7aa167d0fa12.camel@gmx.de> <20201220002228.38697-1-vitaly.wool@konsulko.com> <20201220011835.GU15600@casper.infradead.org> In-Reply-To: <20201220011835.GU15600@casper.infradead.org> From: Vitaly Wool Date: Sun, 20 Dec 2020 08:21:37 +0100 Message-ID: Subject: Re: [PATCH] zsmalloc: do not use bit_spin_lock To: Matthew Wilcox Cc: Mike Galbraith , LKML , linux-mm , Barry Song , Sebastian Andrzej Siewior , Minchan Kim , NitinGupta Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 20, 2020 at 2:18 AM Matthew Wilcox wrote: > > On Sun, Dec 20, 2020 at 02:22:28AM +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. > > Isn't this just "I open coded bit spinlock to make the lockdep > warnings go away"? Not really because bit spinlock leaves preemption disabled.