[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0908152338290.1283@localhost.localdomain>
Date: Sat, 15 Aug 2009 23:41:08 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Guillaume Knispel <gknispel@...formatique.com>
cc: linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>,
Miklos Szeredi <mszeredi@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Arjan van de Ven <arjan@...ux.intel.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] poll/select: initialize triggered field of struct
poll_wqueues
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@...formatique.com>
Acked-by: Thomas Gleixner <tglx@...utronix.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;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists