Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp142442ybi; Tue, 2 Jul 2019 17:53:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwm186B5IbsxKbO/Yeb0RhVuSDXQYA+sFMwB+rLwYVOJm3DMjQrtQ5Q+jW/FROEZtd7kZ8J X-Received: by 2002:a63:69c1:: with SMTP id e184mr30579936pgc.198.1562115233912; Tue, 02 Jul 2019 17:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562115233; cv=none; d=google.com; s=arc-20160816; b=WkuP1Zb56t4QY0bVcoGurfEqm3SoLK9A3VUjnEQT6e54FB/t+c/CKtmwVlefFfICd8 v90v7ickrs23HjawNjPZgKOq6g+7AuC/1EIS1jjZ8BZaxDu0pAiQ7IXxpRSMBrQkQ2Ik fJp7T3Gvm0zA8nJdoNeWBIS3FfHwUG63bfZO4cV6Kqazsir+VGAyxMydZDoHOQ5MsSdG EvRdTZ41Dbvy3EK1doHf/3m5O46TjEGyoloVbH7tTmAsbC55LQxLHL2WlSU1/EG7nLy0 q1FHUCvr9TcH9DeCqePmQqJHRlDALq4WKB2Zzltl68aVXlqtqzW04qNGxH/nfU1GO1FG HdlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=7oMrnJGlcjkfiIrlAgqhI4UBNyxzGYdqpTHy9NfcQFQ=; b=NaZu/iygskH0vYE4RjnU8pa5hCxZoM/kYZhCg8WT36VcWzzQhoMDCJ0K9twg0gOaGu 3xRfjY+rioz6NH51T/x1DEZVSr/fh32aYjdfpTOCksRnKMdMWSG4ibe+FuRo8oM55O3V +xDguNd5WV2kaFjhENrHpi+WWbY8Zy8teD3gzrAp6CnYVZeIbLOJLCMVddqVy7ZQbfBd pAHpdDSxxUGxzar96ucmtmyk86UHQY8MiKR4yBRq0us9rUo2Bb7Bp4BGpP2UWNCvffTl OXX47uULnnxOxlJRHuaX73XqFKUtNRfeqBxRLvd5nhbS3APbhJ1Q2OkRYJd+2rBkzaYJ QzIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="W75jKD/r"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si417302plo.104.2019.07.02.17.53.38; Tue, 02 Jul 2019 17:53:53 -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=@kernel.org header.s=default header.b="W75jKD/r"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727200AbfGCAxF (ORCPT + 99 others); Tue, 2 Jul 2019 20:53:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:47372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727066AbfGCAxF (ORCPT ); Tue, 2 Jul 2019 20:53:05 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E41A218E0; Tue, 2 Jul 2019 22:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562106249; bh=paq3rBGRhLW2Qpm44+MevTEqQRAXrHYmPUYx69zxz/M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W75jKD/rNzq2PuPQpltd8H0MgbE9WV7KUI0OFTUGJiv4fPwyzhUtfkvdxeVlqOkFL 4b4xWxBzPXNyswEVKmLNwRI3tbXoIQnWMp3m/zqn80P3dgemCD1FV6iQddz/Pfn4vq yEgltIRFEizLLcYCPK78BUk8j0MPX6sFGN8Y+qYk= Date: Tue, 2 Jul 2019 15:24:09 -0700 From: Andrew Morton To: Henry Burns Cc: Shakeel Butt , Vitaly Wool , Vitaly Vul , Mike Rapoport , Xidong Wang , Jonathan Adams , Linux MM , LKML Subject: Re: [PATCH v2] mm/z3fold.c: Lock z3fold page before __SetPageMovable() Message-Id: <20190702152409.21c6c3787d125d61fb47840a@linux-foundation.org> In-Reply-To: References: <20190702005122.41036-1-henryburns@google.com> <20190702141930.e31bf1c07a77514d976ef6e2@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Jul 2019 15:17:47 -0700 Henry Burns wrote: > > > > > + if (can_sleep) { > > > > > + lock_page(page); > > > > > + __SetPageMovable(page, pool->inode->i_mapping); > > > > > + unlock_page(page); > > > > > + } else { > > > > > + if (!WARN_ON(!trylock_page(page))) { > > > > > + __SetPageMovable(page, pool->inode->i_mapping); > > > > > + unlock_page(page); > > > > > + } else { > > > > > + pr_err("Newly allocated z3fold page is locked\n"); > > > > > + WARN_ON(1); The WARN_ON will have already warned in this case. But the whole idea of warning in this case may be undesirable. We KNOW that the warning will sometimes trigger (yes?). So what's the point in scaring users? Also, pr_err(...)+WARN_ON(1) can basically be replaced with WARN(1, ...)? > > > > > + } > > > > > + }