Eric Dumazet a écrit :

ffffffff8011db70 <pfn_to_page>: /* pfn_to_page total: 487244  0.8036 */
18501 0.0305 :ffffffff8011db70: mov 2965994(%rip),%ecx # <memnode_shift>
 83312  0.1374 :ffffffff8011db76:       mov    %rdi,%rax
     2 3.3e-06 :ffffffff8011db79:       push   %rbp
               :ffffffff8011db7a:       shl    $0xc,%rax
 21880  0.0361 :ffffffff8011db7e:       mov    %rsp,%rbp
   601 9.9e-04 :ffffffff8011db81:       shr    %cl,%rax
:ffffffff8011db84: movzbq 0xffffffff803f0d60(%rax),%rax 56462 0.0931 :ffffffff8011db8c: mov 0xffffffff804264e0(,%rax,8),%rcx
    26 4.3e-05 :ffffffff8011db94:       mov    %rdi,%rax
     1 1.6e-06 :ffffffff8011db97:       sub    0x3340(%rcx),%rax
164872  0.2719 :ffffffff8011db9e:       lea    0x0(,%rax,8),%rdx
    43 7.1e-05 :ffffffff8011dba6:       shl    $0x6,%rax
               :ffffffff8011dbaa:       sub    %rdx,%rax
 73574  0.1214 :ffffffff8011dbad:       add    0x3330(%rcx),%rax
    38 6.3e-05 :ffffffff8011dbb4:       leaveq
 67932  0.1120 :ffffffff8011dbb5:       retq

Some comments about pfn_to_page()

1) reorder struct pglist_data
-----------------------------
0x3340(%rcx) is node_start_pfn, and 0x3330(%rcx) is node_mem_map

These offsets show they may be in different cache lines.

Maybe we should change 'struct pglist_data' ordering so that those two fields are in the same memory cache line ?

2) Place memnodeshift in front of memnodemap
---------------------------------------------

For most setups, only the first bytes in memnodemap[] are read.

And the linker usually puts memnodeshift AFTER memnodemap.
Two different cache lines are used.

I suggest the following change (seems better than playing vmlinux.lds games)

include/asm-x86_64/mmzone.h
struct memnode {
    int shift;
    u8 map[NODEMAPSIZE];
} ____cacheline_aligned;
extern struct memnode memnode;
#define memnode_shift memnode.shift
#define memnodemap memnode.map


Thank you

Eric

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to