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: <Y4+3sw9wEUKJ0zh4@slm.duckdns.org>
Date:   Tue, 6 Dec 2022 11:44:19 -1000
From:   Tejun Heo <tj@...nel.org>
To:     torvalds@...ux-foundation.org, mingo@...hat.com,
        peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, vschneid@...hat.com, ast@...nel.org,
        daniel@...earbox.net, andrii@...nel.org, martin.lau@...nel.org,
        joshdon@...gle.com, brho@...gle.com, pjt@...gle.com,
        derkling@...gle.com, haoluo@...gle.com, dvernet@...a.com,
        dschatzberg@...a.com, dskarlat@...cmu.edu, riel@...riel.com
Cc:     linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
        kernel-team@...a.com
Subject: Re: [PATCH 14/31] sched_ext: Implement BPF extensible scheduler class

On Tue, Nov 29, 2022 at 10:22:56PM -1000, Tejun Heo wrote:
> +	/**
> +	 * dispatch - Dispatch tasks from the BPF scheduler into dsq's
> +	 * @cpu: CPU to dispatch tasks for
> +	 * @prev: previous task being switched out
> +	 *
> +	 * Called when a CPU can't find a task to execute after ops.consume().
> +	 * The operation should dispatch one or more tasks from the BPF
> +	 * scheduler to the dsq's using scx_bpf_dispatch(). The maximum number
> +	 * of tasks which can be dispatched in a single call is specified by the
> +	 * @dispatch_max_batch field of this struct.
> +	 */
> +	void (*dispatch)(s32 cpu, struct task_struct *prev);
> +
> +	/**
> +	 * consume - Consume tasks from the dsq's to the local dsq for execution
> +	 * @cpu: CPU to consume tasks for
> +	 *
> +	 * Called when a CPU's local dsq is empty. The operation should transfer
> +	 * one or more tasks from the dsq's to the CPU's local dsq using
> +	 * scx_bpf_consume(). If this function fails to fill the local dsq,
> +	 * ops.dispatch() will be called.
> +	 *
> +	 * This operation is unnecessary if the BPF scheduler always dispatches
> +	 * either to one of the local dsq's or the global dsq. If implemented,
> +	 * this operation is also responsible for consuming the global_dsq.
> +	 */
> +	void (*consume)(s32 cpu);
> +
> +	/**
> +	 * consume_final - Final consume call before going idle
> +	 * @cpu: CPU to consume tasks for
> +	 *
> +	 * After ops.consume() and .dispatch(), @cpu still doesn't have a task
> +	 * to execute and is about to go idle. This operation can be used to
> +	 * implement more aggressive consumption strategies. Otherwise
> +	 * equivalent to ops.consume().
> +	 */
> +	void (*consume_final)(s32 cpu);

Doesn't really change the big picture but I ended up merging
ops.consume[_final]() into ops.dispatch() which should make the dispatch
path both simpler and more flexible.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ