From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH 20/21] polling loops: change exit condition to
Date: Sun, 04 Dec 2005 10:55:57 +0000 [thread overview]
Message-ID: <4392CB3D.205@gmail.com> (raw)
In-Reply-To: <43923735.4060604@gmail.com>
Roland Dreier wrote:
> The end_time has to be computed before the loop starts and then not
> change again.
>
> With that said I'm not sure that these patches are a good idea. For
> example, what if in the code below:
>
>
>> /* Wait max 1 Sec for data download and processor to start */
>>- for (index = 0; index < 10; index++) {
>>+ end_time = jiffies + msecs_to_jiffies(1000);
>
>
> this gets preempted for a while and never even enters the loop below:
>
>
>>+ while (time_before(jiffies, end_time)) {
>> msleep(100);
>
>
> then the function will fail without even checking the hardware once.
ok, so maybe while loops should be changed to do while loops?
ps: does anyone know why i don't get my own emails? (i checked subscription
page and everything is fine there)
regards,
Marcin
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
prev parent reply other threads:[~2005-12-04 10:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-04 0:24 [KJ] [PATCH 20/21] polling loops: change exit condition to Marcin Slusarz
2005-12-04 4:15 ` Jesper Juhl
2005-12-04 5:06 ` Roland Dreier
2005-12-04 5:09 ` Jesper Juhl
2005-12-04 10:55 ` Marcin Slusarz [this message]
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=4392CB3D.205@gmail.com \
--to=marcin.slusarz@gmail.com \
--cc=kernel-janitors@vger.kernel.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.