lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200801081434.14723.nickpiggin@yahoo.com.au>
Date:	Tue, 8 Jan 2008 14:34:14 +1100
From:	Nick Piggin <nickpiggin@...oo.com.au>
To:	"Yinghai Lu" <yhlu.kernel@...il.com>
Cc:	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Christoph Lameter" <clameter@....com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	"Adrian Bunk" <bunk@...sta.de>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: free_pages_check

On Tuesday 08 January 2008 13:43, Yinghai Lu wrote:
> wonder why free_pages_check mm/page_alloc.c is using bit OR than logical OR
>
> @@ -450,9 +450,9 @@ static inline void __free_one_page(struc
>
>  static inline int free_pages_check(struct page *page)
>  {
> -       if (unlikely(page_mapcount(page) |
> -               (page->mapping != NULL)  |
> -               (page_count(page) != 0)  |
> +       if (unlikely(page_mapcount(page) ||
> +               (page->mapping != NULL)  ||
> +               (page_count(page) != 0)  ||
>                 (page->flags & (
>                         1 << PG_lru     |
>                         1 << PG_private |

Because the positive case is extremely rare, so there is no benefit (nor
any correctness requirement) for short-circuit evaluation, and we don't
want to have all the branches that it involves. I think it is 3 more
conditional jumps.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ