RE: BUG: WinCE is slow on x86



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?
.



Relevant Pages

  • Re: WinCE is slow on x86
    ... I have been working with WinCE on x86 for quite some years now, ... it turns out that WinCE puts the kernel ... Do you like this fix? ...
    (microsoft.public.windowsce.platbuilder)
  • Re: APIC causes vr0 watchdog timeouts and Interrupt storms
    ... >>kernel and found that if I disabled APIC, ... >>ethernet issues or mouse isssues. ... Let me know if it doesn't fix your problem. ...
    (freebsd-current)
  • BUG: WinCE is slow on x86
    ... I have been working with WinCE on x86 for quite some years now, ... When running the montecarlo profiler on an x86, ... it turns out that WinCE puts the kernel variables ... Do you like this fix? ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Loosing Ethernet Connectivity
    ... Subject: Loosing Ethernet Connectivity ... restarting the machine using "reboot" will not fix the Problem. ... different Network Cards, on different Ethernet Cables, and with ... To unsubscribe, send any mail to "freebsd-questions- unsubscribe@xxxxxxxxxxx" ...
    (freebsd-questions)
  • Re: how to write Wifi IM driver???
    ... My IM always worked same way with Ethernet and WiFi, ... WinCE 4.2, but I do not think Windows NT differs in this. ... WiFi is the same as Ethernet except some additional OIDs supported (and used by ... where there is the NDIS edge of WAN miniport driver, ...
    (microsoft.public.development.device.drivers)

Loading