All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Rongwei Wang <rongwei.wang@linux.alibaba.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: rectify a page bad reason
Date: Tue, 29 Dec 2020 12:13:53 +0000	[thread overview]
Message-ID: <20201229121353.GB28221@casper.infradead.org> (raw)
In-Reply-To: <20201229031156.3861-1-rongwei.wang@linux.alibaba.com>

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
> 
> 

      parent reply	other threads:[~2020-12-29 12:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29  3:11 [PATCH] mm: rectify a page bad reason Rongwei Wang
     [not found] ` <CAPSr9jFf4HoODzubWx-JkVKK69YGx0vgaesuVU8od-qyyGOjpw@mail.gmail.com>
2020-12-29  7:22   ` Rongwei Wang
2020-12-29 12:13 ` Matthew Wilcox [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201229121353.GB28221@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rongwei.wang@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.