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: <1347459764.15764.32.camel@twins>
Date:	Wed, 12 Sep 2012 16:22:44 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, ak@...ux.intel.com,
	zheng.z.yan@...el.com, robert.richter@....com
Subject: Re: [PATCH v2 2/3] perf: use hrtimer for event multiplexing

On Wed, 2012-09-12 at 16:13 +0200, Stephane Eranian wrote:
> +static DEFINE_PER_CPU(struct list_head, rotation_list);

Why do you keep the rotation list? The only use seems to be:


> +void perf_cpu_hrtimer_cancel(int cpu)
> +{
> +       struct list_head *head = &__get_cpu_var(rotation_list);
> +       struct perf_cpu_context *cpuctx, *tmp;
> +       unsigned long flags;
> +
> +       if (WARN_ON(cpu != smp_processor_id()))
> +               return;
> +
> +       local_irq_save(flags);
> +
> +       list_for_each_entry_safe(cpuctx, tmp, head, rotation_list) {
> +               if (cpuctx->hrtimer_active) {
> +                       hrtimer_cancel(&cpuctx->hrtimer);
> +                       cpuctx->hrtimer_active = 0;
> +               }
> +       }
> +
> +       local_irq_restore(flags);
> +}

Which is weird, why not use the existing for-each-pmu loop in
perf_event_exit_cpu_context() ? Or something similar to iterate all
extant PMUs and thus their cpuctxs?

Also, you can do away with hrtimer_active, you can hrtimer_cancel() on
an inactive hrtimer just fine, it will DTRT.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ