aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-01-07fs: dcache reduce d_parent lockingNick Piggin1-9/+12
Use RCU to simplify locking in dget_parent. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache rationalise dget variantsNick Piggin12-47/+24
dget_locked was a shortcut to avoid the lazy lru manipulation when we already held dcache_lock (lru manipulation was relatively cheap at that point). However, how that the lru lock is an innermost one, we never hold it at any caller, so the lock cost can now be avoided. We already have well working lazy dcache LRU, so it should be fine to defer LRU manipulations to scan time. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache reduce dcache_inode_lockNick Piggin1-12/+12
dcache_inode_lock can be avoided in d_delete() and d_materialise_unique() in cases where it is not required. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache reduce locking in d_allocNick Piggin1-2/+4
Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache reduce dput lockingNick Piggin1-29/+23
It is possible to run dput without taking data structure locks up-front. In many cases where we don't kill the dentry anyway, these locks are not required. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache avoid starvation in dcache multi-step operationsNick Piggin1-14/+42
Long lived dcache "multi-step" operations which retry on rename seq can be starved with a lot of rename activity. If they fail after the 1st pass, take the rename_lock for writing to avoid further starvation. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache remove dcache_lockNick Piggin40-307/+109
dcache_lock no longer protects anything. remove it. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: Use rename lock and RCU for multi-step operationsNick Piggin5-30/+152
The remaining usages for dcache_lock is to allow atomic, multi-step read-side operations over the directory tree by excluding modifications to the tree. Also, to walk in the leaf->root direction in the tree where we don't have a natural d_lock ordering. This could be accomplished by taking every d_lock, but this would mean a huge number of locks and actually gets very tricky. Solve this instead by using the rename seqlock for multi-step read-side operations, retry in case of a rename so we don't walk up the wrong parent. Concurrent dentry insertions are not serialised against. Concurrent deletes are tricky when walking up the directory: our parent might have been deleted when dropping locks so also need to check and retry for that. We can also use the rename lock in cases where livelock is a worry (and it is introduced in subsequent patch). Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: increase d_name lock coverageNick Piggin1-2/+12
Cover d_name with d_lock in more cases, where there may be concurrent modification to it. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: scale inode alias listNick Piggin9-9/+78
Add a new lock, dcache_inode_lock, to protect the inode's i_dentry list from concurrent modification. d_alias is also protected by d_lock. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache scale subdirsNick Piggin16-160/+339
Protect d_subdirs and d_child with d_lock, except in filesystems that aren't using dcache_lock for these anyway (eg. using i_mutex). Note: if we change the locking rule in future so that ->d_child protection is provided only with ->d_parent->d_lock, it may allow us to reduce some locking. But it would be an exception to an otherwise regular locking scheme, so we'd have to see some good results. Probably not worthwhile. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache scale d_unhashedNick Piggin10-54/+102
Protect d_unhashed(dentry) condition with d_lock. This means keeping DCACHE_UNHASHED bit in synch with hash manipulations. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache scale dentry refcountNick Piggin21-69/+126
Make d_count non-atomic and protect it with d_lock. This allows us to ensure a 0 refcount dentry remains 0 without dcache_lock. It is also fairly natural when we start protecting many other dentry members with d_lock. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache scale lruNick Piggin1-28/+84
Add a new lock, dcache_lru_lock, to protect the dcache LRU list from concurrent modification. d_lru is also protected by d_lock, which allows LRU lists to be accessed without the lru lock, using RCU in future patches. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache scale hashNick Piggin2-44/+64
Add a new lock, dcache_hash_lock, to protect the dcache hash table from concurrent modification. d_hash is also protected by d_lock. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07hostfs: simplify lockingNick Piggin3-17/+24
Remove dcache_lock locking from hostfs filesystem, and move it into dcache helpers. All that is required is a coherent path name. Protection from concurrent modification of the namespace after path name generation is not provided in current code, because dcache_lock is dropped before the path is used. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: change d_hash for rcu-walkNick Piggin25-51/+94
Change d_hash so it may be called from lock-free RCU lookups. See similar patch for d_compare for details. For in-tree filesystems, this is just a mechanical change. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: change d_compare for rcu-walkNick Piggin23-157/+242
Change d_compare so it may be called from lock-free RCU lookups. This does put significant restrictions on what may be done from the callback, however there don't seem to have been any problems with in-tree fses. If some strange use case pops up that _really_ cannot cope with the rcu-walk rules, we can just add new rcu-unaware callbacks, which would cause name lookup to drop out of rcu-walk mode. For in-tree filesystems, this is just a mechanical change. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: name case update methodNick Piggin4-31/+37
smpfs and ncpfs want to update a live dentry name in-place. Rather than have them open code the locking, provide a documented dcache API. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07jfs: dont overwrite dentry name in d_revalidateNick Piggin1-8/+35
Use vfat's method for dealing with negative dentries to preserve case, rather than overwrite dentry name in d_revalidate, which is a bit ugly and also gets in the way of doing lock-free path walking. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07cifs: dont overwrite dentry name in d_revalidateNick Piggin1-19/+24
Use vfat's method for dealing with negative dentries to preserve case, rather than overwrite dentry name in d_revalidate, which is a bit ugly and also gets in the way of doing lock-free path walking. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: change d_delete semanticsNick Piggin22-42/+47
Change d_delete from a dentry deletion notification to a dentry caching advise, more like ->drop_inode. Require it to be constant and idempotent, and not take d_lock. This is how all existing filesystems use the callback anyway. This makes fine grained dentry locking of dput and dentry lru scanning much simpler. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: dcache documentation cleanupNick Piggin1-12/+6
Remove redundant (and incorrect, since dcache RCU lookup) dentry locking documentation and point to the canonical document. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07config fs: avoid switching ->d_op on live dentryNick Piggin1-8/+9
Switching d_op on a live dentry is racy in general, so avoid it. In this case it is a negative dentry, which is safer, but there are still concurrent ops which may be called on d_op in that case (eg. d_revalidate). So in general a filesystem may not do this. Fix configfs so as not to do this. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07cgroup fs: avoid switching ->d_op on live dentryNick Piggin1-5/+22
Switching d_op on a live dentry is racy in general, so avoid it. In this case it is a negative dentry, which is safer, but there are still concurrent ops which may be called on d_op in that case (eg. d_revalidate). So in general a filesystem may not do this. Fix cgroupfs so as not to do this. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: use fast counters for vfs cachesNick Piggin2-13/+23
percpu_counter library generates quite nasty code, so unless you need to dynamically allocate counters or take fast approximate value, a simple per cpu set of counters is much better. The percpu_counter can never be made to work as well, because it has an indirection from pointer to percpu memory, and it can't use direct this_cpu_inc interfaces because it doesn't use static PER_CPU data, so code will always be worse. In the fastpath, it is the difference between this: incl %gs:nr_dentry # nr_dentry and this: movl percpu_counter_batch(%rip), %edx # percpu_counter_batch, movl $1, %esi #, movq $nr_dentry, %rdi #, call __percpu_counter_add # (plus I clobber registers) __percpu_counter_add: pushq %rbp # movq %rsp, %rbp #, subq $32, %rsp #, movq %rbx, -24(%rbp) #, movq %r12, -16(%rbp) #, movq %r13, -8(%rbp) #, movq %rdi, %rbx # fbc, fbc #APP # 216 "/home/npiggin/usr/src/linux-2.6/arch/x86/include/asm/thread_info.h" 1 movq %gs:kernel_stack,%rax #, pfo_ret__ # 0 "" 2 #NO_APP incl -8124(%rax) # <variable>.preempt_count movq 32(%rdi), %r12 # <variable>.counters, tcp_ptr__ #APP # 78 "lib/percpu_counter.c" 1 add %gs:this_cpu_off, %r12 # this_cpu_off, tcp_ptr__ # 0 "" 2 #NO_APP movslq (%r12),%r13 #* tcp_ptr__, tmp73 movslq %edx,%rax # batch, batch addq %rsi, %r13 # amount, count cmpq %rax, %r13 # batch, count jge .L27 #, negl %edx # tmp76 movslq %edx,%rdx # tmp76, tmp77 cmpq %rdx, %r13 # tmp77, count jg .L28 #, .L27: movq %rbx, %rdi # fbc, call _raw_spin_lock # addq %r13, 8(%rbx) # count, <variable>.count movq %rbx, %rdi # fbc, movl $0, (%r12) #,* tcp_ptr__ call _raw_spin_unlock # .L29: #APP # 216 "/home/npiggin/usr/src/linux-2.6/arch/x86/include/asm/thread_info.h" 1 movq %gs:kernel_stack,%rax #, pfo_ret__ # 0 "" 2 #NO_APP decl -8124(%rax) # <variable>.preempt_count movq -8136(%rax), %rax #, D.14625 testb $8, %al #, D.14625 jne .L32 #, .L31: movq -24(%rbp), %rbx #, movq -16(%rbp), %r12 #, movq -8(%rbp), %r13 #, leave ret .p2align 4,,10 .p2align 3 .L28: movl %r13d, (%r12) # count,* jmp .L29 # .L32: call preempt_schedule # .p2align 4,,6 jmp .L31 # .size __percpu_counter_add, .-__percpu_counter_add .p2align 4,,15 Signed-off-by: Nick Piggin <[email protected]>
2011-01-07vfs: revert per-cpu nr_unused counters for dentry and inodesNick Piggin2-21/+12
The nr_unused counters count the number of objects on an LRU, and as such they are synchronized with LRU object insertion and removal and scanning, and protected under the LRU lock. Making it per-cpu does not actually get any concurrency improvements because of this lock, and summing the counter is much slower, and incrementing/decrementing it costs more code size and is slower too. These counters should stay per-LRU, which currently means global. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07kernel: kmem_ptr_validate considered harmfulNick Piggin5-99/+1
This is a nasty and error prone API. It is no longer used, remove it. Signed-off-by: Nick Piggin <[email protected]>
2011-01-07fs: d_validate fixesNick Piggin1-18/+7
d_validate has been broken for a long time. kmem_ptr_validate does not guarantee that a pointer can be dereferenced if it can go away at any time. Even rcu_read_lock doesn't help, because the pointer might be queued in RCU callbacks but not executed yet. So the parent cannot be checked, nor the name hashed. The dentry pointer can not be touched until it can be verified under lock. Hashing simply cannot be used. Instead, verify the parent/child relationship by traversing parent's d_child list. It's slow, but only ncpfs and the destaged smbfs care about it, at this point. Signed-off-by: Nick Piggin <[email protected]>
2011-01-06Merge branch 'next' into for-linusDmitry Torokhov63-753/+3201
Conflicts: include/linux/input.h
2011-01-06Merge branch 'omap-for-linus' of ↵Linus Torvalds253-8402/+20757
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 * 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (243 commits) omap2: Make OMAP2PLUS select OMAP_DM_TIMER OMAP4: hwmod data: Fix alignment and end of line in structurefields OMAP4: hwmod data: Move the DMA structures OMAP4: hwmod data: Move the smartreflex structures OMAP4: hwmod data: Fix missing SIDLE_SMART_WKUP in smartreflexsysc arm: omap: tusb6010: add name for MUSB IRQ arm: omap: craneboard: Add USB EHCI support omap2+: Initialize serial port for dynamic remuxing for n8x0 omap2+: Add struct omap_board_data and use it for platform level serial init omap2+: Allow hwmod state changes to mux pads based on the state changes omap2+: Add support for hwmod specific muxing of devices omap2+: Add omap_mux_get_by_name OMAP2: PM: fix compile error when !CONFIG_SUSPEND MAINTAINERS: OMAP: hwmod: update hwmod code, data maintainership OMAP4: Smartreflex framework extensions OMAP4: hwmod: Add inital data for smartreflex modules. OMAP4: PM: Program correct init voltages for scalable VDDs OMAP4: Adding voltage driver support OMAP4: Register voltage PMIC parameters with the voltage layer OMAP3: PM: Program correct init voltages for VDD1 and VDD2 ... Fix up trivial conflict in arch/arm/plat-omap/Kconfig
2011-01-07ARM: mach-shmobile: update for SMP changes.Paul Mundt1-18/+3
There have likewise been some API updates, so we refactor to use the consolidated smp_prepare_cpus(). Signed-off-by: Paul Mundt <[email protected]>
2011-01-07ARM: mach-shmobile: update for GIC changes.Paul Mundt4-11/+9
This fixes up the SMP support to use the refactored GIC APIs. Signed-off-by: Paul Mundt <[email protected]>
2011-01-07ARM: mach-shmobile: Fix up clkdev fallout for SH73A0.Paul Mundt1-1/+1
Use the new linux/clkdev.h to get it building again. Signed-off-by: Paul Mundt <[email protected]>
2011-01-06Merge branch 'v4l_for_linus' of ↵Linus Torvalds500-28862/+17774
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (255 commits) [media] radio-aimslab.c: Fix gcc 4.5+ bug [media] cx25821: Fix compilation breakage due to BKL dependency [media] v4l2-compat-ioctl32: fix compile warning [media] zoran: fix compiler warning [media] tda18218: fix compile warning [media] ngene: fix compile warning [media] DVB: IR support for TechnoTrend CT-3650 [media] cx23885, cimax2.c: Fix case of two CAM insertion irq [media] ir-nec-decoder: fix repeat key issue [media] staging: se401 depends on USB [media] staging: usbvideo/vicam depends on USB [media] soc_camera: Add the ability to bind regulators to soc_camedra devices [media] V4L2: Add a v4l2-subdev (soc-camera) driver for OmniVision OV2640 sensor [media] v4l: soc-camera: switch to .unlocked_ioctl [media] v4l: ov772x: simplify pointer dereference [media] ov9640: fix OmniVision OV9640 sensor driver's priv data retrieving [media] ov9640: use macro to request OmniVision OV9640 sensor private data [media] ivtv-i2c: Fix two warnings [media] staging/lirc: Update lirc TODO files [media] cx88: Remove the obsolete i2c_adapter.id field ...
2011-01-07Merge branch 'common/dma' into rmobile-latestPaul Mundt1-9/+7
2011-01-07dma: shdma: don't register the global die notifier multiple timesGuennadi Liakhovetski1-9/+7
A recent patch has added a die notifier to the shdma driver, however, it registers a static die-notifier object in the probe routine, i.e., for each device instance. This is wrong and leads to a system lockup. This patch moves the die notifier registration to module init and exit routines respectively. Reported-by: Magnus Damm <[email protected]> Signed-off-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2011-01-07Merge branch 'rmobile/smp' into rmobile-latestPaul Mundt9-1/+305
Conflicts: arch/arm/Kconfig arch/arm/mach-shmobile/include/mach/entry-macro-intc.S Signed-off-by: Paul Mundt <[email protected]>
2011-01-07ARM: mach-shmobile: Rely on run-time IRQ handlersMagnus Damm4-98/+18
Remove now unused IRQ demux code. All R-Mobile and SH-Mobile processors should register IRQ demux handlers during run-time. Signed-off-by: Magnus Damm <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2011-01-07ARM: mach-shmobile: Run-time IRQ handler for GICMagnus Damm4-0/+23
Break-out GIC specific IRQ demux code from the file entry-macro-intc.S and register during run-time. Covers sh73a0. Signed-off-by: Magnus Damm <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2011-01-07ARM: mach-shmobile: Run-time IRQ handler for INTCAMagnus Damm7-0/+67
Break-out INTC specific IRQ demux code from the file entry-macro-intc.S and register during run-time. Covers sh7367, sh7377 and sh7372. Signed-off-by: Magnus Damm <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2011-01-07ARM: mach-shmobile: Enable CONFIG_MULTI_IRQ_HANDLERMagnus Damm1-0/+1
Always enable MULTI_IRQ_HANDLER on SH-Mobile. Signed-off-by: Magnus Damm <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2011-01-07ARM: mach-shmobile: Use shared GIC entry macrosMagnus Damm1-61/+1
Use the GIC demux code in asm/hardware/entry-macro-gic.S on the R-Mobile / SH-Mobile processors. Signed-off-by: Magnus Damm <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2011-01-07ARM: mach-shmobile: mackerel: Add zboot supportSimon Horman2-0/+90
When CONFIG_ZBOOT_ROM is selected, the resulting zImage file will be small boot loader and may be burned to rom or flash. Cc: Magnus Damm <[email protected]> Cc: Kuninori Morimoto <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2011-01-07Merge branch 'master' of ↵Paul Mundt2575-100735/+199998
master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into rmobile-latest Conflicts: arch/arm/mach-shmobile/Kconfig Signed-off-by: Paul Mundt <[email protected]>
2011-01-06Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds661-12081/+30869
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (416 commits) ARM: DMA: add support for DMA debugging ARM: PL011: add DMA burst threshold support for ST variants ARM: PL011: Add support for transmit DMA ARM: PL011: Ensure IRQs are disabled in UART interrupt handler ARM: PL011: Separate hardware FIFO size from TTY FIFO size ARM: PL011: Allow better handling of vendor data ARM: PL011: Ensure error flags are clear at startup ARM: PL011: include revision number in boot-time port printk ARM: vexpress: add sched_clock() for Versatile Express ARM i.MX53: Make MX53 EVK bootable ARM i.MX53: Some bug fix about MX53 MSL code ARM: 6607/1: sa1100: Update platform device registration ARM: 6606/1: sa1100: Fix platform device registration ARM i.MX51: rename IPU irqs ARM i.MX51: Add ipu clock support ARM: imx/mx27_3ds: Add PMIC support ARM: DMA: Replace page_to_dma()/dma_to_page() with pfn_to_dma()/dma_to_pfn() mx51: fix usb clock support MX51: Add support for usb host 2 arch/arm/plat-mxc/ehci.c: fix errors/typos ...
2011-01-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6Linus Torvalds26-602/+454
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6: (25 commits) atyfb: Fix bootup hangs on sparc64. sparc: update copyright in piggyback.c sparc: unify strip command in boot/Makefile sparc: rename piggyback_32 to piggyback sparc: fix tftpboot.img for sparc64 on little-endian host sparc: add $BITS to piggyback arguments sparc: remove obsolete ELF support in piggyback_32.c sparc: additional comments to piggyback_32.c sparc: use _start for the start entry (like 64 bit does) sparc: use trapbase in setup_arch sparc: refactor piggy_32.c Added support for ampopts in APBUART driver. Used in AMP systems. APBUART: added raw AMBA vendor/device number to match against. SPARC/LEON: avoid AMBAPP name duplicates in openprom fs when REG is missing SPARC/LEON: added support for selecting Timer Core and Timer within core LEON: added raw AMBA vendor/device number to find TIMER, IRQCTRL SPARC/LEON: added support for IRQAMP IRQ Controller SPARC/LEON: find IRQCTRL and Timer via OF-Tree, instead of hardcoded. sparc: fix sparse warnings in arch/sparc/prom for 32 bit build sparc: remove unused prom tree functions ...
2011-01-06Merge branch 'devel-stable' into develRussell King413-6826/+23377
Conflicts: arch/arm/mach-pxa/clock.c arch/arm/mach-pxa/clock.h
2011-01-06Merge branch 'pgt' (early part) into develRussell King15-332/+315
2011-01-06Merge branch 'misc' into develRussell King147-1316/+1674
Conflicts: arch/arm/Kconfig arch/arm/common/Makefile arch/arm/kernel/Makefile arch/arm/kernel/smp.c