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: <CAKfTPtDAjedxh9J2rqOwafrmubN6+-wDyTRdNQh6fCAb2HS4RQ@mail.gmail.com>
Date:   Wed, 31 Aug 2016 10:14:24 +0200
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     Juri Lelli <juri.lelli@....com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        LAK <linux-arm-kernel@...ts.infradead.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Russell King - ARM Linux <linux@....linux.org.uk>,
        Sudeep Holla <sudeep.holla@....com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will.deacon@....com>,
        Morten Rasmussen <morten.rasmussen@....com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH v6 2/8] arm: parse cpu capacity-dmips-mhz from DT

On 30 August 2016 at 18:28, Juri Lelli <juri.lelli@....com> wrote:
> Hi Vincent,
>
> On 16/08/16 10:20, Vincent Guittot wrote:
>> Hi Juri,
>>
>>
>> On 19 July 2016 at 14:40, Juri Lelli <juri.lelli@....com> wrote:
>
> [...]
>
>> > +static int
>> > +init_cpu_capacity_callback(struct notifier_block *nb,
>> > +                          unsigned long val,
>> > +                          void *data)
>> > +{
>> > +       struct cpufreq_policy *policy = data;
>> > +       int cpu;
>> > +
>> > +       if (cap_parsing_failed || cap_parsing_done)
>> > +               return 0;
>> > +
>> > +       switch (val) {
>> > +       case CPUFREQ_NOTIFY:
>> > +               pr_debug("cpu_capacity: init cpu capacity for CPUs [%*pbl] (to_visit=%*pbl)\n",
>> > +                               cpumask_pr_args(policy->related_cpus),
>> > +                               cpumask_pr_args(cpus_to_visit));
>> > +               cpumask_andnot(cpus_to_visit,
>> > +                              cpus_to_visit,
>> > +                              policy->related_cpus);
>> > +               for_each_cpu(cpu, policy->related_cpus) {
>> > +                       raw_capacity[cpu] = arch_scale_cpu_capacity(NULL, cpu) *
>> > +                                           policy->max / 1000UL;
>>
>> Should it be policy->cpuinfo.max_freq instead of policy->max ?
>>
>
> Right. I'll fix the arm64 bits as well.
>
>> > +                       capacity_scale = max(raw_capacity[cpu], capacity_scale);
>> > +               }
>> > +               if (cpumask_empty(cpus_to_visit)) {
>> > +                       normalize_cpu_capacity();
>> > +                       kfree(raw_capacity);
>> > +                       pr_debug("cpu_capacity: parsing done\n");
>> > +                       cap_parsing_done = true;
>>
>> ok so you do that once with the 1st governor that will be registered
>> for the CPU. Can't you unregister the notifier then ?
>>
>
> I tried, but the only place I could find to unregister it is from the
> callback itself; and it is not possible to do so AFAIK. Suggestions?

yes, you're right
Can't you queue a work to unregister your callback ?
That's may be overkill but it seems weird to keep this notifier that
will do nothing, registered for the whole life of the system

>
> Thanks for the review.
>
> Best,
>
> - Juri

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ