public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Tejun Heo <htejun@gmail.com>,
	Eric Van Hensbergen <ericvh@gmail.com>,
	Ron Minnich <rminnich@sandia.gov>, Ingo Molnar <mingo@elte.hu>,
	Christoph Hellwig <hch@infradead.org>,
	Miklos Szeredi <mszeredi@suse.cz>,
	Brad Boyer <flar@allandria.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Roland McGrath <roland@redhat.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] poll: allow f_op->poll to sleep, take#6
Date: Fri, 28 Nov 2008 17:08:02 +0100	[thread overview]
Message-ID: <20081128160802.GA11809@redhat.com> (raw)
In-Reply-To: <alpine.DEB.1.10.0811272033440.3147@alien.or.mcafeemobile.com>

On 11/27, Davide Libenzi wrote:
>
> On Thu, 27 Nov 2008, Tejun Heo wrote:
>
> > f_op->poll is the only vfs operation which is not allowed to sleep.  It's
> > because poll and select implementation used task state to synchronize
> > against wake ups, which doesn't have to be the case anymore as wait/wake
> > interface can now use custom wake up functions.  The non-sleep restriction
> > can be a bit tricky because ->poll is not called from an atomic context
> > and the result of accidentally sleeping in ->poll only shows up as
> > temporary busy looping when the timing is right or rather wrong.
> >
> > This patch converts poll/select to use custom wake up function and use
> > separate triggered variable to synchronize against wake up events.  The
> > only added overhead is an extra function call during wake up and
> > negligible.
> >
> > This patch removes the one non-sleep exception from vfs locking rules and
> > is beneficial to userland filesystem implementations like FUSE, 9p or
> > peculiar fs like spufs as it's very difficult for those to implement
> > non-sleeping poll method.
>
> Looks OK to me, although it'd be better if some more folks eye it, in
> order to avoid painful mistakes.

Just in case, I think the patch is correct too.

(v4l1-compat.c:poll_one() looks buggy, it doesn't check if poll_get_entry()
 fails, but this has nothing to do with this patch).

Oleg.


  parent reply	other threads:[~2008-11-28 16:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-25 17:30 + poll-allow-f_op-poll-to-sleep-take-4.patch added to -mm tree Oleg Nesterov
2008-11-25 21:08 ` Davide Libenzi
2008-11-26  4:33 ` Tejun Heo
2008-11-26  4:40   ` [PATCH] poll: allow f_op->poll to sleep, take#5 Tejun Heo
2008-11-26  6:27     ` Davide Libenzi
2008-11-26  6:39       ` Tejun Heo
2008-11-26 19:36         ` Davide Libenzi
2008-11-27  9:18           ` Tejun Heo
2008-11-27  9:37             ` [PATCH] poll: allow f_op->poll to sleep, take#6 Tejun Heo
2008-11-28  4:35               ` Davide Libenzi
2008-11-28  4:44                 ` Tejun Heo
2008-11-28 16:08                 ` Oleg Nesterov [this message]
2008-11-27 20:13           ` [PATCH] poll: allow f_op->poll to sleep, take#5 Oleg Nesterov
2008-11-26  4:49   ` + poll-allow-f_op-poll-to-sleep-take-4.patch added to -mm tree Tejun Heo

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=20081128160802.GA11809@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=ericvh@gmail.com \
    --cc=flar@allandria.com \
    --cc=hch@infradead.org \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mingo@elte.hu \
    --cc=mszeredi@suse.cz \
    --cc=rminnich@sandia.gov \
    --cc=roland@redhat.com \
    --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