From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id 8A6253858D20 for ; Sat, 14 Oct 2023 11:40:28 +0000 (GMT) ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A6253858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697283630; cv=none; b=YxV5omAqxOHwlj4nWr3XIur009wPEQ/rr6YxxMqHIdEU2l8X98Txr3rGQBOlrA3RQAmtPj3aQBKFM2Sbnbf5ebRKFjg0x/P0FIUSF+gWF9WG6SS6TG8jF+NMJG7str18p8EL0XA1hfO1adMI65a01frqqoMzzppOr7gNB0UehbE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697283630; c=relaxed/simple; bh=xVKPqYE0hP6Kg06YqEzRgEACTpm0AhN3xZ7XK+b0wts=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=l9gBJkFeme23kfK1T8LVZjKExWDjKsd4tLxyyppmcCBjC9vHC9RACbBsT54JHLKZYn+y++DWQvgZfPqHaLixn5nDzYsWLhY1lhkQt8WvD/LqIOLSkPWsfzAklVE+4gogp0CJMCQmcme9uEwZg7H/rYN+0l+tNQevxSGsQXX+1pY= ARC-Authentication-Results: i=1; server2.sourceware.org DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A6253858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5079c846dcfso1617448e87.2 for ; Sat, 14 Oct 2023 04:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697283626; x=1697888426; darn=cygwin.com; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ncNfzTHj/3L0EzDAwCbiWx8csXdgkAPFKlRXOIcG9MU=; b=QbWc5XxDaRzpkLnUSFo4bbKPF8EtknZwfXZPekUcvPGpP4drhhRAXW7UyJnTOM3obn xlCpeYc34IAcz/fzI+OXgNRcgghyGOVjaJ5iGa8X1kt+M5q5WBPAEdp2klavFpxn/PA0 CiPdVIZ9S6ohPXwEH3ezPgOABrgVp6hRy6ww5kS3wFvx76YhPf0kwLP9s819NWjSw7sV B4CCjSPVPGncN+L9NaKIMzGv+oDUAh1zIAGHSTLbTiGyMpGaNqleXGisXSQky5YtCShT 9rIW0EIMh7neIa4rVnM5a1XwxvQO8qIB29e9O+DEN8UUkzAeconQFqkh85wi8EsJQDKa KUYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697283626; x=1697888426; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ncNfzTHj/3L0EzDAwCbiWx8csXdgkAPFKlRXOIcG9MU=; b=HpAs4A3UmuDo+fIaFt+/AhsVnZvfaUDDipjEmcGgEM0hpxZEvccUaActpxsTi2jC8H ui1flhva7XTvCHdbFkL5TBFN4SbL4FeUJ9orILoUFXplgencU4Pw/kogh+BgUdYR+BhI P2PAFp1xj8XOiW4D2TsSfOqf+fkiC6yG29LJncgXrw5z7B+cJmmSzswoKCqDzEpcAWx7 fcUeSQ7xhBy0rwwIlFPDx3qMXK3B9DcLcbnCwamIL3M3x9Fgaq7qG1ARphyp9q+tvczz xPWhOC4pDTKaVSaZU+m8zcq0tyCNLvESbWXB5tYSZJBBYGLq/+pXhUvr5rcxUROX53X2 zTww== X-Gm-Message-State: AOJu0YxOZNxeYg+8yDugaN/LxCLI0gmi5xuNikJNoErYZY9qJyhXUf0y zL9JZ1yOyDy/wvM8zCq2DGXAc/ghdS3Z875C2q1WaMYN X-Google-Smtp-Source: AGHT+IFRJjfY5Q7uHbZXA/TA0h4mBUiAhMtKSsazoDUgXV8vSzm3+a9jjRAVS9prCJoXn5vsckuRtMRudcVcoOpGQkg= X-Received: by 2002:a05:6512:132a:b0:503:1783:d5a9 with SMTP id x42-20020a056512132a00b005031783d5a9mr28667168lfu.3.1697283626465; Sat, 14 Oct 2023 04:40:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Cedric Blancher Date: Sat, 14 Oct 2023 13:39:50 +0200 Message-ID: Subject: Re: Run a Cygwin process with "higher" scheduler priority To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 11 Aug 2023 at 19:14, Brian Inglis wrote: > > On 2023-08-11 09:44, Cedric Blancher via Cygwin wrote: > > How can we set the scheduler priority for a Cygwin process to "higher" > > than normal on start? > > > > Basically we want a Cygwin compatible script version of the Windows > > task manager feature Name/PID--->Details--->Set priority--->Higher > > Pretend the system is BSD or Linux and web search e.g. SO for that capability, > facility, or feature, then check Cygwin with Search Packages or: > > $ cygcheck -p usr/bin/nice > Found 6 matches for usr/bin/nice I know about nice and renice, but I don't see whether it is working or not. > coreutils-debuginfo-8.26-2 - coreutils-debuginfo: Debug info for coreutils > ... > coreutils-9.0-1 - coreutils: GNU core utilities (includes fileutils, sh-utils > and textutils) > $ cygcheck -p usr/bin/renice > Found 6 matches for usr/bin/renice > util-linux-debuginfo-2.32.1-1 - util-linux-debuginfo: Debug info for util-linux > util-linux-debuginfo-2.33.1-1 - util-linux-debuginfo: Debug info for util-linux > util-linux-debuginfo-2.33.1-2 - util-linux-debuginfo: Debug info for util-linux > util-linux-2.32.1-1 - util-linux: Collection of basic system utilities > util-linux-2.33.1-1 - util-linux: Collection of basic system utilities > util-linux-2.33.1-2 - util-linux: Collection of basic system utilities > $ cygcheck -p usr/bin/chrt > Found 2 matches for usr/bin/chrt > util-linux-debuginfo-2.33.1-2 - util-linux-debuginfo: Debug info for util-linux > util-linux-2.33.1-2 - util-linux: Collection of basic system utilities > $ cygcheck -p usr/bin/taskset > Found 2 matches for usr/bin/taskset > util-linux-debuginfo-2.33.1-2 - util-linux-debuginfo: Debug info for util-linux > util-linux-2.33.1-2 - util-linux: Collection of basic system utilities > > so you may need to install util-linux (coreutils is already installed as a base > package for Cygwin) then: > > $ man nice renice taskset chrt chrt does not work, the syscalls for realtime seem to be not implemented. > > You may need to run these from an elevated admin shell for other user ids, > unowned processes, or higher (negative) priority. > > It has been years since I tried these so can no longer remember if -20 > corresponds to Windows "RealTime" or if you need to use PowerShell to set that e.g. > > $proc = Get-Process -ProcessName "..." > $proc.PriorityClass = "RealTime" > > and that needs to be done from an elevated admin (Power)Shell. > > Of course, never set that on any system except on a very idle, very I/O bound, > well tested process, such as ntpd, that needs stably fast interrupt service and > non-preemptible cpu access for ms every few seconds, preferably on a single or > few cpus to which affinity is set. Is there anything in /proc which can tell me the current *Windows* scheduler priority level? Or a command line tool? Ced