Re: [PATCH v2 net-next] inet: Get critical word in first 64bit of cache line

Eric Dumazet
2013-02-04T03:11:31Z

On Mon, 2013-02-04 at 10:53 +0800, Ling Ma wrote:
> I attached my test program(we force all cpu loads issue one by one ,
> and avoid cpu hardwre prefetch cc -o test-cwf test-cwf.c.) and
> cpu-info, the result from ./test-cwf indicates as below:
> looking-up aligned time 157000272, looking-up unaligned time 162652724
> If I was wrong please correct me.

I have no idea why you use assembly code.

unsigned long lookingup_memmory(char *access, int num)
{
__asm__("sub $1, %rsi");
__asm__("xor %rax, %rax");
__asm__("1:");
__asm__("mov (%rdi), %r8");
__asm__("add %r8, %rax");
__asm__("mov %r8, %rdi");
__asm__("sub $1, %rsi");
__asm__("jae 1b");
}

Your program is really hard to read.