RE: BUG: WinCE is slow on x86
- From: Rob <__rob_AT_robtso_DOT_nl__>
- Date: Thu, 4 Jun 2009 04:04:01 -0700
Hi Antonie,
Nice work !
I am very curious about the ethernet fix.
Since I'm working on an application that uses ethernet a lot.
I was not aware CE's ethernet is not as efficient as XP's....
Is that fix also only for X86, or any processor ? (I use pxa270 now...)
Groeten,
Rob.
www.robtso.nl
"Antonie van Woerdekom" wrote:
Hi all,.
I have been working with WinCE on x86 for quite some years now, and it has
always buged me that WinCE seemd to be much slower than XP on the same
hardware. This led me to do some serious profiling.
When running the montecarlo profiler on an x86, you immediately see a number
of functions in coredll.dll and in nk.exe poping up high on the list, so at
first you think that these functions execute a lot of code.
Closer inspection shows that there is really no reason why these need to be
slow. I also did some more tests, simply calling GetTickCount() in a loop. As
you may know, the GetTickCount() function only reads one of the kernel
variables - and should be blazingly fast.
Making a long story short, it turns out that WinCE puts the kernel variables
in uncached memory. This happens (on CE 5.0) in the file
C:\WINCE500\PRIVATE\WINCEOS\COREOS\NK\INC\mem_x86.h
There is a line that reads:
#define KPAGE_PTE (LIN_TO_PHYS(KDBase) + PG_VALID_MASK + PG_CACHE_MASK +
PG_USER_MASK)
The bug is the PG_CACHE_MASK. On x86, when the mask is 1, this means that
the page is uncached. Set it to 0 by replacing the above line with
#define KPAGE_PTE (LIN_TO_PHYS(KDBase) + PG_VALID_MASK + PG_CACHE +
PG_USER_MASK)
recompile your kernel, and just see your code fly. The same bug is also in
WinCE 6.0. Its got the same line of code, its in another file in the same
folder.
--
Antonie van Woerdekom
PS: Do you like this fix? I have an even better one for ethernet drivers. I
get the same TCP/IP thoughput using WinCE and WinXP at the same CPU load! Do
you want me to post that fix?
- References:
- BUG: WinCE is slow on x86
- From: Antonie van Woerdekom
- BUG: WinCE is slow on x86
- Prev by Date: Re: Synchronize Issue
- Next by Date: Re: SDIO suspend and resume...
- Previous by thread: RE: BUG: WinCE is slow on x86
- Next by thread: Re: BUG: WinCE is slow on x86
- Index(es):
Relevant Pages
|
Loading