mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2009-04-02, 14:41   #1
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

2·23·173 Posts
Default Windows Vista privileges help please

I'm trying to get the following code to run (required for allocating large pages in Vista):


{
LPVOID p;
// Grant large page access
HANDLE hToken;
OpenProcessToken(
GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES,
&hToken
);

LUID luid;
LookupPrivilegeValue(
NULL,
"SeLockMemoryPrivilege",
&luid
);

TOKEN_PRIVILEGES tp;
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(
hToken,
FALSE,
&tp,
sizeof(TOKEN_PRIVILEGES),
(PTOKEN_PRIVILEGES)NULL,
(PDWORD)NULL
);
x = GetLastError ();

Alas, x is 1300. After hours of googling, it seems MS has eliminated editing of Local Security Policies in Vista Home. Thanks, MS. I found a utility that calls ntrights.exe that should have given me the SeLockMemoryPrivilege, but I still get error 1300.

This is very depressing. Even if I can allocate large memory pages and get a performance boost, only a handful of users will be able to benefit. Few will be willing to tamper with security settings to allow large pages. Furthermore, since large memory pages are not swapped out, prime95 would impact performance when a machine is low on memory.

Anyway, does anyone know how I can get the code above to work or how I can change my security policies so that the code above works?

Last fiddled with by Prime95 on 2009-04-02 at 14:42
Prime95 is offline   Reply With Quote
Old 2009-04-02, 23:52   #2
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

22·5·587 Posts
Default

Hi, George:

I can't help you with getting-this-to-run-under-Vista, but am curious as to how much of a performance boost you get from large-paging for the 32-bit code.
ewmayer is offline   Reply With Quote
Old 2009-04-03, 00:19   #3
potonono
 
potonono's Avatar
 
Jun 2005
USA, IL

19310 Posts
Default

User Account Control (UAC) in Vista tells the PC that you don't have access to run code that requires administrative access even if you're user ID is listed as an administrator (which is considered a filtered administrator). By default, both the local 'administrator' and 'domain/administrator' accounts are disabled. Have you enabled either of those and are logged in as one of them (or can you attempt to run your program as one of them)?
potonono is offline   Reply With Quote
Old 2009-04-03, 02:26   #4
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

795810 Posts
Default

Cool, after rebooting (to install this weeks latest security updates) the code above is now working. I successfully allocated a 2MB page.

Now I can test whether 2MB pages have a significant impact on performance. Although, I'm doubtful I can ever make this part of a real release. It is way too hard to get privileges right, and locking down large swaths of memory might be considered bad form.
Prime95 is offline   Reply With Quote
Old 2009-04-03, 05:17   #5
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

11110000011002 Posts
Default

Quote:
Originally Posted by Prime95 View Post
Although, I'm doubtful I can ever make this part of a real release.
You could make it "prime95 SE", with release only to the cognoscenti.
cheesehead is offline   Reply With Quote
Old 2009-04-03, 05:42   #6
RMAC9.5
 
RMAC9.5's Avatar
 
Jun 2003

32×17 Posts
Default

I agree with cheesehead. If 2 MB pages make a noticeable performance difference, those of us with dedicated Prime95 PCs would certainly use a "special" Prime95 version on their dedicated PCs. Especially if it came with a Windows XP/Vista how to set up permissions "cookbook". This idea sounds very promising as I know that AMD has hardware support for 2 MB pages on their 64 bit CPUs.

Last fiddled with by RMAC9.5 on 2009-04-03 at 05:44
RMAC9.5 is offline   Reply With Quote
Old 2009-04-03, 15:44   #7
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

2·23·173 Posts
Default

Quote:
Originally Posted by RMAC9.5 View Post
I agree with cheesehead. If 2 MB pages make a noticeable performance difference...
We should know within a week. I was able to get a 58MB allocation on my system shortly after a reboot. Now I have to make the FFT code allocate and use the large page memory.
Prime95 is offline   Reply With Quote
Old 2009-04-04, 19:32   #8
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

2×23×173 Posts
Default

I'm having trouble timing this - probably due to Vista running under VMware. Best I can tell is large pages don't help. Of course, I didn't modify the FFT code to yank out the TLB priming that should be unnecessary with large pages. Maybe someday I'll move Vista over to a stand-alone computer. In the meantime, I'll leave the code in prime95 so that y'all can run your own benchmarks in 25.10.

Last fiddled with by Prime95 on 2009-04-04 at 19:32
Prime95 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tax the rich, land and privileges, then nothing else jasong Soap Box 15 2013-01-06 20:59
Vista vs. XP for LL Rodrigo Software 57 2012-06-17 05:50
Vista + Windows Defender = No Prime95? Xyzzy Software 2 2008-07-12 07:03
Saving Progress on windows vista? julian_emilio Software 1 2007-03-30 17:17
Prime95 on Windows Vista Kaboom Software 10 2007-03-13 03:42

All times are UTC. The time now is 02:20.


Thu Aug 18 02:20:09 UTC 2022 up 41 days, 21:07, 1 user, load averages: 1.45, 1.43, 1.32

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔