Mercurial > hg > nginx
comparison src/core/ngx_cpuinfo.c @ 1872:8e88522cb6da
detect L2 cache line size for Intel Core
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 29 Jan 2008 07:06:18 +0000 |
parents | 9afb84c7cc61 |
children | b863be280d3b |
comparison
equal
deleted
inserted
replaced
1871:9afb84c7cc61 | 1872:8e88522cb6da |
---|---|
94 | 94 |
95 switch ((cpu[0] & 0xf00) >> 8) { | 95 switch ((cpu[0] & 0xf00) >> 8) { |
96 | 96 |
97 /* Pentium */ | 97 /* Pentium */ |
98 case 5: | 98 case 5: |
99 ngx_cacheline_size = 32; | |
100 break; | |
101 | |
99 /* Pentium Pro, II, III */ | 102 /* Pentium Pro, II, III */ |
100 case 6: | 103 case 6: |
101 ngx_cacheline_size = 32; | 104 ngx_cacheline_size = 32; |
105 | |
106 if ((cpu[0] & 0xf0) >= 0xd0) { | |
107 /* Intel Core */ | |
108 ngx_cacheline_size = 64; | |
109 } | |
110 | |
102 break; | 111 break; |
103 | 112 |
104 /* | 113 /* |
105 * Pentium 4, although its cache line size is 64 bytes, | 114 * Pentium 4, although its cache line size is 64 bytes, |
106 * it prefetches up to two cache lines during memory read | 115 * it prefetches up to two cache lines during memory read |