lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 29 Dec 2020 12:13:53 +0000
From:   Matthew Wilcox <>
To:     Rongwei Wang <>
Subject: Re: [PATCH] mm: rectify a page bad reason

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

Powered by blists - more mailing lists