Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2512881imm; Thu, 27 Sep 2018 14:14:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV629PWka+Go22hOtcDQ3WyLmab7fsTHp0E28wBLXYitxa3eGah5FXPRNy7VzApRnU+KZHadE X-Received: by 2002:a17:902:780f:: with SMTP id p15-v6mr12922644pll.170.1538082881475; Thu, 27 Sep 2018 14:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538082881; cv=none; d=google.com; s=arc-20160816; b=JFrWdQxlB3R1PC6IF0gMOhubFlY7DqHfLFKXdAN6Bofe6S2B58HMRPYIX0e5EbWM4k 4BXrSMcAD5N7gCjMVUK/ZadbSbKC27NtF3la76Ce9M/Et/60HB1iERvAGyMsYKDM2y5k 6ULXzSqTqMI/ppu5bB967LxE/l5pgl0CA1ADQepdbExIAGMhBKSMbkFiQZS1z60mZMdp GJKvs1aa3G/nDNlZEAUtwMvIERj3c9zNeHCgQkbQu8JSuQQA8KEQeRNHEj4ogeqFaNpW 8fdvsDazaibjbNPvRfxhtHBVY6PaUSOy6ggVkNsNnJhDSV8APKGPIby8U9z1I68En/XO tDUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature; bh=keDMkEhzcD51A892wLdsvfwC5PK0PU9UdcNVrUpnll4=; b=ZxvSVHeLkyquzPYAVTBJYhLu/9LahVe84BKlL48MIyIcmloJVPQ+zXcHrkRCtW4pIm DX10l6OJPkLqpQ81LbCzs+mKP3nAGg90P/6W+0y0Ztqz3/of/3vIOCepdoT08piyr2tl rG5LkcrM+OQofRbghdEh1HbJdENFUA7gQcSO7EmFQW6drFJLL4srKaGAOEhvoS3M0yJi 9yRf29hDsa28Wa4t40SXPjlkpv12kSw2DSv1qQ4E7y3SIsBpiyT6/aQ8F0RVreiTu5M9 LQz4c0SGZr4ubwOg+l1LGWcK/dIVECuGfbwnsxjJGoeEwX+Hql0F/Pz7QOooxORp9zq0 0iFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.ca header.s=s2048 header.b=UuuAsBUd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.ca Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b128-v6si3194236pfg.94.2018.09.27.14.14.25; Thu, 27 Sep 2018 14:14:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.ca header.s=s2048 header.b=UuuAsBUd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.ca Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727620AbeI1Dcr (ORCPT + 99 others); Thu, 27 Sep 2018 23:32:47 -0400 Received: from sonic309-21.consmr.mail.gq1.yahoo.com ([98.137.65.147]:37556 "EHLO sonic309-21.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727340AbeI1Dcr (ORCPT ); Thu, 27 Sep 2018 23:32:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s2048; t=1538082753; bh=keDMkEhzcD51A892wLdsvfwC5PK0PU9UdcNVrUpnll4=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From:Subject; b=UuuAsBUds/E5NlDdLbxpi5d68SrrVBevYBND10zR+ik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UGuS1_Esm7S08wOXJZc7WiL8.ASqKZwDqoU.Wy5NjYaKNIfbMfjk MguAZqE9IK5xc0zU_JJp2AOzLDfwzZniynOwmTs5BHWWHkY6C0Av.QVlQvFT7zyte7Dehv2Lo3MW 1RBk.96AK.0q7jcLbnZhrKgYRA23Vc2huApeo9toLkqZQB9wnMeNVAQua_UjvnglVU3NrIHPFUiq 0DnuRUsWlDPx23UAp5NpwfM8PHdgKgf9ommIYXxVQHJ7SOIMg1KqQKfcu7dXwSUsCq54SPsUEThT lKAzeyC2B Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Thu, 27 Sep 2018 21:12:33 +0000 Received: from pink.alxu.ca (EHLO localhost) ([198.98.62.56]) by smtp430.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 4a3511c8987175a4c5587e660d0d6381; Thu, 27 Sep 2018 21:12:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Dan Streetman From: Alex Xu In-Reply-To: Cc: Linux-MM , linux-kernel References: <1538079759.qxp8zh3nwh.astroid@alex-archsus.none> Message-ID: <153808275043.724.15980761008814866300@pink.alxu.ca> User-Agent: alot/0.7 Subject: Re: [PATCH] mm: fix z3fold warnings on CONFIG_SMP=n Date: Thu, 27 Sep 2018 21:12:30 +0000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Dan Streetman (2018-09-27 20:41:21) > On Thu, Sep 27, 2018 at 4:27 PM Alex Xu (Hello71) wr= ote: > > > > Spinlocks are always lockable on UP systems, even if they were just > > locked. > = > i think it would be much better to just use either > assert_spin_locked() or just spin_is_locked(), instead of an #ifdef. > = I wrote a longer response and then learned about the WARN_ON_SMP macro, so I'll just use that instead. Original response below: I thought about using assert_spin_locked, but I wanted to keep the existing behavior, and it seems to make sense to try to lock the page if we forgot to lock it earlier? Maybe not though; I don't understand this code completely. I did write a version of z3fold_page_ensure_locked with "if (assert_spin_locked(...))" but not only did that look even worse, it doesn't even work, because assert_spin_locked is a statement on UP systems, not an expression. It might be worth adding a ensure_spin_locked function that does that though... spin_is_locked currently still always returns 0 "on CONFIG_SMP=3Dn builds with CONFIG_DEBUG_SPINLOCK=3Dn", so that would just return us to the same problem of checking CONFIG_SMP.