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: <20210320154632.GZ4746@worktop.programming.kicks-ass.net>
Date:   Sat, 20 Mar 2021 16:46:32 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     "Joel Fernandes (Google)" <joel@...lfernandes.org>
Cc:     Nishanth Aravamudan <naravamudan@...italocean.com>,
        Julien Desfossez <jdesfossez@...italocean.com>,
        Tim Chen <tim.c.chen@...ux.intel.com>,
        Vineeth Pillai <viremana@...ux.microsoft.com>,
        Aaron Lu <aaron.lwe@...il.com>,
        Aubrey Li <aubrey.intel@...il.com>, tglx@...utronix.de,
        linux-kernel@...r.kernel.org, mingo@...nel.org,
        torvalds@...ux-foundation.org, fweisbec@...il.com,
        keescook@...omium.org, Phil Auld <pauld@...hat.com>,
        Valentin Schneider <valentin.schneider@....com>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
        Paolo Bonzini <pbonzini@...hat.com>, vineeth@...byteword.org,
        Chen Yu <yu.c.chen@...el.com>,
        Christian Brauner <christian.brauner@...ntu.com>,
        Agata Gruza <agata.gruza@...el.com>,
        Antonio Gomez Iglesias <antonio.gomez.iglesias@...el.com>,
        graf@...zon.com, konrad.wilk@...cle.com, dfaggioli@...e.com,
        rostedt@...dmis.org, benbjiang@...cent.com,
        Alexandre Chartre <alexandre.chartre@...cle.com>,
        James.Bottomley@...senpartnership.com, OWeisse@...ch.edu,
        Dhaval Giani <dhaval.giani@...cle.com>, chris.hyser@...cle.com,
        Josh Don <joshdon@...gle.com>, Hao Luo <haoluo@...gle.com>,
        Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [PATCH 2/6] sched: tagging interface for core scheduling

On Fri, Mar 19, 2021 at 04:32:49PM -0400, Joel Fernandes (Google) wrote:
> From: Josh Don <joshdon@...gle.com>
> 
> Adds per-task and per-cgroup interfaces for specifying which tasks can
> co-execute on adjacent SMT hyperthreads via core scheduling.
> 
> The per-task interface hooks are implemented here, but are not currently
> used. The following patch adds a prctl interface which then takes
> advantage of these.
> 
> The cgroup interface can be used to toggle a unique cookie value for all
> descendent tasks, preventing these tasks from sharing with any others.
> See Documentation/admin-guide/hw-vuln/core-scheduling.rst for a full
> rundown.
> 
> One important property of this interface is that neither the per-task
> nor the per-cgroup setting overrides the other. For example, if two
> tasks are in different cgroups, and one or both of the cgroups is tagged
> using the per-cgroup interface, then these tasks cannot share, even if
> they use the per-task interface to attempt to share with one another.
> 
> The above is implemented by making the overall core scheduling cookie a
> compound structure, containing both a task-level cookie and a
> group-level cookie. Two tasks will only be allowed to share if all
> fields of their respective cookies match.
> 
> Core scheduler has extra overhead.  Enable it only for machines with
> more than one SMT hardware thread.

Oh man.. I'd soooo hoped to first see the simple task interface and then
see the cgroup patch on top of that... I'll see if I can flip them
myself (on monday).

> +#ifdef CONFIG_SCHED_CORE
> +struct sched_core_cookie {
> +	unsigned long task_cookie;
> +	unsigned long group_cookie;
> +
> +	/* A u64 representation of the cookie used only for display to
> +	 * userspace. We avoid exposing the actual cookie contents, which
> +	 * are kernel pointers.
> +	 */

Tssk, invalid comment style that..

> +	u64 userspace_id;
> +};

> +static unsigned long sched_core_alloc_task_cookie(void)
> +{
> +	struct sched_core_task_cookie *ck =
> +		kmalloc(sizeof(struct sched_core_task_cookie), GFP_KERNEL);

	struct sched_core_task_cookie *ck = kmalloc(sizeof(*ck), GFP_KERNEL);

Also, those type names are unfortunately long..

> +static void sched_core_get_task_cookie(unsigned long cookie)
> +{
> +	struct sched_core_task_cookie *ptr =
> +		(struct sched_core_task_cookie *)cookie;

	struct sched_core_task_cookie *ptr = (void *)cookie;

Know your language and use it to avoid typing excessively long names :-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ