From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22865 invoked by alias); 13 Apr 2018 19:17: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 22804 invoked by uid 89); 13 Apr 2018 19:17:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-101.6 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (217.72.192.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Apr 2018 19:17:38 +0000 Received: from calimero.vinschen.de ([217.91.18.234]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MZlwE-1etOfB2kF4-00LYHk for ; Fri, 13 Apr 2018 21:17:35 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id F12FBA81ED0; Fri, 13 Apr 2018 21:17:34 +0200 (CEST) Date: Fri, 13 Apr 2018 19:17:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: More oddities with multiple processor groups Message-ID: <20180413191734.GC27440@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <87in8xwre7.fsf@Rainer.invalid> <5AD0BAE5.2040904@tlinx.org> <8829ca51-a131-a88b-4b36-00c965af0b2b@SystematicSw.ab.ca> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="i7F3eY7HS/tUJxUd" Content-Disposition: inline In-Reply-To: <8829ca51-a131-a88b-4b36-00c965af0b2b@SystematicSw.ab.ca> User-Agent: Mutt/1.9.2 (2017-12-15) X-UI-Out-Filterresults: notjunk:1;V01:K0:Ds2rAAzaplA=:kTpDEQ0YggC4mTsPfYBdjJ nr3GjiUx7Uz5bKqw2m8i2Hi5JauGVNTOmgjDwdhLd0mUeQjYF5PmJKu7+yu66Odk20dS0iNHt j4a5Gy9HhCNNgoOlEbFL5LG+u1noSduAl4Fq+EwXSOLTR9Chf1TUY0B6MxMZbMW5Sx3KJk2vb w6Ibn4w7c9VHEARRu2FNPy7Cu2w4N1VwQOlqgyzY/dXcJT0xpiCK7jtk83H338yNBp+tgEPbf t651MMRLiQXasBCrnpiN8ca5tShWT3zLhH3qXMeSDszLkRpj90ulOdWJgi1FvlFyKNjoCH1Iq 3bUyMXoTC1piF6+CgNuyia3s6gVuIOlDZO/RQH7CUtCABDDQgwVqE5FC+8CZiiNO0gxksGMch slht+Gicd2kkW8Qe69alX9QBjka/KUbAKB1HIIQ4yn8p4j6wIgNuTgWMwScCI3s/DNR7NS482 yZKrbwsuJTVjdH7miLu/TdkQ3QR7kk/guboe11MbD21ORoYDcsTwbNKDT8YAZoQ2SVymnx609 BpNM6z4fR9iPmy/btig81xS/bJdJzvV3ulbdmswzcxIKCK0UUIHQUoy+AjGew3LxfZewIATaz ERvZn2T1U9AVlHS+CwyVeB/qsA3DnGNfluKHrYgp9rSLqX6NMH+jkT3ytR1i3R6QpeSv1yURd K7ZCeNuTJ4Q2MZLPh3meZW+pRkMuDHNQjtSrSkpZN6VTo1CM59rBfa/545zc/LC/m5zmU6WWa VGdRyQaWtLaDYu8RJDQ4rw/nzoPp9x9iaEXQWg== X-SW-Source: 2018-04/txt/msg00155.txt.bz2 --i7F3eY7HS/tUJxUd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1978 On Apr 13 12:29, Brian Inglis wrote: > On 2018-04-13 08:12, L A Walsh wrote: > > Achim Gratz wrote: > >> The problem here is that on Linux you don't need to do anything extra = to=20 > >> use any of the advertised logical processors from a single application= ,=20 > >> while on Windows you need to first create a thread and set it's affini= ty to > >> a different group than where your process was started in, then assign = each > >> new thread an affinity to one of the available groups. If you don't do > >> that, all threads will be restricted to the original group. > > Not exactly true. They are not *restricted* -- it's a *feature* of the > > Windows scheduler, in that future procs/threads inherit the cpu of the > > parent. Linux's scheduler is more advanced as well as being replaceabl= e. MS > > doesn't want you to do that > >> there might need to be some option to restrict Cygwin to a single proc= essor > >> group for some applications to work (correctly). > > There is. Start them all on a single cpu & set the cpu mask. Pretty m= uch=20 > > the same way you restrict procs on linux -- you can run them with a spe= cific > > cpu mask, and most programs will keep running w/that mask. > > Unfortunately, AFAIK, I don't think POSIX specifies a way to set affini= ties, > > so I'm not sure how cygwin would do it. >=20 > Glibc adds {pthread,sched}_...affinity... functions. > Linux uses namespaces, control groups (cgroups), cpusets, sysfs/kernfs: We would only be able to support it partially. Windows doesn't allow to set thread affinity across CPU groups. There's no simple function to set process CPU group affinity, only a function to set process affinity within a single group. And it has a restriction in that all current threads have to run in the same CPU group. The API is pretty tricky. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --i7F3eY7HS/tUJxUd Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlrRAk4ACgkQ9TYGna5E T6CWMBAAnqSIvEnwfXVBExWSjNNz+Qddbbr5Qd3mY6NP2cBoTzNkKXv39okGrZxQ Of8CJ3Ipej2iWP6MloUy4BUWu0FNGgdcfYppRYVdgLaDrEQmSB8ED3Cdth0fdSgX 5CE6m2sA7T0aMeUyL/Z1+o27s8WxwUDILHXwT5w5I2nuPEi02Tgn8wDDffe9HTGm h17NBCbpX5gHv7hDJCte3O11CzwyH+n8DDjE7cr0MFMCfUB5uJLtmNe5J5a8CA9D dpsuVJHubCjxQJ222QV8BUBkWK6jNRyrLTp9tK0tLWYowtIm1aw0nA2kD17k1pNU XFoRhBHKOrABJXwFu3sFAj9F3QDQD1TUG3Ta7r1C0JhPtzzgssYwfBQbsJmEYbaG YRM3Mb9rjK/YwZGAoTf5xIhzhA0+VGc2RkaHjzktyN3mkrNaUIlUykZumx+4VSBY 3n0ZP1VESmkgkYy0r4lvf9qPKi7eZ0oAsXh6jCqI9hETr/Q9keQL7o0Z12jeftoF iktyY65MBU1up/I0OFI5O+C5OWApJ2bgEXVvrj6PI4wPG580xRVrNZWw9f7GcK1v gTvIJtDzwZpnHkbJDehb2xwOAc8FYKTBOgKcBzFrynOe4QbaiS3JUu+PV0Hr+KW1 FXw7VxYsZf1MrCQ7vDwrQcIhEKTxnTfgwSqMboBiUKXGrj1bIrA= =5wEG -----END PGP SIGNATURE----- --i7F3eY7HS/tUJxUd--