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, 10 Oct 2022 12:14:24 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Ravi Bangoria <ravi.bangoria@....com>
Cc:     acme@...nel.org, alexander.shishkin@...ux.intel.com,
        jolsa@...hat.com, namhyung@...nel.org, songliubraving@...com,
        eranian@...gle.com, ak@...ux.intel.com, mark.rutland@....com,
        frederic@...nel.org, maddy@...ux.ibm.com, irogers@...gle.com,
        will@...nel.org, robh@...nel.org, mingo@...hat.com,
        catalin.marinas@....com, linux-arm-kernel@...ts.infradead.org,
        linux-perf-users@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
        linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
        sandipan.das@....com, ananth.narayan@....com, kim.phillips@....com,
        santosh.shukla@....com
Subject: Re: [PATCH] perf: Rewrite core context handling

On Wed, Sep 07, 2022 at 04:58:49PM +0530, Ravi Bangoria wrote:
> > -static void
> > -ctx_flexible_sched_in(struct perf_event_context *ctx,
> > -		      struct perf_cpu_context *cpuctx)
> > +/* XXX .busy thingy from Peter's patch */
> > +static void ctx_flexible_sched_in(struct perf_event_context *ctx, struct pmu *pmu)
> 
> This one turned out to be very easy. Given that, we iterate over each
> pmu, we can just return error if we fail to schedule any flexible event.
> (It wouldn't be straight forward like this if we needed to implement
> pmu=NULL optimization.)
> 
> ---
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index e0232e0bb74e..923656af73fe 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -3751,6 +3751,7 @@ static int merge_sched_in(struct perf_event *event, void *data)
>  			cpc = this_cpu_ptr(event->pmu_ctx->pmu->cpu_pmu_context);
>  			perf_mux_hrtimer_restart(cpc);
>  			group_update_userpage(event);
> +			return -EBUSY;
>  		}
>  	}
>  

I'm afraid this breaks things; consider:

  f79256532682 ("perf/core: fix userpage->time_enabled of inactive events")

I totally hate this -- because it means we *HAVE* to iterate the
inactive events, but alas.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ