From: Shawn Guo <shawnguo@kernel.org>
To: Kohji Okuno <okuno.kohji@jp.panasonic.com>
Cc: fabio.estevam@nxp.com, s.hauer@pengutronix.de,
kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org,
linux-imx@nxp.com
Subject: Re: [PATCH v3] ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time
Date: Mon, 4 Mar 2019 15:00:31 +0800 [thread overview]
Message-ID: <20190304070029.GE26041@dragon> (raw)
In-Reply-To: <20190304.102814.1664010168009276853.okuno.kohji@jp.panasonic.com>
On Mon, Mar 04, 2019 at 10:28:14AM +0900, Kohji Okuno wrote:
> Hi Shawn,
>
> I found this bug by delaying periodic communication. For example, it
> is the source codes as below.
>
> while (1) {
> sleep(2);
> write(fd, "Hello", strlen("Hello"));
> }
>
> Of course, it dows not occur frequently. However, in the worst case,
> it stopped for more than 1 minute.
>
> If there are few running processes and few hrtimer events, this issue
> will occur.
>
> For example:
> (*) time is abstracting.
> WFI idle : the CPU will be waked up by local timer.
> WAIT idle: the CPU will be waked up by broad cast(bc) timer.
>
> [time]
> CPU#0 CPU#1
> ----------------------------------------------------------------------
> enter "WAIT" idle
> [next event=10]
> enter "WAIT" idle
> [next event=60]
> all cpus are IDLE = > CPU#1 sets WAIT_UNCLOCKED
>
> 10: bc timer fires
> exit idle
>
> enter "WFI" idle
> [next event=12]
>
> 12: ** local timer is not fired **
> CPU#0 will not be waked up
> until the next bc timer interrupt.
>
> >> all processes stop <<
>
> 60: bc timer fires
> exit idle exit idle
> CPU#1 sets WAIT_CLOCKED
> local timer fires
>
> If CPU#0 sets WAIT_CLOCKED at time=10, this issue will not occur.
>
> Does that make any sense?
Yes, makes sense, and thanks for the details. So the fix should be
a material for stable kernel, even though the bug doesn't happen often.
Thanks for the patch.
Shawn
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-03-04 7:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 8:49 [PATCH] ARM: imx6q: cpuidle: fix bug that CPU may not wake up Kohji Okuno
2019-02-22 9:14 ` Lucas Stach
2019-02-22 12:25 ` Fabio Estevam
2019-02-26 2:06 ` [PATCH v2] ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time Kohji Okuno
2019-02-26 2:12 ` Fabio Estevam
2019-02-26 2:19 ` Kohji Okuno
2019-02-26 2:22 ` Fabio Estevam
2019-02-26 2:23 ` Kohji Okuno
2019-02-26 2:34 ` [PATCH v3] " Kohji Okuno
2019-03-01 9:23 ` Shawn Guo
2019-03-04 1:28 ` Kohji Okuno
2019-03-04 7:00 ` Shawn Guo [this message]
2019-03-04 7:06 ` Shawn Guo
2019-03-04 7:38 ` Kohji Okuno
2019-03-05 10:38 ` Kohji Okuno
2019-03-06 3:21 ` Shawn Guo
2019-03-06 4:30 ` [PATCH] ARM: imx6: cpuidle: omit the unnecessary unmask of GINT Kohji Okuno
2019-03-19 12:51 ` Shawn Guo
2019-03-20 0:07 ` Kohji Okuno
2019-03-20 1:12 ` Peng Fan
2019-03-20 3:08 ` Aisheng Dong
2019-03-20 7:44 ` Shawn Guo
2019-03-20 7:59 ` Peng Fan
2019-03-20 14:28 ` Shawn Guo
2019-03-20 14:35 ` Shawn Guo
2019-03-06 14:36 ` [PATCH v3] ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time Peng Fan
2019-03-07 0:06 ` Kohji Okuno
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=20190304070029.GE26041@dragon \
--to=shawnguo@kernel.org \
--cc=fabio.estevam@nxp.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=okuno.kohji@jp.panasonic.com \
--cc=s.hauer@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).