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]
Date:   Mon, 12 Dec 2022 10:12:06 -1000
From:   Tejun Heo <tj@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     torvalds@...ux-foundation.org, mingo@...hat.com,
        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, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org, kernel-team@...a.com
Subject: Re: [PATCH 04/31] sched: Allow sched_cgroup_fork() to fail and
 introduce sched_cancel_fork()

On Mon, Dec 12, 2022 at 09:07:11PM +0100, Peter Zijlstra wrote:
> On Mon, Dec 12, 2022 at 08:03:24AM -1000, Tejun Heo wrote:
> > On Mon, Dec 12, 2022 at 12:13:31PM +0100, Peter Zijlstra wrote:
> > > On Tue, Nov 29, 2022 at 10:22:46PM -1000, Tejun Heo wrote:
> > > > A new sched_clas needs a bit more control over forking. This patch makes the
> > >                  ^
> > >                  (insufficient s's)
> > 
> > Will update.
> > 
> > > > following changes:
> > > > 
> > > > * Add sched_cancel_fork() which is called if fork fails after sched_fork()
> > > >   succeeds so that the preparation can be undone.
> > > > 
> > > > * Allow sched_cgroup_fork() to fail.
> > > > 
> > > > Neither is used yet and this patch shouldn't cause any behavior changes.
> > > 
> > > Fails to explain why this would be needed and why that would be a good
> > > thing. IOW, total lack of justification.
> > 
> > This is because sched_ext calls out to BPF scheduler's prepare_enable()
> > operation to prepare the task. The operation is allowed to fail (e.g. it
> > might need to allocate something which can fail), so we need a way back back
> > out of it.
> 
> sched_fork() can already fail; why isn't that a suitable location to do
> what needs doing?

Because SCX's ops.prepare_enable() wants the cgroup (p->sched_task_group) to
be initialized in case the BPF scheduler wants to perform cgroup related
initializations.

Thanks.

-- 
tejun

Powered by blists - more mailing lists