All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too
Date: Tue, 10 Sep 2013 15:26:18 +0000	[thread overview]
Message-ID: <CAKohponUdE0LCciPb+nf3t_vfNqAy3MeWQO8gTOdEDvQJeWcgg@mail.gmail.com> (raw)
In-Reply-To: <4292924.3iHJT5nzNS@vostro.rjw.lan>

On 10 September 2013 17:19, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> That said I'm actually unsure what problems *exactly* are fixed by commit
> 7c30ed5.  The commit log only says that PRECHANGE or POSTCHAGE shouldn't be
> called twice in a row, but it doesn't say why.  As the fallout indicates,
> that actually happened before commit 7c30ed5 and nothing visibly broke, so
> the benefit from having that commit is questionable to me.  On the other hand,
> the commit itself is evidently broken, so what exactly is the reason for
> keeping it?

Okay, so the first question is can we have multiple PRECHANGE notfication
done without any POSTCHANGE inbetween?
- Scenario: One reading value of cpuinfo_cur_freq, which will call
__cpufreq_cpu_get()->cpufreq_out_of_sync()->cpufreq_notify_transition()..

And ondemand governor trying to change freq of cpu and so doing notification..

There can be more similar scenarios possible..


Now Second question, is this fine to have multiple PRECHANGE notfications
before any POSTCHANGE notification?

Logically it looks obvious to me that these must be serialized..
Otherwise this is what we are broadcasting:
- We are changing for freq X, please prepare and let us know if you are
okay with it..
- Oh.. So sorry, we are changing to freq Y instead, please adjust accordingly.

- Yes we have changed to freq Y...
- Yes we have changed to freq X...

This looks stupid, isn't it? I don't know how the drivers would behave when
they see such notifications and so got to this patch initially..

WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Greg KH <greg@kroah.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	SH-Linux <linux-sh@vger.kernel.org>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too
Date: Tue, 10 Sep 2013 20:44:18 +0530	[thread overview]
Message-ID: <CAKohponUdE0LCciPb+nf3t_vfNqAy3MeWQO8gTOdEDvQJeWcgg@mail.gmail.com> (raw)
In-Reply-To: <4292924.3iHJT5nzNS@vostro.rjw.lan>

On 10 September 2013 17:19, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> That said I'm actually unsure what problems *exactly* are fixed by commit
> 7c30ed5.  The commit log only says that PRECHANGE or POSTCHAGE shouldn't be
> called twice in a row, but it doesn't say why.  As the fallout indicates,
> that actually happened before commit 7c30ed5 and nothing visibly broke, so
> the benefit from having that commit is questionable to me.  On the other hand,
> the commit itself is evidently broken, so what exactly is the reason for
> keeping it?

Okay, so the first question is can we have multiple PRECHANGE notfication
done without any POSTCHANGE inbetween?
- Scenario: One reading value of cpuinfo_cur_freq, which will call
__cpufreq_cpu_get()->cpufreq_out_of_sync()->cpufreq_notify_transition()..

And ondemand governor trying to change freq of cpu and so doing notification..

There can be more similar scenarios possible..


Now Second question, is this fine to have multiple PRECHANGE notfications
before any POSTCHANGE notification?

Logically it looks obvious to me that these must be serialized..
Otherwise this is what we are broadcasting:
- We are changing for freq X, please prepare and let us know if you are
okay with it..
- Oh.. So sorry, we are changing to freq Y instead, please adjust accordingly.

- Yes we have changed to freq Y...
- Yes we have changed to freq X...

This looks stupid, isn't it? I don't know how the drivers would behave when
they see such notifications and so got to this patch initially..

WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Greg KH <greg@kroah.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	SH-Linux <linux-sh@vger.kernel.org>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too
Date: Tue, 10 Sep 2013 20:44:18 +0530	[thread overview]
Message-ID: <CAKohponUdE0LCciPb+nf3t_vfNqAy3MeWQO8gTOdEDvQJeWcgg@mail.gmail.com> (raw)
In-Reply-To: <4292924.3iHJT5nzNS@vostro.rjw.lan>

On 10 September 2013 17:19, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> That said I'm actually unsure what problems *exactly* are fixed by commit
> 7c30ed5.  The commit log only says that PRECHANGE or POSTCHAGE shouldn't be
> called twice in a row, but it doesn't say why.  As the fallout indicates,
> that actually happened before commit 7c30ed5 and nothing visibly broke, so
> the benefit from having that commit is questionable to me.  On the other hand,
> the commit itself is evidently broken, so what exactly is the reason for
> keeping it?

Okay, so the first question is can we have multiple PRECHANGE notfication
done without any POSTCHANGE inbetween?
- Scenario: One reading value of cpuinfo_cur_freq, which will call
__cpufreq_cpu_get()->cpufreq_out_of_sync()->cpufreq_notify_transition()..

And ondemand governor trying to change freq of cpu and so doing notification..

There can be more similar scenarios possible..


Now Second question, is this fine to have multiple PRECHANGE notfications
before any POSTCHANGE notification?

Logically it looks obvious to me that these must be serialized..
Otherwise this is what we are broadcasting:
- We are changing for freq X, please prepare and let us know if you are
okay with it..
- Oh.. So sorry, we are changing to freq Y instead, please adjust accordingly.

- Yes we have changed to freq Y...
- Yes we have changed to freq X...

This looks stupid, isn't it? I don't know how the drivers would behave when
they see such notifications and so got to this patch initially..

WARNING: multiple messages have this Message-ID (diff)
From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too
Date: Tue, 10 Sep 2013 20:44:18 +0530	[thread overview]
Message-ID: <CAKohponUdE0LCciPb+nf3t_vfNqAy3MeWQO8gTOdEDvQJeWcgg@mail.gmail.com> (raw)
In-Reply-To: <4292924.3iHJT5nzNS@vostro.rjw.lan>

On 10 September 2013 17:19, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> That said I'm actually unsure what problems *exactly* are fixed by commit
> 7c30ed5.  The commit log only says that PRECHANGE or POSTCHAGE shouldn't be
> called twice in a row, but it doesn't say why.  As the fallout indicates,
> that actually happened before commit 7c30ed5 and nothing visibly broke, so
> the benefit from having that commit is questionable to me.  On the other hand,
> the commit itself is evidently broken, so what exactly is the reason for
> keeping it?

Okay, so the first question is can we have multiple PRECHANGE notfication
done without any POSTCHANGE inbetween?
- Scenario: One reading value of cpuinfo_cur_freq, which will call
__cpufreq_cpu_get()->cpufreq_out_of_sync()->cpufreq_notify_transition()..

And ondemand governor trying to change freq of cpu and so doing notification..

There can be more similar scenarios possible..


Now Second question, is this fine to have multiple PRECHANGE notfications
before any POSTCHANGE notification?

Logically it looks obvious to me that these must be serialized..
Otherwise this is what we are broadcasting:
- We are changing for freq X, please prepare and let us know if you are
okay with it..
- Oh.. So sorry, we are changing to freq Y instead, please adjust accordingly.

- Yes we have changed to freq Y...
- Yes we have changed to freq X...

This looks stupid, isn't it? I don't know how the drivers would behave when
they see such notifications and so got to this patch initially..

  reply	other threads:[~2013-09-10 15:26 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 15:11 "cpufreq: fix serialization issues with freq change notifiers" breaks cpufreq too Guennadi Liakhovetski
2013-09-09 15:11 ` Guennadi Liakhovetski
2013-09-09 15:11 ` Guennadi Liakhovetski
2013-09-09 15:11 ` Guennadi Liakhovetski
2013-09-09 20:57 ` Rafael J. Wysocki
2013-09-09 21:08   ` Rafael J. Wysocki
2013-09-09 21:08   ` Rafael J. Wysocki
2013-09-09 21:42   ` Guennadi Liakhovetski
2013-09-09 21:42     ` Guennadi Liakhovetski
2013-09-09 21:42     ` Guennadi Liakhovetski
2013-09-09 23:12     ` Rafael J. Wysocki
2013-09-09 23:12       ` Rafael J. Wysocki
2013-09-09 23:12       ` Rafael J. Wysocki
2013-09-10  1:46       ` Rafael J. Wysocki
2013-09-10  1:46         ` Rafael J. Wysocki
2013-09-10 11:29 ` Viresh Kumar
2013-09-10 11:41   ` Viresh Kumar
2013-09-10 11:29   ` Viresh Kumar
2013-09-10 11:29   ` Viresh Kumar
2013-09-10 11:49   ` Rafael J. Wysocki
2013-09-10 11:49     ` Rafael J. Wysocki
2013-09-10 11:49     ` Rafael J. Wysocki
2013-09-10 11:49     ` Rafael J. Wysocki
2013-09-10 15:14     ` Viresh Kumar [this message]
2013-09-10 15:26       ` Viresh Kumar
2013-09-10 15:14       ` Viresh Kumar
2013-09-10 15:14       ` Viresh Kumar
2013-09-10 19:46       ` Rafael J. Wysocki
2013-09-10 19:46         ` Rafael J. Wysocki
2013-09-10 19:46         ` Rafael J. Wysocki
2013-09-10 19:46         ` Rafael J. Wysocki
2013-09-11  8:38         ` Viresh Kumar
2013-09-11  8:50           ` Viresh Kumar
2013-09-11  8:38           ` Viresh Kumar
2013-09-11  8:38           ` Viresh Kumar
2013-09-11 13:18           ` Rafael J. Wysocki
2013-09-11 13:18             ` Rafael J. Wysocki
2013-09-11 13:18             ` Rafael J. Wysocki
2013-09-11 13:18             ` Rafael J. Wysocki
2013-09-12  0:39             ` Viresh Kumar
2013-09-12  0:51               ` Viresh Kumar
2013-09-12  0:39               ` Viresh Kumar
2013-09-12  0:39               ` Viresh Kumar
2013-09-12  0:43               ` Rafael J. Wysocki
2013-09-12  0:43                 ` Rafael J. Wysocki
2013-09-12  0:43                 ` Rafael J. Wysocki
2013-09-12  0:43                 ` Rafael J. Wysocki
2013-09-12  5:36                 ` Viresh Kumar
2013-09-12  5:48                   ` Viresh Kumar
2013-09-12  5:36                   ` Viresh Kumar
2013-09-12  5:36                   ` Viresh Kumar
2013-09-12 10:50                   ` Rafael J. Wysocki
2013-09-12 11:01                     ` Rafael J. Wysocki
2013-09-12 11:01                     ` Rafael J. Wysocki
2013-09-12 11:01                     ` Rafael J. Wysocki
2013-09-12 10:52                     ` Viresh Kumar
2013-09-12 10:52                       ` Viresh Kumar
2013-09-12 10:52                       ` Viresh Kumar
2013-09-12 10:52                       ` Viresh Kumar
2013-09-10 15:12   ` Guennadi Liakhovetski
2013-09-10 15:12     ` Guennadi Liakhovetski
2013-09-10 15:12     ` Guennadi Liakhovetski
2013-09-10 15:12     ` Guennadi Liakhovetski
2013-09-10 15:26     ` Viresh Kumar
2013-09-10 15:38       ` Viresh Kumar
2013-09-10 15:26       ` Viresh Kumar
2013-09-10 15:26       ` Viresh Kumar
2013-09-10 16:22       ` Guennadi Liakhovetski
2013-09-10 16:22         ` Guennadi Liakhovetski
2013-09-10 16:22         ` Guennadi Liakhovetski
2013-09-10 16:22         ` Guennadi Liakhovetski
2013-09-10 16:34         ` Viresh Kumar
2013-09-10 16:46           ` Viresh Kumar
2013-09-10 16:34           ` Viresh Kumar
2013-09-10 16:34           ` Viresh Kumar
2013-09-10 17:07           ` Guennadi Liakhovetski
2013-09-10 17:07             ` Guennadi Liakhovetski
2013-09-10 17:07             ` Guennadi Liakhovetski
2013-09-10 17:07             ` Guennadi Liakhovetski
2013-09-11  8:06             ` Viresh Kumar
2013-09-11  8:18               ` Viresh Kumar
2013-09-11  8:06               ` Viresh Kumar
2013-09-11  8:06               ` Viresh Kumar
2013-09-11  8:15               ` Guennadi Liakhovetski
2013-09-11  8:15                 ` Guennadi Liakhovetski
2013-09-11  8:15                 ` Guennadi Liakhovetski
2013-09-11  8:15                 ` Guennadi Liakhovetski
2013-09-11  8:39                 ` Viresh Kumar
2013-09-11  8:51                   ` Viresh Kumar
2013-09-11  8:39                   ` Viresh Kumar
2013-09-11  8:39                   ` Viresh Kumar
2013-09-11 13:28                 ` Rafael J. Wysocki
2013-09-11 13:28                   ` Rafael J. Wysocki
2013-09-11 13:28                   ` Rafael J. Wysocki
2013-09-11 13:28                   ` Rafael J. Wysocki
2013-09-12  7:47               ` Guennadi Liakhovetski
2013-09-12  7:47                 ` Guennadi Liakhovetski
2013-09-12  7:47                 ` Guennadi Liakhovetski
2013-09-12  7:47                 ` Guennadi Liakhovetski
2013-09-12  7:51                 ` Viresh Kumar
2013-09-12  7:51                   ` Viresh Kumar
2013-09-12  7:51                   ` Viresh Kumar
2013-09-12  7:51                   ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKohponUdE0LCciPb+nf3t_vfNqAy3MeWQO8gTOdEDvQJeWcgg@mail.gmail.com \
    --to=viresh.kumar@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.