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,URIBL_BLOCKED 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 BAADDC4361B for ; Sat, 19 Dec 2020 10:46:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 54A9B23BE2 for ; Sat, 19 Dec 2020 10:46:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54A9B23BE2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BE1B56B005C; Sat, 19 Dec 2020 05:46:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B92F66B005D; Sat, 19 Dec 2020 05:46:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A81F26B006C; Sat, 19 Dec 2020 05:46:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 8FBDC6B005C for ; Sat, 19 Dec 2020 05:46:43 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 598448249980 for ; Sat, 19 Dec 2020 10:46:43 +0000 (UTC) X-FDA: 77609703486.15.play17_1300d7827445 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 390541814B0C1 for ; Sat, 19 Dec 2020 10:46:43 +0000 (UTC) X-HE-Tag: play17_1300d7827445 X-Filterd-Recvd-Size: 4147 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Sat, 19 Dec 2020 10:46:42 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id m12so12051652lfo.7 for ; Sat, 19 Dec 2020 02:46:42 -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=dqAwl5/BK7mKW8hy+rXPleawKGWEfxh8nem4l7u+e6Q=; b=inY2jM40JgO+Yy60zspBzWqHc1oj6B5SejBurxU2sjpvyM7/2AgkZ/a3/Qu0GkF78A U+ivBbMyIh8LIQQB82USjfCafFljwznrlYBW/7oRJHKATVaYcUaih5+n1CVFAZLKB+Bn FkjVUHn5gv/nCK4ruUYzkVRL0CvFzQ11Sd/jU= 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=dqAwl5/BK7mKW8hy+rXPleawKGWEfxh8nem4l7u+e6Q=; b=MJPZyP9T/eDSk2aa9t4ZxMgPKM1+oOzejB6N1FrIbDYDXKTeS501Bn2veqW8K8zcks lw7b37QIdWphugboI1NpC9rKjvgicM2v+VHbhrJ9BqPLOeFNKz2PCW5h3sQozqLMzHqz vcB+SbfuNkmHiUADMrRui3nOGhKgNAJazyK32nCtBrQ46QDLwQY5WUm2sQh+gop4NxU6 yy8PK99m9wY4V+XkmkQMNgLTieYzJd3jzqEaOnI+PAI3FDqtF2hzfoT4RLKGekhifBxf BvtZxARhtdlGz0FJKJbJ9x0pbui7DoWXc8BmdEQkaJaMaflUdLi8DxVNL91mnVL4zgy+ uGgg== X-Gm-Message-State: AOAM532Y3gWqHp6ppXr2k5l7KRN69IZiGsD+RNVk2XjUfoeow1sjfp2x atsO3NxYED3vbHg4nut9d6XrqVIKf14rrCgp/Rd18A== X-Google-Smtp-Source: ABdhPJylwaoMYEVUDsKcbZcqrhLHToc9DzJeTxx4ntyzWqPKD5fr5i15L5QR4cR1q84Od8xOEG0B9Ml/ccaD31MFbUA= X-Received: by 2002:a05:6512:6cd:: with SMTP id u13mr3042997lff.288.1608374801370; Sat, 19 Dec 2020 02:46:41 -0800 (PST) MIME-Version: 1.0 References: <6946d6e798866276f0d635f219cdd4ad05156351.camel@gmx.de> In-Reply-To: <6946d6e798866276f0d635f219cdd4ad05156351.camel@gmx.de> From: Vitaly Wool Date: Sat, 19 Dec 2020 11:46:29 +0100 Message-ID: Subject: Re: [patch] zswap: fix zswap_frontswap_load() vs zsmalloc::map/unmap() might_sleep() splat To: Mike Galbraith Cc: LKML , linux-mm , Barry Song , Sebastian Andrzej Siewior Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, 19 Dec 2020, 11:27 Mike Galbraith, wrote: > > On Sat, 2020-12-19 at 11:20 +0100, Vitaly Wool wrote: > > Hi Mike, > > > > On Sat, Dec 19, 2020 at 11:12 AM Mike Galbraith wrote: > > > > > > (mailer partially munged formatting? resend) > > > > > > mm/zswap: fix zswap_frontswap_load() vs zsmalloc::map/unmap() might_sleep() splat > > > > > > zsmalloc map/unmap methods use preemption disabling bit spinlocks. Take the > > > mutex outside of pool map/unmap methods in zswap_frontswap_load() as is done > > > in zswap_frontswap_store(). > > > > oh wait... So is zsmalloc taking a spin lock in its map callback and > > releasing it only in unmap? In this case, I would rather keep zswap as > > is, mark zsmalloc as RT unsafe and have zsmalloc maintainer fix it. > > The kernel that generated that splat was NOT an RT kernel, it was plain > master.today with a PREEMPT config. I see, thanks. I don't think it makes things better for zsmalloc though. From what I can see, the offending code is this: > /* From now on, migration cannot move the object */ > pin_tag(handle); Bit spinlock is taken in pin_tag(). I find the comment above somewhat misleading, why is it necessary to take a spinlock to prevent migration? I would guess an atomic flag should normally be enough. zswap is not broken here, it is zsmalloc that needs to be fixed. Best regards, Vitaly