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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 D0235C433DB for ; Tue, 29 Dec 2020 12:14:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5F67F2078D for ; Tue, 29 Dec 2020 12:14:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F67F2078D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6B3928D0029; Tue, 29 Dec 2020 07:14:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 664968D0018; Tue, 29 Dec 2020 07:14:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 57B4A8D0029; Tue, 29 Dec 2020 07:14:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0157.hostedemail.com [216.40.44.157]) by kanga.kvack.org (Postfix) with ESMTP id 3F7808D0018 for ; Tue, 29 Dec 2020 07:14:10 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EEF761EE6 for ; Tue, 29 Dec 2020 12:14:09 +0000 (UTC) X-FDA: 77646211818.26.shame95_2705a8a2749c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id CC3E61804B667 for ; Tue, 29 Dec 2020 12:14:09 +0000 (UTC) X-HE-Tag: shame95_2705a8a2749c X-Filterd-Recvd-Size: 2510 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Dec 2020 12:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PkExMLV9c9lZCtCXh3APiHVKga9LqLmI/zBDquxhRIg=; b=FU0l6SLeoylsCNKzA9NGEHOwI6 wT04xGHwNLlexyLowbXq0KdQLQNhvd3tR91P+lJ78LS1w5b7783zrFYnjBCUOq9ddSfb6SQWMdExi 3gSjB5aN5FbqDlafKXXYN3lTVlsFzdjB40n5twC2sDR5ygbhEnvxvQcp1Mah5fSVocKQb/nscQFJy yIF9SLLfTYOgbjosLHBOjRky6GsSZNb4Pz7qbsN9HH8WIBYPldtal3kULGB6gdNdApWWmAocKUdgY RQq6cHfVnmD7XTHqX/7ZTgnwVj7u4ULJv0GRsyp87vC6mv6eiE63HCP4vpGeHliqYitfSFLfZd9e1 VYCLcbkQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kuDsv-0006F6-2X; Tue, 29 Dec 2020 12:13:56 +0000 Date: Tue, 29 Dec 2020 12:13:53 +0000 From: Matthew Wilcox To: Rongwei Wang Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: rectify a page bad reason Message-ID: <20201229121353.GB28221@casper.infradead.org> References: <20201229031156.3861-1-rongwei.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201229031156.3861-1-rongwei.wang@linux.alibaba.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Dec 29, 2020 at 11:11:56AM +0800, Rongwei Wang wrote: > When I was doing some memory-related projects, it always reported error > "nonzero mapcount", but its judgment condition was that _mapcount was not equal > to -1, so I felt the original string was a bit inappropriate, so I tried to > update it. But '_mapcount' of -1 _is_ a mapcount of 0. If we need to improve the documentation somewhere, that'd be better than changing this message. I do wonder if we want to add: if (unlikely(page_has_type(page)) bad_reason = "page still typed"; It's covered by the non-zero mapcount case, but is slightly misleading. > if (unlikely(atomic_read(&page->_mapcount) != -1)) > - bad_reason = "nonzero mapcount"; > + bad_reason = "non-(-1) _mapcount"; > if (unlikely(page->mapping != NULL)) > bad_reason = "non-NULL mapping"; > if (unlikely(page_ref_count(page) != 0)) > -- > 1.8.3.1 > >