• Tejun Heo's avatar
    poll: allow f_op->poll to sleep · 5f820f64
    Tejun Heo authored
    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.
    
    While at it, make the following cosmetic changes to make poll.h and
    select.c checkpatch friendly.
    
    * s/type * symbol/type *symbol/		   : three places in poll.h
    * remove blank line before EXPORT_SYMBOL() : two places in select.c
    
    Oleg: spotted missing barrier in poll_schedule_timeout()
    Davide: spotted missing write barrier in pollwake()
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Eric Van Hensbergen <ericvh@gmail.com>
    Cc: Ron Minnich <rminnich@sandia.gov>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Christoph Hellwig <hch@infradead.org>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    Cc: Davide Libenzi <davidel@xmailserver.org>
    Cc: Brad Boyer <flar@allandria.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Roland McGrath <roland@redhat.com>
    Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Cc: Davide Libenzi <davidel@xmailserver.org>
    Cc: Oleg Nesterov <oleg@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    5f820f64
Name
Last commit
Last update
..
ABI Loading commit data...
DocBook Loading commit data...
PCI Loading commit data...
RCU Loading commit data...
accounting Loading commit data...
acpi Loading commit data...
aoe Loading commit data...
arm Loading commit data...
auxdisplay Loading commit data...
blackfin Loading commit data...
block Loading commit data...
blockdev Loading commit data...
cdrom Loading commit data...
cgroups Loading commit data...
connector Loading commit data...
console Loading commit data...
controllers Loading commit data...
cpu-freq Loading commit data...
cpuidle Loading commit data...
cris Loading commit data...
crypto Loading commit data...
development-process Loading commit data...
device-mapper Loading commit data...
driver-model Loading commit data...
dvb Loading commit data...
early-userspace Loading commit data...
fault-injection Loading commit data...
fb Loading commit data...
filesystems Loading commit data...
firmware_class Loading commit data...
frv Loading commit data...
hwmon Loading commit data...
i2c Loading commit data...
i2o Loading commit data...
ia64 Loading commit data...
ide Loading commit data...
infiniband Loading commit data...
input Loading commit data...
ioctl Loading commit data...
isdn Loading commit data...
ja_JP Loading commit data...
kbuild Loading commit data...
kdump Loading commit data...
ko_KR Loading commit data...
laptops Loading commit data...
lguest Loading commit data...
m68k Loading commit data...
make Loading commit data...
mips Loading commit data...
mn10300 Loading commit data...
mtd Loading commit data...
namespaces Loading commit data...
netlabel Loading commit data...
networking Loading commit data...
parisc Loading commit data...
pcmcia Loading commit data...
power Loading commit data...
powerpc Loading commit data...
prctl Loading commit data...
s390 Loading commit data...
scheduler Loading commit data...
scsi Loading commit data...
serial Loading commit data...
sh Loading commit data...
sound Loading commit data...
sparc Loading commit data...
spi Loading commit data...
sysctl Loading commit data...
telephony Loading commit data...
thermal Loading commit data...
timers Loading commit data...
tracers Loading commit data...
uml Loading commit data...
usb Loading commit data...
video4linux Loading commit data...
vm Loading commit data...
w1 Loading commit data...
watchdog Loading commit data...
x86 Loading commit data...
zh_CN Loading commit data...
00-INDEX Loading commit data...
BUG-HUNTING Loading commit data...
Changes Loading commit data...
CodingStyle Loading commit data...
DMA-API.txt Loading commit data...
DMA-ISA-LPC.txt Loading commit data...
DMA-attributes.txt Loading commit data...
DMA-mapping.txt Loading commit data...
HOWTO Loading commit data...
IO-mapping.txt Loading commit data...
IPMI.txt Loading commit data...
IRQ-affinity.txt Loading commit data...
IRQ.txt Loading commit data...
Intel-IOMMU.txt Loading commit data...
Makefile Loading commit data...
ManagementStyle Loading commit data...
SAK.txt Loading commit data...
SELinux.txt Loading commit data...
SM501.txt Loading commit data...
SecurityBugs Loading commit data...
Smack.txt Loading commit data...
SubmitChecklist Loading commit data...
SubmittingDrivers Loading commit data...
SubmittingPatches Loading commit data...
VGA-softcursor.txt Loading commit data...
applying-patches.txt Loading commit data...
atomic_ops.txt Loading commit data...
basic_profiling.txt Loading commit data...
binfmt_misc.txt Loading commit data...
braille-console.txt Loading commit data...
bt8xxgpio.txt Loading commit data...
c2port.txt Loading commit data...
cachetlb.txt Loading commit data...
cpu-hotplug.txt Loading commit data...
cpu-load.txt Loading commit data...
cpusets.txt Loading commit data...
cputopology.txt Loading commit data...
credentials.txt Loading commit data...
dcdbas.txt Loading commit data...
debugging-modules.txt Loading commit data...
debugging-via-ohci1394.txt Loading commit data...
dell_rbu.txt Loading commit data...
devices.txt Loading commit data...
dontdiff Loading commit data...
edac.txt Loading commit data...
eisa.txt Loading commit data...
email-clients.txt Loading commit data...
exception.txt Loading commit data...
feature-removal-schedule.txt Loading commit data...
ftrace.txt Loading commit data...
gpio.txt Loading commit data...
highuid.txt Loading commit data...
hw_random.txt Loading commit data...
ics932s401 Loading commit data...
initrd.txt Loading commit data...
io-mapping.txt Loading commit data...
io_ordering.txt Loading commit data...
iostats.txt Loading commit data...
irqflags-tracing.txt Loading commit data...
isapnp.txt Loading commit data...
java.txt Loading commit data...
kernel-doc-nano-HOWTO.txt Loading commit data...
kernel-docs.txt Loading commit data...
kernel-parameters.txt Loading commit data...
keys-request-key.txt Loading commit data...
keys.txt Loading commit data...
kobject.txt Loading commit data...
kprobes.txt Loading commit data...
kref.txt Loading commit data...
ldm.txt Loading commit data...
leds-class.txt Loading commit data...
local_ops.txt Loading commit data...
lockdep-design.txt Loading commit data...
lockstat.txt Loading commit data...
logo.gif Loading commit data...
logo.txt Loading commit data...
magic-number.txt Loading commit data...
markers.txt Loading commit data...
mca.txt Loading commit data...
md.txt Loading commit data...
memory-barriers.txt Loading commit data...
memory-hotplug.txt Loading commit data...
memory.txt Loading commit data...
mono.txt Loading commit data...
mutex-design.txt Loading commit data...
nmi_watchdog.txt Loading commit data...
nommu-mmap.txt Loading commit data...
numastat.txt Loading commit data...
oops-tracing.txt Loading commit data...
parport-lowlevel.txt Loading commit data...
parport.txt Loading commit data...
pi-futex.txt Loading commit data...
pnp.txt Loading commit data...
preempt-locking.txt Loading commit data...
printk-formats.txt Loading commit data...
prio_tree.txt Loading commit data...
rbtree.txt Loading commit data...
rfkill.txt Loading commit data...
robust-futex-ABI.txt Loading commit data...
robust-futexes.txt Loading commit data...
rt-mutex-design.txt Loading commit data...
rt-mutex.txt Loading commit data...
rtc.txt Loading commit data...
serial-console.txt Loading commit data...
sgi-ioc4.txt Loading commit data...
sgi-visws.txt Loading commit data...
sparse.txt Loading commit data...
spinlocks.txt Loading commit data...
stable_api_nonsense.txt Loading commit data...
stable_kernel_rules.txt Loading commit data...
svga.txt Loading commit data...
sysfs-rules.txt Loading commit data...
sysrq.txt Loading commit data...
tracepoints.txt Loading commit data...
unaligned-memory-access.txt Loading commit data...
unicode.txt Loading commit data...
unshare.txt Loading commit data...
video-output.txt Loading commit data...
volatile-considered-harmful.txt Loading commit data...
voyager.txt Loading commit data...
zorro.txt Loading commit data...