Better test case timings: I changed from doing entire linear write testing to just touching the pages, to take memory bandwidth out of the equation. VirtualAlloc takes 0ms on 4k pages, 6ms on 2mb pages. Fault handling takes 60ms on 4k pages, 0ms on 2mb pages. So that's that.
-
Show this thread
-
Which makes me really want some kind of VirtualAlloc flag :) I don't think there's any practical reason we can't have close to the 6/0ms case with 4k pages, if it's handled in bulk, rather than as a continuous series of faults?
1 reply 0 retweets 10 likesShow this thread -
(And just to be clear, the reason I can't "just use 2mb pages" is because you basically can't ship something that uses 2mb pages - it requires the user to do a manual group policy edit to enable!)
1 reply 0 retweets 18 likesShow this thread -
Replying to @cmuratori
wait what!? so they added bigger pages to the ISA and we just don't use them?
1 reply 0 retweets 0 likes -
Replying to @codaaaaaaaaa
Correct. You can see a 2011 legacy explanation from Raymond Chen here: https://devblogs.microsoft.com/oldnewthing/20110128-00/?p=11643 … In my opinion, none of the things he says are true today, but, I guess this part of the kernel has still not been updated since then? I don't know :(
2 replies 0 retweets 5 likes -
Replying to @cmuratori @codaaaaaaaaa
So what would you do if you had to page in a 2MB page when there isn't 2MB of contiguous physical memory?
2 replies 0 retweets 0 likes -
Replying to @ChenCravat @codaaaaaaaaa
I understand that this is apparently a concern, but I'm not sure I understand why. On modern machines that all have 16+gb of memory, is there some reason the OS can't just sub-divide 4k pages from 2mb pages, and evict all 512 4k pages when deciding to swap in a 2mb page?
2 replies 0 retweets 3 likes -
That is assuming there are backwards compatibility reasons why you have to keep supporting 4k pages in "compatibility" mode, etc. - I can't honestly see there being a point to 4k pages for the normal case of modern apps that all use literally gigabytes of memory?
1 reply 0 retweets 7 likes -
Also, paging is kind of for chumps anyway? Like, the OS probably has to support it, but you don’t actually want to be doing it ever, so, probably should not design for that as a primary use case.
2 replies 0 retweets 16 likes -
Replying to @Jonathan_Blow @cmuratori and
Writing 2MiB to NVMe should be microseconds, so we should instead be having this conversation about 1GiB pages
2 replies 0 retweets 3 likes
Well obviously I would love to be having this conversation about 1gb pages but at the moment Windows won't even give me 2mb pages without a group policy edit, so I am assuming 1gb pages are just a beautiful dream.
-
-
Replying to @cmuratori
Out of curiosity, if you are allocating ~1GiB, it is possible Windows is giving you a 1GiB page. Maybe check alignment? Or allocate less and see if performance changes. Does the Windows zero page thread pre-zero large pages? I guess moot since you still have to deal with admin...
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.