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: <CAJZ5v0iH0J5JK+PUMsDN3K7aJNKiBt=5p5N3mry=KEL+=ZM94w@mail.gmail.com>
Date:	Fri, 22 Jul 2016 02:18:54 +0200
From:	"Rafael J. Wysocki" <rafael@...nel.org>
To:	Steve Muckle <steve.muckle@...aro.org>
Cc:	"Rafael J. Wysocki" <rafael@...nel.org>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	Lists linaro-kernel <linaro-kernel@...ts.linaro.org>,
	Linux PM <linux-pm@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Morten Rasmussen <morten.rasmussen@....com>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Juri Lelli <Juri.Lelli@....com>,
	Patrick Bellasi <patrick.bellasi@....com>
Subject: Re: [PATCH V2] cpufreq: Disallow ->resolve_freq() for drivers
 providing ->target_index()

On Fri, Jul 22, 2016 at 2:09 AM, Steve Muckle <steve.muckle@...aro.org> wrote:
> On Fri, Jul 22, 2016 at 01:53:13AM +0200, Rafael J. Wysocki wrote:
>> On Fri, Jul 22, 2016 at 1:45 AM, Steve Muckle <steve.muckle@...aro.org> wrote:
>> > On Fri, Jul 22, 2016 at 01:32:00AM +0200, Rafael J. Wysocki wrote:
>> >> On Fri, Jul 22, 2016 at 1:22 AM, Steve Muckle <steve.muckle@...aro.org> wrote:
>> >> > On Fri, Jul 22, 2016 at 01:22:22AM +0200, Rafael J. Wysocki wrote:
>> >> >> OK, applied.
>> >> >
>> >> > FWIW I do have a concern on this patch, I think it adds unnecessary
>> >> > overhead.
>> >>
>> >> It isn't unnecessary.  It prevents an otherwise possible kernel crash
>> >> from happening.
>> >
>> > The logic may not be unecessary, but the overhead is. The crash could be
>> > prevented in a way that doesn't require repeatedly checking a pointer
>> > that doesn't change.
>>
>> Well, you had the ->resolve_freq check in your patch, didn't you?
>>
>> Viresh simply added a ->target_index check to it.
>>
>> Now, you can argue that this is one check too many, but as long as
>> drivers are allowed to implement ->target without implementing
>> ->resolve_freq, the *number* of checks in this routine cannot be
>> reduced.
>>
>> There are three possible cases and two checks are required to
>> determine which case really takes place.
>
> My thinking was that one of these two would be preferable:
>
> - Forcing ->target() drivers to install a ->resolve_freq callback,
>   enforcing this at cpufreq driver init time.

That would have been possible, but your series didn't do that.

>   My understanding is
>   ->target() drivers are deprecated anyway

No, they aren't.

There simply are cases in which frequency tables are not workable
(like the ACPI CPPC one).

>  and theren't aren't many of
>   them, though I don't know offhand exactly how many or how hard it
>   would be to do for each one.
>
> - Forcing callers (schedutil in this case) to check that either
>   ->target() or ->resolve_freq() is implemented. It means
>   catching and scrutinizing future callers of resolve_freq.

But that doesn't reduce the number of checks in cpufreq_driver_resolve_freq().

There still are three choices in there: return a frequency from the
table (if present), or call ->resolve_freq (if implemented), or return
target_freq (as the last resort).

> But even if one of these is better than it could always be done on top
> of this patch I suppose.

Right.

> I'm also not familiar with the platforms that use
> ->target() style drivers. So strictly speaking for my purposes it won't
> matter since the number of tests is the same for them.

OK

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ