lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211110181558.GB51149@blackbody.suse.cz>
Date:   Wed, 10 Nov 2021 19:15:58 +0100
From:   Michal Koutný <mkoutny@...e.com>
To:     "Moessbauer, Felix" <felix.moessbauer@...mens.com>
Cc:     "longman@...hat.com" <longman@...hat.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "cgroups@...r.kernel.org" <cgroups@...r.kernel.org>,
        "corbet@....net" <corbet@....net>,
        "frederic@...nel.org" <frederic@...nel.org>,
        "guro@...com" <guro@...com>,
        "hannes@...xchg.org" <hannes@...xchg.org>,
        "juri.lelli@...hat.com" <juri.lelli@...hat.com>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
        "lizefan.x@...edance.com" <lizefan.x@...edance.com>,
        "mtosatti@...hat.com" <mtosatti@...hat.com>,
        "pauld@...hat.com" <pauld@...hat.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "shuah@...nel.org" <shuah@...nel.org>,
        "tj@...nel.org" <tj@...nel.org>,
        "jan.kiszka@...mens.com" <jan.kiszka@...mens.com>,
        "henning.schild@...mens.com" <henning.schild@...mens.com>
Subject: Re: [PATCH v8 0/6] cgroup/cpuset: Add new cpuset partition type &
 empty effecitve cpus

On Wed, Nov 10, 2021 at 03:21:54PM +0000, "Moessbauer, Felix" <felix.moessbauer@...mens.com> wrote:
> 2. Threads can be started on non-rt CPUs and then bound to a specific rt CPU.
> This binding can be specified before thread creation via pthread_create.
> By that, you can make sure that at no point in time a thread has a
> "forbidden" CPU in its affinities.

It should boil down to some clone$version(2) and sched_setaffinity(2)
calls, so strictly speaking even with pthread_create(3) the thread is
shortly running with the parent's affinity.

> With cgroup2, you cannot guarantee the second aspect, as thread
> creation and moving to a cgroup is not an atomic operation.

As suggested by others, CLONE_INTO_CGROUP (into cpuset cgroup) can
actually "hide" the migration into the clone3() call.

> At creation time, you cannot set the final affinity mask (as you
> create it in the non-rt group and there the CPU is not in the
> cpuset.cpus).
> Once you move the thread to the rt cgroup, it has a default mask and
> by that can be executed on other rt cores.

Good point. Perhaps you could work this around by having another level
of (non-root partition) cpuset cgroups for individual CPUs? (Maybe
there's more clever approach, this is just first to come into my mind.)

Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ