From: Thomas Gleixner <tglx@linutronix.de>
To: Guillaume Knispel <gknispel@proformatique.com>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
Miklos Szeredi <mszeredi@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Arjan van de Ven <arjan@linux.intel.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] poll/select: initialize triggered field of struct poll_wqueues
Date: Sat, 15 Aug 2009 23:41:08 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.0908152338290.1283@localhost.localdomain> (raw)
In-Reply-To: <20090815193024.121926e6@xilun.lan.proformatique.com>
Guillaume,
On Sat, 15 Aug 2009, Guillaume Knispel wrote:
> poll/select: initialize triggered field of struct poll_wqueues
>
> The triggered field of struct poll_wqueues introduced in commit
> 5f820f648c92a5ecc771a96b3c29aa6e90013bba "poll: allow f_op->poll to
> sleep" was set to 1 in pollwake() (now __pollwake() ), tested and
> later set to 0 in poll_schedule_timeout(), but not initialized before.
> As a result when the process needs to sleep, triggered was likely to be
> non-zero even if pollwake() is not called before the first
> poll_schedule_timeout(), meaning schedule_hrtimeout_range() would not
> be called and an extra loop calling all ->poll() would be done.
>
> This patch initialize triggered to 0 in poll_initwait() so the ->poll()
> are not called twice before the process goes to sleep when it needs to.
Indeed, triggered is random stack content, so it needs to be initialized.
> Signed-off-by: Guillaume Knispel <gknispel@proformatique.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> fs/select.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/fs/select.c b/fs/select.c
> index d870237..8084834 100644
> --- a/fs/select.c
> +++ b/fs/select.c
> @@ -110,6 +110,7 @@ void poll_initwait(struct poll_wqueues *pwq)
> {
> init_poll_funcptr(&pwq->pt, __pollwait);
> pwq->polling_task = current;
> + pwq->triggered = 0;
> pwq->error = 0;
> pwq->table = NULL;
> pwq->inline_index = 0;
>
next prev parent reply other threads:[~2009-08-15 21:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-15 17:30 Guillaume Knispel
2009-08-15 21:41 ` Thomas Gleixner [this message]
2009-08-16 0:53 ` Tejun Heo
2009-08-16 1:15 ` Andrew Morton
2009-08-16 1:37 ` Tejun Heo
2009-08-16 1:39 ` Linus Torvalds
2009-08-16 1:40 ` Linus Torvalds
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=alpine.LFD.2.00.0908152338290.1283@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=arjan@linux.intel.com \
--cc=gknispel@proformatique.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@suse.cz \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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
Powered by JetHome