Mail Archives: cygwin/2019/08/07/15:28:52
X-Recipient: | archive-cygwin AT delorie DOT com
|
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
|
| :list-unsubscribe:list-subscribe:list-archive:list-post
|
| :list-help:sender:from:reply-to:to:subject:date:message-id
|
| :content-type:content-transfer-encoding:mime-version; q=dns; s=
|
| default; b=GREicc0+VOtWb/fBifheo+BiKG/hjtw/TVp5FFxcbutrKziz9iEYf
|
| 5d6QHnGxlIdZBbLXb/TKOays5RSqVCfYUik0iVGTnBTIyiv8Qkj5xfu9WY3Dl3Cl
|
| V+Ww7AGuevc3845HbWA99mEPIHPWDBh3ZCvalDURTgL87fRVe1zAyk=
|
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
|
| :list-unsubscribe:list-subscribe:list-archive:list-post
|
| :list-help:sender:from:reply-to:to:subject:date:message-id
|
| :content-type:content-transfer-encoding:mime-version; s=default;
|
| bh=S0pblUg05hL/kd2EkZcAOrl+AJs=; b=lSlEKeJoo4FjYGeciRgdN42FIuoG
|
| XsQ8wruboSE0yNXj1mPktkLUqMBC6/1MbIm+GmPPvcusLoWe+6LIiRZytH3NAb+x
|
| jC0UqBpfgNL8r3d6w9/hX0KJikHQmd3TholGP6Tu5XjRbajOSo7QGDs4rLOI8ClD
|
| 01cCIJnjvB2WVCk=
|
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm
|
List-Id: | <cygwin.cygwin.com>
|
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com>
|
List-Archive: | <http://sourceware.org/ml/cygwin/>
|
List-Post: | <mailto:cygwin AT cygwin DOT com>
|
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
|
Sender: | cygwin-owner AT cygwin DOT com
|
Mail-Followup-To: | cygwin AT cygwin DOT com
|
Delivered-To: | mailing list cygwin AT cygwin DOT com
|
Authentication-Results: | sourceware.org; auth=none
|
X-Spam-SWARE-Status: | No, score=-14.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=
|
X-HELO: | nihcesxway2.hub.nih.gov
|
DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.gov; i=@nih.gov; q=dns/txt; s=NIH; t=1565206078; x=1596742078; h=from:to:subject:date:message-id: content-transfer-encoding:mime-version; bh=8GcL6oHbOVm7yNg/53WhmQzF2lnhspfFI8tjr/ilml8=; b=dpxMJy0kdq1G/cteQ/4YH4RQTzWlQAMGgyFD2HQDvAYMpt2Vy1w3Dm7Q ZCOVmas67oIC+EFilJOJqm3QZ1hm6wQTKCX5q4pKAqH2t5gOt2lL7axqS CEwo+/xX2+JTThZrLMkXUasbcZn13fkAU5JbV2ugR9gEG/lQrW0QzNlm9 2LmnGw5FMpKNywiO+exgkcsrLRlTiSnbSsDSjx0lQnR5ZiDRuFNrGO4lQ tUsnExGGqDNwarmxExIFJWWuHDWSEyxgXLZJOsReI7R+06eu60qZBipqY H075foa98Ws7veN7D3dogP4Ze3+drs1ajGd3QobyFT5wwiHmVBXOrzp+l A==;
|
IronPort-SDR: | G7dPoV9oS72NY5h34alLe2PEUSz8DbT+jxxwLQWHjHW5Oa2Z6eJYNNPm0qtcDL+I9qKh76A9Rx 0Xy1RsQsteS/AI1B5SCR6cEYGZG73NfruSJv00Ck3vQSa4Qz1+AzhxPO5t+l+UGfl/yPt07xtl Ld4WQAeybyGKHjlnku/P9ft9rPKbZoM2Mv4hsYc3vRs9Yu5/jEDEdexybTSuwmW33fB2B8l2Ic qbytNPcRbdGpvWDXyssFr/57/5S8/R+SHrYSRcDbYVdhPaAToECcPTZa9Hs+WKXS9Iimuz+GfW tpk=
|
ARC-Seal: | i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aff1Kggwdi8nA9D6hMLzBn2T/Bw9iE2eQbnKj0KYiLkopGATqxJXksBhnzmnSV4VsXxjKchtJC4nCHDEmqVDWFRtV1QIc3HKEU1nd6UCeSlco5Ufr4Pup6LApTrsSHL0WrhPjUKp4vdKj/ABTjIzmaSj5YKGMg1KalVkmgJukNVBAp9zQZfLRuA6B0ft2gHMlv+DYXCIUcqA4QwyyyhxLqUSonx5dYFuNU8AmrhxYZN7V+CK5+gaEuW/Uw1PSLAJbMP9oLNP5f6cWioBIzb/vqy2G4VgjlyiaELya3x65Lipsxq2pqzM57CpQEXcYhcbiRRjyt5d91SrZljy5o102A==
|
ARC-Message-Signature: | i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8GcL6oHbOVm7yNg/53WhmQzF2lnhspfFI8tjr/ilml8=; b=Yo0WZUqPMco+Qy3xjSajzT1R5cfrl912BzQL2vdT7COYPszjHynx9+QpJDSbhaPpSY1qsmUp5XpXtNC6jfmUAkiqfWsz45MnlyMWJup41v+hsKxCSINXoy1dtgHCvOxOYnOoHs7rk1dm+7JW40En77srwVWl8+K4P11IImarSjNDx/2IMcF4hfIQSyNlOyU93et2mp6jM5DmTd8kKN6wNTvYznQkuPhqKjukrd9opj9F9bgpzPHbnl9S6rwPVlpZs750rbbLbfNlnXkCGvdAlUom8jceUyb5vGGaf3IYYesSV2GPgisIWOb6ExH5/Oi6BBnBivHCF2P8J5WN03IGWw==
|
ARC-Authentication-Results: | i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ncbi.nlm.nih.gov; dmarc=pass action=none header.from=ncbi.nlm.nih.gov; dkim=pass header.d=ncbi.nlm.nih.gov; arc=none
|
DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.onmicrosoft.com; s=selector1-nih-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8GcL6oHbOVm7yNg/53WhmQzF2lnhspfFI8tjr/ilml8=; b=P2UdNGIOtwdL22TaJ9e3UqPFXKTaqo/h0E1k6QD/yLwRj6wg7G+UDAYIIiOjw8nLviAD8M86kuD1dove7KddgZPdivh3qgU5pZ2+vG0lrXxx9grtwvwe2NrRrqScwPNlSaB+0eUWMgJm5x4mTIncG7uNaJeQo8U/NgI1u/fAQvQ=
|
From: | "Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" <cygwin AT cygwin DOT com>
|
Reply-To: | "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr AT ncbi DOT nlm DOT nih DOT gov>
|
To: | "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
|
Subject: | Re: getpriority() and top display for priority is inconsistent
|
Date: | Wed, 7 Aug 2019 19:27:41 +0000
|
Message-ID: | <BL0PR0901MB4308A80219F99EEFE71EDA93A5D40@BL0PR0901MB4308.namprd09.prod.outlook.com>
|
authentication-results: | spf=none (sender IP is ) smtp.mailfrom=lavr AT ncbi DOT nlm DOT nih DOT gov;
|
x-ms-oob-tlc-oobclassifiers: | OLM:7219;
|
x-ms-exchange-senderadcheck: | 1
|
x-ms-exchange-transport-forked: | True
|
MIME-Version: | 1.0
|
X-MS-Exchange-CrossTenant-mailboxtype: | HOSTED
|
X-MS-Exchange-CrossTenant-userprincipalname: | 6I6c3HMxyfRWbOk/+B1B9x4tbQo6uTU8iyx1zRNjBOjdkGY+NzmoKPYzk4qvkK8g
|
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id x77JSbrC030727
|
> Please give it a try.
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 2a06554..2305b53 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -1076,7 +1076,7 @@ format_process_stat (void *data, char *&destbuf)
unsigned long fault_count = 0UL,
vmsize = 0UL, vmrss = 0UL, vmmaxrss = 0UL;
uint64_t utime = 0ULL, stime = 0ULL, start_time = 0ULL;
- int priority = 0;
+
if (p->process_state & PID_EXITED)
strcpy (cmd, "<defunct>");
else
@@ -1105,7 +1105,6 @@ format_process_stat (void *data, char *&destbuf)
HANDLE hProcess;
VM_COUNTERS vmc = { 0 };
KERNEL_USER_TIMES put = { 0 };
- PROCESS_BASIC_INFORMATION pbi = { 0 };
QUOTA_LIMITS ql = { 0 };
SYSTEM_TIMEOFDAY_INFORMATION stodi = { 0 };
@@ -1134,11 +1133,6 @@ format_process_stat (void *data, char *&destbuf)
if (!NT_SUCCESS (status))
debug_printf ("NtQueryInformationProcess(ProcessTimes): status %y",
status);
- status = NtQueryInformationProcess (hProcess, ProcessBasicInformation,
- (PVOID) &pbi, sizeof pbi, NULL);
- if (!NT_SUCCESS (status))
- debug_printf ("NtQueryInformationProcess(ProcessBasicInformation): "
- "status %y", status);
status = NtQueryInformationProcess (hProcess, ProcessQuotaLimits,
(PVOID) &ql, sizeof ql, NULL);
if (!NT_SUCCESS (status))
@@ -1159,17 +1153,11 @@ format_process_stat (void *data, char *&destbuf)
* CLOCKS_PER_SEC / NS100PERSEC;
else
start_time = (p->start_time - to_time_t (&stodi.BootTime)) * CLOCKS_PER_SEC;
- /* The BasePriority returned to a 32 bit process under WOW64 is
- apparently broken, for 32 and 64 bit target processes. 64 bit
- processes get the correct base priority, even for 32 bit processes. */
- if (wincap.is_wow64 ())
- priority = 8; /* Default value. */
- else
- priority = pbi.BasePriority;
unsigned page_size = wincap.page_size ();
vmsize = vmc.PagefileUsage;
vmrss = vmc.WorkingSetSize / page_size;
vmmaxrss = ql.MaximumWorkingSetSize / page_size;
+ int nice = winprio_to_nice(GetPriorityClass(hProcess));
destbuf = (char *) crealloc_abort (destbuf, strlen (cmd) + 320);
return __small_sprintf (destbuf, "%d (%s) %c "
@@ -1181,7 +1169,7 @@ format_process_stat (void *data, char *&destbuf)
p->pid, cmd, state,
p->ppid, p->pgid, p->sid, p->ctty, -1,
0, fault_count, fault_count, 0, 0, utime, stime,
- utime, stime, priority, 0, 0, 0,
+ utime, stime, NZERO + nice, nice, 0, 0,
start_time, vmsize,
vmrss, vmmaxrss
);
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -