Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2806796pxu; Sat, 19 Dec 2020 02:49:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+x+DQtU3dHEQKLX+YJlHbaTIERO2Y59F7QBCbvhIQJ4iEdLSbpVht5BSUCNdp1eqLE0RC X-Received: by 2002:a17:906:edd1:: with SMTP id sb17mr7813877ejb.118.1608374987046; Sat, 19 Dec 2020 02:49:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608374987; cv=none; d=google.com; s=arc-20160816; b=sJcoye735AsjhskJXFx0r5t4BZslUii3icyLZzc3yzb7GW/l0MFSkwNGE+304bNw0I qTQudLe/n/BNy2YccTkoz4nYvrE8V/+IONSX9fWtqLdSph0LrgqvBpC+aepBnechrBb3 0i39dEsPbuW/8D5Jg+F5dDOwaaOoFo+X5t7KGjOJBZVRGj78dMmSQPelGmx/7dWeTAE1 Qc071sP9dMWh/YjfbZlsSu1ZTAYcd9rgX6GlaVGO7Dm7rK6kt5CS3cFZjx3ueKHxDMLS u7Kq+r/jhxD6vhzc+kiMvHF9Z6c0OKVRsfwBN1dMoMYiqN5cN5DYWgwXdAgq3Jm9MVda i+kA== 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=dqAwl5/BK7mKW8hy+rXPleawKGWEfxh8nem4l7u+e6Q=; b=K9GWjf5x1DQffzh6rQ5YsinUJPviEj1SJJO9/93ZrkwQ7Qf4V/vuf7BCkMndgvMPhx N8R5WcJsdgVOVIeG5POke5E/HostTqT0ng41uWT0imiw4j8p9PNXY/dCH4lq8PIec+dW DklgYH0ze3eYpQqCbYQUp70Jtlmgl7Xpq9+SDGAcrkqmT6i4pW3CkEb7isOZb66+Hg2u Bqp0VPE1sHHqTV0BVICS6OB00fP6qd+ExBeDqs5f4XFSGRuyxTTFsM72TrEHQ4S3m1Q+ DXyqi/zE+aCqptK55FReys0J2A5xI3kEPSl+iGXMDw/BttHtQjDBRwL7vA0lFIW415al QKcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@konsulko.com header.s=google header.b=inY2jM40; 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 t16si9986467edi.490.2020.12.19.02.49.24; Sat, 19 Dec 2020 02:49:47 -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=inY2jM40; 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 S1726494AbgLSKrZ (ORCPT + 99 others); Sat, 19 Dec 2020 05:47:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbgLSKrY (ORCPT ); Sat, 19 Dec 2020 05:47:24 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BCC9C0617B0 for ; Sat, 19 Dec 2020 02:46:44 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id 23so12008975lfg.10 for ; Sat, 19 Dec 2020 02:46:44 -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=bZ+QVJXDz1tUNGVj8Q6r9Fvk5Du6XAWdaQ1Beo4PhdSZiLstrkeVs3OsZFDgSBMjhx /iM0v2NOjblbOhGPkubR+X9Sg1r7e7ByDkoR6neNlC313a8IKpaOoEBSIbB+UDi30S5t qso8RHPB/EIBwucelEB3DvR3QcZVMQ6tEaznHqYaKZQKWpv4K65IeU+U733nAvIpUaZK skbkjcN3uhiQ919KGeRxU7iWCP2zYV22Gj1+EqxwSksTnaBxaJACTq4atKJiZRvMdt8l sUDFzYdQ8AZF4DLH5TQDmmIrHmzmJH8JpQs4q9o8FIH8A/pK1SIR+ntzTcULxn2rbuIU QSUA== X-Gm-Message-State: AOAM530aD0UrCZCj6Dt0WmJUXfU7s5axDSWVYhwAVa/3G0w1UCW2VprW UsxPDZPRqwvgT83fub1rnmAG/iTAS996H+3cHmqOx0aK+0iQkKlSX5g= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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