Re: [PATCH RFC 2/2] mm: introdule compound_head_by_tail()

From: Jianyu Zhan
Date: Mon Apr 28 2014 - 12:24:55 EST


On Mon, Apr 28, 2014 at 11:55 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> What version,

the code snipt in question is extracted from v3.15-rc3.


for the (1) check in previous email, its assembled code looks like:

--- (1) snipt ---
mov (%rdi),%rax (a)
test $0x80,%ah (b)
jne 754 <put_compound_page+0x74> (c)
--- (1) snipt ---

(a) %rdi is the struct page pointer
(b) check if PG_tail(0x80) set(likely not set, we tell the compiler)
(c) if set, jump; not set, fall through (good, credit to our hint)

===================================================

for the (3) check in previous email, its assembled code looks like:

--- (3) snipt ---
mov (%rdi),%rax (A)
mov %rdi,%r12
test $0x80,%ah (B)
jne 8f8 <put_compound_page+0x218> (C)
--- (3) snipt ---

(A) %rdi is the struct page pointer
(B) check if PG_tail(0x80) set(likely set in this case, but we
tell compiler unlikely)
(C) if set, jump; not set, fall through (god! it would better
not jump if set, but we
tell compiler unlikely, so it happily did as we told it)


# all code are compiled by gcc (GCC) 4.8.2

> and why didn't your changelog include this useful information?

Sorry, I would have done so. I will resend the patch.

Thanks,
Jianyu Zhan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/