From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63355 invoked by alias); 6 Aug 2019 18:54:43 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 63347 invoked by uid 89); 6 Aug 2019 18:54:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: nihcesxway.hub.nih.gov Received: from nihcesxway.hub.nih.gov (HELO nihcesxway.hub.nih.gov) (128.231.90.123) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Aug 2019 18:54:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.gov; i=@nih.gov; q=dns/txt; s=NIH; t=1565117681; x=1596653681; h=from:to:subject:date:message-id: content-transfer-encoding:mime-version; bh=5gERPJpqEPGWcq/kG57GvB+OnCfQkelYeNTKrziWvm0=; b=NZSwbC6ypca67PTiOu6c/RquZ8zfnqMHOJKAgo1Xop+fDM+2kBZSRVkw wED6t58LYePm71H8iAkO8qX0MVi0jB3bkPW2oOdO7Vm4qa5sRncVGDmkY l/786XLih9fjzX6iTkfZkgUAPnIfmPYWnxZ56uQxyJ3WK2la+02BgG1Y7 UdvonnBuzayFYKNA7KOWABFeCu7S+mM0bMnmqpH5FS98LaKVAboKXbQrl GSCZ0iprtcjhdxs+aFqbP/O94yBmA6KBZBcBr71/3stYkS57o5lhy9Zcl DA/QzcEjzt6/rvfGKxKOy+DoG2yGV3fnLZ+p0u4wHHWuTnQ9VoCM+lnsi Q==; IronPort-SDR: /ORKr5snuU3pzXrQpwfwzKKBT8gtS0V84zhfvZRcSc2x/EQyThy/JUs7DNtr1fDW8LoRHsI/Oq 1ju5ovXpwawmw2gqi/o7iNnW7zm8WyuUIW9ok2SeUu8otmmFhwOgbYvsqGK1YpO74WoLiYWOwX xiKnqhHg7jV2seb7AmeKGFJlseRhF7pYHAMzL1H0UK+KNpgqaTCruEowEJa5JtCfjndOIa6tai XicDk0rXUQL5ZlioJGGj+zSqor+AHr1LLn3mZGePJaR2OpKm3ptZUNM2RbK40UG6m4a25J6hQ4 Iq8= Received: from uccsx01.nih.gov (HELO ces.nih.gov) ([165.112.194.91]) by nihcesxway.hub.nih.gov with ESMTP/TLS/ECDHE-RSA-AES256-SHA384; 06 Aug 2019 14:54:09 -0400 Received: from uccsX02.nih.gov (165.112.194.92) by uccsX01.nih.gov (165.112.194.91) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 6 Aug 2019 14:54:09 -0400 Received: from GCC02-DM3-obe.outbound.protection.outlook.com (165.112.194.6) by uccsX02.nih.gov (165.112.194.92) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 6 Aug 2019 14:54:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hXJVAEawnv8buiYFPD9Y70H46YXoLVcLMTs7ggaFDXavj7zxaFTAZrANbHgQgnVFfSOheYKEaB/Ty/WGU9W5EueaFZ5IznMMmeoskaYaf3jdwPhtk4b1i2XSJsO8PeSNabtbinqnzOwh4fMGO8tNqjTqNX0gPbfvnlUKWwSQm8MS/fRvgoVsUb6cks383iMuF+OVDYqficxMEogFw2RgT0CAOjldWky0x4lONFbGZr46IImXen+TULMVyksPfy0oKaXKpR5GIgwJ+SFbhv9GL3MboWJLp27gPXiBQeT7BNrU/0capDT84CXjxyXsPzcEsyIfkbYv9QCA0EuGNmh6aA== 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=5gERPJpqEPGWcq/kG57GvB+OnCfQkelYeNTKrziWvm0=; b=Gxoq54GXr3Swku3kUl6A5ifNNls9Ip+KWXDzr1cxvXWEsYHyq+eUQmiE8um7k9hkKIObv98/XiLhSAO6+KOYx9/8cwI9WYVD/m4HvpjekA281mQGbDp3RAdoyefaNWSJYcVfoXZnpx0D/aL67Qq1EVSBZl3Mf3Jz6Aj/V4xgqzvXj1kttWK9X7PZjQjMRJLTVJZRuZ5oYOe908wAnQ4x7SZxq9Z5/iuGy13DXQ43DKs9iU6+OaGvxAtaaU29rOrhROaDb3I31+aUaW29NBXE+eD+nVHl1oR2sL4N2gyajvnx5JNoAMi4eKd1t35Pf7zlUgXygkqot+2lRzGnyd+ZWw== 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=5gERPJpqEPGWcq/kG57GvB+OnCfQkelYeNTKrziWvm0=; b=lCK4KUQMH4n28uCnrfwvdCjmFv9o9snOIMwnLGanae0aVzvkaqcbQ+6/TvpBw1FmD2MtXP0aw/SS/Kxd2QP07oy2d99RYPK+oGcqKWBHL3OroQejeHwAV7zQ3FOb51aiL8z1+xHo/RSD3xqgPZl+mTGuRGHotom5Fq0xx+g9sxw= Received: from BL0PR0901MB4308.namprd09.prod.outlook.com (52.135.47.83) by BL0PR0901MB3076.namprd09.prod.outlook.com (20.177.240.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.14; Tue, 6 Aug 2019 18:54:08 +0000 Received: from BL0PR0901MB4308.namprd09.prod.outlook.com ([fe80::8052:3866:283f:306c]) by BL0PR0901MB4308.namprd09.prod.outlook.com ([fe80::8052:3866:283f:306c%3]) with mapi id 15.20.2157.011; Tue, 6 Aug 2019 18:54:08 +0000 From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" Reply-To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" To: "'cygwin@cygwin.com'" Subject: getpriority() and top display for priority is inconsistent Date: Tue, 06 Aug 2019 18:54:00 -0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=lavr@ncbi.nlm.nih.gov; x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rq9jJVx5A9UcGHNFnjFznadpmQHro+6eow90JxkR22VI1zDvhsHuCjr0IfPwX6l6 Return-Path: lavr@ncbi.nlm.nih.gov X-SW-Source: 2019-08/txt/msg00082.txt.bz2 I have noticed a discrepancy between the process priority shown by "top" vs= . what getpriority() returns. I'm using the procps-based "top", so it reads the priority value from /proc= /PID/stat. The value gets there via code found in "fhandler_process.cc": /* 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 =3D 8; /* Default value. */ else priority =3D pbi.BasePriority; But that's an inconsistent way of generating the value, because it is suppo= sed to be the one that "getpriority()" returns. Also, it looks like the higher value in "pbi.BasePriority" corresponds to a= higher process priority, while Unix priority is higher when the value is l= ess (20 - nice, generally). It looks like it should have been done by calling a utility function, winpr= io_to_nice(GetPriorityClass(CurrentProcess())), and setting up both the pri= ority field (as "NZERO + winprio_to_nice()") and the following "nice" field (whic= h is currently set to permanent zero) with what winprio_to_nice() returns. -- 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