Live data from Hacker News

Windows 10 works incorrectly with Large memory pages

sourceforge.net

71–80 of 96 posts

Re: Windows 10 works incorrectly with Large memory pages

#71

    // A Windows bug exists where a VirtualAlloc call immediately after VirtualFree
    // yields a page that has not been zeroed. The returned page is asynchronously
    // zeroed a few milliseconds later, resulting in memory corruption. The same bug
    // allows VirtualFree to return before the page has been unmapped.
I wonder what MSRC would think of that bug

Re: Windows 10 works incorrectly with Large memory pages

#72

Earlier quoted context omitted.

Api abuse should not lead to system crashes or global memory corruption.

Large pages cannot be paged to disk (lol: amount of time to write 2MB to disk while the scheduler is locked), and are prone to fragmentation. When you use Large Pages and you run out of contiguous 2MB chunks, what do you do then? Unlike Linux, Windows actually guarantees its memory to anything that requested it. Windows does NOT ever "take back" memory and crash processes randomly (see Linux's OOM killer). But this g…

Well technically you could just defragment your physical ram to free up contiguous memory, this is also what Linux does with thp enabled.

But, unless the analysis in the OP is wrong the problem stems from Windows handing out freed huge-pages again before zeroing them, so whichever program gets the page the second time might write data to it and then have it wiped a moment later, which sounds like a plain bug to me.

Re: Windows 10 works incorrectly with Large memory pages

#73
post #43

Earlier quoted context omitted.

Heh, yeah, I'm not buying it. How long has the "Windows 10 Start Menu stopped working" bug been around now? And the most consistent fix is still to just do an in-place reinstall?

Yep. This shoots me in the face at least once a week. Also two other problems: 1. The start menu latency is now so bad you have to forcibly wait 2-3 seconds before typing your search after hitting the start button. This is on a stacked E5 Xeon workstation class machine. 2. Search is crap. I can type "visual" and visual studio doesn't come up!?!?

I noticed recently that typing “eclipse” or any variant thereof won’t find eclipse. (On my machine, anyway) I have to do “java eclipse” or something.

Some of the problems I understand; “regedit” has to match exactly because it’s basically doing the “run” dialog box. But no idea why other stuff can’t be searched for.

Re: Windows 10 works incorrectly with Large memory pages

#74
post #65
post #43

Earlier quoted context omitted.

Yep. This shoots me in the face at least once a week. Also two other problems: 1. The start menu latency is now so bad you have to forcibly wait 2-3 seconds before typing your search after hitting the start button. This is on a stacked E5 Xeon workstation class machine. 2. Search is crap. I can type "visual" and visual studio doesn't come up!?!?

Classic Shell. There is literally zero usable improvement in the new Start Menu. With how buggy it is, it's literally only worse than it ever has been.

I was using that but apparently development is now dead http://www.classicshell.net/forum/viewtopic.php?f=4&t=8147

Re: Windows 10 works incorrectly with Large memory pages

#75

Earlier quoted context omitted.

Large pages cannot be paged to disk (lol: amount of time to write 2MB to disk while the scheduler is locked), and are prone to fragmentation. When you use Large Pages and you run out of contiguous 2MB chunks, what do you do then? Unlike Linux, Windows actually guarantees its memory to anything that requested it. Windows does NOT ever "take back" memory and crash processes randomly (see Linux's OOM killer). But this g…

Well technically you could just defragment your physical ram to free up contiguous memory, this is also what Linux does with thp enabled. But, unless the analysis in the OP is wrong the problem stems from Windows handing out freed huge-pages again before zeroing them, so whichever program gets the page the second time might write data to it and then have it wiped a moment later, which sounds like a plain bug to me.

I don't think THP is a good example, because its not considered very stable actually.

https://oracle-base.com/articles/linux/configuring-huge-page...

> That sounds like a good idea, but unfortunately Transparent HugePages don't play well with Oracle databases and are associated with node reboots in RAC installations and performance problems on both single instance and RAC installations. As a result Oracle recommends disabling Transparent HugePages on all servers running Oracle databases, as described in this MOS note.

-------------

Anyway, the very point of huge-pages is to gain ~3% to 5% faster program speed by keeping more of the memory-management units of the OS inside of the TLB-cache of the CPU.

Running a background thread to defragment the physical memory system of your computer WHILE your critical tasks are running... very most likely kills the performance benefit you were trying to get.

Linux's raw Hugepages work fine, but have their own set of drawbacks as I described in the previous post. For the moment, it seems like a better idea to use "normal" Linux Huge Pages than to use the THP. Indeed, I'm seeing reports that some people get 10s of millisecond pauses when their application does a 32-byte malloc with THP enabled (Linux Kernel decides to garbage collect + defragment + turn your pages into a Huge Page). A lot of programs don't expect a tiny malloc to cause such a major performance hit randomly (ie: video games).

https://groups.google.com/forum/#!topic/mechanical-sympathy/...

https://access.redhat.com/solutions/1560893

---------------------

Best practice (in both Linux AND Windows) is:

* Code your program to accept Large Pages if possible. But consider the failure case, and fall-back to normal 4kB pages if you fail.

* If performance is CRITICAL (ie: servers), then allocate the large page at the beginning of the program, and NEVER LET IT GO. Start the program early when the OS boots up to ensure that Large Pages are available.

* Linux's alternative is to have the human / SysAdmin manage large pages manually. Divy them out to the programs as needed. Which works just fine, although its a bit of a hassle.

Re: Windows 10 works incorrectly with Large memory pages

#76

Earlier quoted context omitted.

And yet it is about 100x as useful as most free software that does. One wonders whether that is coincidence or correlation. I don't know Igor, but if 7z is anything to go by then he probably uses VC--I'm guessing here--6 for the same reason Sean Barrett does: It's way faster and less bloated than modern VS. I'm also guessing he doesn't use those security features because they're largely ineffective and just complicat…

There's a big difference between quality code and being a cowboy. > I don't know Igor, but if 7z is anything to go by then he probably uses VC--I'm guessing here--6 for the same reason Sean Barrett does: It's way faster and less bloated than modern VS. Then they should learn how to download the SDK and learn to use the command line to properly compile code with proper ASLR and other such security features. Keep worki…

counterpoint: please cite a single arbitrary code execution vulnerability that was found in 7z.exe

Re: Windows 10 works incorrectly with Large memory pages

#77

Earlier quoted context omitted.

There's a big difference between quality code and being a cowboy. > I don't know Igor, but if 7z is anything to go by then he probably uses VC--I'm guessing here--6 for the same reason Sean Barrett does: It's way faster and less bloated than modern VS. Then they should learn how to download the SDK and learn to use the command line to properly compile code with proper ASLR and other such security features. Keep worki…

counterpoint: please cite a single arbitrary code execution vulnerability that was found in 7z.exe

Your wish is granted?

https://www.cvedetails.com/cve/CVE-2016-2334/

I mean, there are easy databases to look for these sorts of questions...

Re: Windows 10 works incorrectly with Large memory pages

#78
post #66

So, as much as I hate to hate on somebody here, Igor is... somewhat unreliable with regards to these issues. Igor is infamous for disabling virtually every setting. 7-Zip has no ASLR, compiler-stack checks, or anything what-so-ever. Igor refuses to use a modern VC++ (Visual Studio 2015 and later have FREE versions available for open-source code) that would solve a lot of security issues and bugs. I'm not entirely sur…

Are there any other decent archiver programs for Windows? Explorer has had built in unzip functionality for a while but it's ridiculously slower than 7-Zip.

I looked a while ago to find alternatives when some of these issues came up a while ago but I haven't found any other viable alternatives. I thought PeaZip might be a good option until finding out that it is also based on 7-Zip.

The one tool that I did find useful during this search though is https://github.com/ImminentFate/CompactGUI.

Apparently in Win10, Microsoft introduced a compact.exe commandline tool that transparently compresses files/folders. The above tool is a GUI for it. It's not a replacement for a proper archiver but it's a nice tool to compress things like games and other large programs that need to stay in place.

Re: Windows 10 works incorrectly with Large memory pages

#79

Earlier quoted context omitted.

counterpoint: please cite a single arbitrary code execution vulnerability that was found in 7z.exe

Your wish is granted? https://www.cvedetails.com/cve/CVE-2016-2334/ I mean, there are easy databases to look for these sorts of questions...

Looks like that exploit will not work on x64 builds (the only thing anyone should be running in 2018) due to DEP

Re: Windows 10 works incorrectly with Large memory pages

#80
post #2

For all the improvements to Windows that have come from Microsoft thanks Nadella & co., it is still rather shocking to realize Windows has no public bug tracker, and no real way to report these issues besides screaming loudly and hoping someone in Redmond hears you. It's even worse customer service than Google, which is quite an achievement.

Wait, Google has customer service? The googleproductforum.com (whatever it's called) which is usually the #1 result in Google is absolutely worthless. I am not joking. It is infuriatingly worthless.

Yes, that forum is utterly useless. The trick with google is to use only open source google products. If you find a bug in chromium, AOSP, or any of their other open projects, you can report them on their respective trackers.
Post reply on HN