mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
kernel32-K32GetPerformanceInfo: Remove patch set.
As of 8622eb326fb, SystemProcessInformation should now actually be reasonably fast, requiring only a couple of server calls. This patch set would make K32GetPerformanceInfo() even faster, but without any record of what it helps, it's not particularly likely that it's making a significant difference anymore.
This commit is contained in:
parent
b1765ff74e
commit
ebbd01086e
@ -7,7 +7,6 @@ Depends: ws2_32-WSACleanup
|
||||
Depends: server-Realtime_Priority
|
||||
Depends: advapi32-Token_Integrity_Level
|
||||
Depends: ntdll-Junction_Points
|
||||
Depends: kernel32-K32GetPerformanceInfo
|
||||
Depends: user32-rawinput-mouse
|
||||
Depends: server-Desktop_Refcount
|
||||
Disabled: true
|
@ -1,134 +0,0 @@
|
||||
From 659da72b956f4c59bc940736609fe8d52ec2d909 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 19 Feb 2017 05:38:40 +0100
|
||||
Subject: [PATCH] kernel32: Make K32GetPerformanceInfo faster.
|
||||
|
||||
---
|
||||
dlls/kernelbase/debug.c | 44 ++++++++++++++---------------------------
|
||||
server/process.c | 18 +++++++++++++++++
|
||||
server/protocol.def | 8 ++++++++
|
||||
3 files changed, 41 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c
|
||||
index 6acdf0f1ea9..8f021ebb0d2 100644
|
||||
--- a/dlls/kernelbase/debug.c
|
||||
+++ b/dlls/kernelbase/debug.c
|
||||
@@ -1449,7 +1449,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH K32GetPerformanceInfo( PPERFORMANCE_INFORMATION in
|
||||
{
|
||||
SYSTEM_PERFORMANCE_INFORMATION perf;
|
||||
SYSTEM_BASIC_INFORMATION basic;
|
||||
- SYSTEM_PROCESS_INFORMATION *process, *spi;
|
||||
DWORD info_size;
|
||||
NTSTATUS status;
|
||||
|
||||
@@ -1462,9 +1461,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH K32GetPerformanceInfo( PPERFORMANCE_INFORMATION in
|
||||
}
|
||||
|
||||
status = NtQuerySystemInformation( SystemPerformanceInformation, &perf, sizeof(perf), NULL );
|
||||
- if (!set_ntstatus( status )) return FALSE;
|
||||
+ if (status) goto err;
|
||||
status = NtQuerySystemInformation( SystemBasicInformation, &basic, sizeof(basic), NULL );
|
||||
- if (!set_ntstatus( status )) return FALSE;
|
||||
+ if (status) goto err;
|
||||
|
||||
info->cb = sizeof(*info);
|
||||
info->CommitTotal = perf.TotalCommittedPages;
|
||||
@@ -1478,37 +1477,24 @@ BOOL WINAPI DECLSPEC_HOTPATCH K32GetPerformanceInfo( PPERFORMANCE_INFORMATION in
|
||||
info->KernelNonpaged = perf.NonPagedPoolUsage;
|
||||
info->PageSize = basic.PageSize;
|
||||
|
||||
- /* fields from SYSTEM_PROCESS_INFORMATION */
|
||||
- NtQuerySystemInformation( SystemProcessInformation, NULL, 0, &info_size );
|
||||
- for (;;)
|
||||
+ SERVER_START_REQ( get_system_info )
|
||||
{
|
||||
- process = HeapAlloc( GetProcessHeap(), 0, info_size );
|
||||
- if (!process)
|
||||
+ status = wine_server_call( req );
|
||||
+ if (!status)
|
||||
{
|
||||
- SetLastError( ERROR_OUTOFMEMORY );
|
||||
- return FALSE;
|
||||
- }
|
||||
- status = NtQuerySystemInformation( SystemProcessInformation, process, info_size, &info_size );
|
||||
- if (!status) break;
|
||||
- HeapFree( GetProcessHeap(), 0, process );
|
||||
- if (status != STATUS_INFO_LENGTH_MISMATCH)
|
||||
- {
|
||||
- SetLastError( RtlNtStatusToDosError( status ) );
|
||||
- return FALSE;
|
||||
+ info->ProcessCount = reply->processes;
|
||||
+ info->HandleCount = reply->handles;
|
||||
+ info->ThreadCount = reply->threads;
|
||||
}
|
||||
}
|
||||
- info->HandleCount = info->ProcessCount = info->ThreadCount = 0;
|
||||
- spi = process;
|
||||
- for (;;)
|
||||
- {
|
||||
- info->ProcessCount++;
|
||||
- info->HandleCount += spi->HandleCount;
|
||||
- info->ThreadCount += spi->dwThreadCount;
|
||||
- if (spi->NextEntryOffset == 0) break;
|
||||
- spi = (SYSTEM_PROCESS_INFORMATION *)((char *)spi + spi->NextEntryOffset);
|
||||
- }
|
||||
- HeapFree( GetProcessHeap(), 0, process );
|
||||
+ SERVER_END_REQ;
|
||||
+
|
||||
+ if (status) goto err;
|
||||
return TRUE;
|
||||
+
|
||||
+err:
|
||||
+ SetLastError( RtlNtStatusToDosError( status ) );
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index 9482da98be5..9b7f10fffe5 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -1791,6 +1791,24 @@ DECL_HANDLER(resume_process)
|
||||
}
|
||||
}
|
||||
|
||||
+/* Retrieve process, thread and handle count */
|
||||
+DECL_HANDLER(get_system_info)
|
||||
+{
|
||||
+ struct process *process;
|
||||
+
|
||||
+ reply->processes = 0;
|
||||
+ reply->threads = 0;
|
||||
+ reply->handles = 0;
|
||||
+
|
||||
+ LIST_FOR_EACH_ENTRY( process, &process_list, struct process, entry )
|
||||
+ {
|
||||
+ if (!process->running_threads) continue;
|
||||
+ reply->processes++;
|
||||
+ reply->threads += process->running_threads;
|
||||
+ reply->handles += get_handle_table_count( process );
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* Get a list of processes and threads currently running */
|
||||
DECL_HANDLER(list_processes)
|
||||
{
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index bad8fef7903..cee75eff66d 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3945,3 +3945,11 @@ struct handle_info
|
||||
@REQ(resume_process)
|
||||
obj_handle_t handle; /* process handle */
|
||||
@END
|
||||
+
|
||||
+/* Return system information values */
|
||||
+@REQ(get_system_info)
|
||||
+@REPLY
|
||||
+ unsigned int processes; /* number of processes */
|
||||
+ unsigned int threads; /* number of threads */
|
||||
+ unsigned int handles; /* number of handles */
|
||||
+@END
|
||||
--
|
||||
2.27.0
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: Use separate wineserver call for kernel32.K32GetPerformanceInfo
|
@ -146,7 +146,6 @@ patch_enable_all ()
|
||||
enable_kernel32_Debugger="$1"
|
||||
enable_kernel32_FindFirstFile="$1"
|
||||
enable_kernel32_Job_Tests="$1"
|
||||
enable_kernel32_K32GetPerformanceInfo="$1"
|
||||
enable_kernel32_Processor_Group="$1"
|
||||
enable_kernel32_SetProcessDEPPolicy="$1"
|
||||
enable_krnl386_exe16_GDT_LDT_Emulation="$1"
|
||||
@ -529,9 +528,6 @@ patch_enable ()
|
||||
kernel32-Job_Tests)
|
||||
enable_kernel32_Job_Tests="$2"
|
||||
;;
|
||||
kernel32-K32GetPerformanceInfo)
|
||||
enable_kernel32_K32GetPerformanceInfo="$2"
|
||||
;;
|
||||
kernel32-Processor_Group)
|
||||
enable_kernel32_Processor_Group="$2"
|
||||
;;
|
||||
@ -3131,18 +3127,6 @@ if test "$enable_kernel32_Job_Tests" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset kernel32-K32GetPerformanceInfo
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/kernelbase/debug.c, server/process.c, server/protocol.def
|
||||
# |
|
||||
if test "$enable_kernel32_K32GetPerformanceInfo" -eq 1; then
|
||||
patch_apply kernel32-K32GetPerformanceInfo/0001-kernel32-Make-K32GetPerformanceInfo-faster.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "kernel32: Make K32GetPerformanceInfo faster.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset kernel32-Processor_Group
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
|
Loading…
x
Reference in New Issue
Block a user