Ben Hutchings [Fri, 29 Jan 2010 20:59:53 +0000 (20:59 +0000)]
mtd: Raise limit on block device minor numbers
add_mtd_blktrans_dev() imposes a maximum of 257 devices per block
translator. This was presumably meant to prevent overflow back in the
days of 8-bit minor numbers. Instead, check against MINORMASK and the
limits of the partition naming scheme.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Ben Hutchings [Fri, 29 Jan 2010 20:58:37 +0000 (20:58 +0000)]
mtd: mtdblock: Dynamically allocate cache info structures
Since we allocate struct mtd_blktrans_dev for each block device, we
can add our own structure members to the end. Therefore embed
struct mtd_blktrans_dev in struct mtdblk_dev and remove the static
array of struct mtdblk_dev. Also remove the redundant pointer to
struct mtd_info.
This is preparation for removing the static limit on the number of MTD
devices.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Mike Frysinger [Sun, 17 Jan 2010 15:52:46 +0000 (10:52 -0500)]
mtd: maps: Blackfin async: rename local funcs to avoid common clashes
There are new Blackfin MMR helper functions that use the same name as some
of the local functions in this driver, so have the driver use more specific
names to avoid the issue.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
In mtd_ioctl MEMGETREGIONINFO the region_user_info pointer ur
is cast in __kernel space. This produces a number of sparse warnings
like:
warning: cast removes address space of expression
warning: incorrect type in initializer (different address spaces)
expected unsigned int const [noderef] <asn:1>*register __p
got unsigned int *<noident>
Since argp is already a void __user * just use it dirrectly without
the cast and make ur a __user *.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Uwe Kleine-König [Mon, 11 Jan 2010 16:53:16 +0000 (17:53 +0100)]
mtd: mxc-nand: don't disable clock in mxcnd-suspend
The clock must already be off after mtd->suspend. Disabling it again
results in an negative overflow of the clock usage count. This didn't
hurt as mxcnd_resume undid it after wake up.
Uwe Kleine-König [Mon, 11 Jan 2010 14:05:35 +0000 (15:05 +0100)]
mtd: mxc-nand: no need to check for validity of platform driver data
The probe function calls platform_set_drvdata with a valid pointer when
the probe is successful. As mxcnd_suspend and mxcnd_resume are only
called on bound devices, platform_get_drvdata always returns non-NULL.
This fix isn't critical as the pointer is always valid so it doesn't
matter if the compiler generated code for it or not.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Peter Huewe [Thu, 7 Jan 2010 01:51:13 +0000 (02:51 +0100)]
mtd: orion_nand: Fix build failure caused by typo
Commit e99030609e27abff7e1a868cb56384c678b09984 ("mtd: orion_nand.c: add
error handling and use resource_size()") introduced a build error -- it
assigns something to a undeclared variable 'err', whereas the rest of
the code uses 'ret' for this task.
This patch fixes this typo and thus removes the build failure.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
ioremap() returns a void __iomem * not an unsigned long. Update the
Documentation file to reflect this.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
mtd: drivers/mtd/nand/s3c2410.c: use resource_size()
Use resource_size().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
KOSAKI Motohiro [Tue, 22 Dec 2009 03:15:43 +0000 (03:15 +0000)]
kmsg_dump: Dump on crash_kexec as well
crash_kexec gets called before kmsg_dump(KMSG_DUMP_OOPS) if
panic_on_oops is set, so the kernel log buffer is not stored
for this case.
This patch adds a KMSG_DUMP_KEXEC dump type which gets called
when crash_kexec() is invoked. To avoid getting double dumps,
the old KMSG_DUMP_PANIC is moved below crash_kexec(). The
mtdoops driver is modified to handle KMSG_DUMP_KEXEC in the
same way as a panic.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Linus Torvalds [Wed, 16 Dec 2009 18:23:43 +0000 (10:23 -0800)]
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (90 commits)
jffs2: Fix long-standing bug with symlink garbage collection.
mtd: OneNAND: Fix test of unsigned in onenand_otp_walk()
mtd: cfi_cmdset_0002, fix lock imbalance
Revert "mtd: move mxcnd_remove to .exit.text"
mtd: m25p80: add support for Macronix MX25L4005A
kmsg_dump: fix build for CONFIG_PRINTK=n
mtd: nandsim: add support for 4KiB pages
mtd: mtdoops: refactor as a kmsg_dumper
mtd: mtdoops: make record size configurable
mtd: mtdoops: limit the maximum mtd partition size
mtd: mtdoops: keep track of used/unused pages in an array
mtd: mtdoops: several minor cleanups
core: Add kernel message dumper to call on oopses and panics
mtd: add ARM pismo support
mtd: pxa3xx_nand: Fix PIO data transfer
mtd: nand: fix multi-chip suspend problem
mtd: add support for switching old SST chips into QRY mode
mtd: fix M29W800D dev_id and uaddr
mtd: don't use PF_MEMALLOC
mtd: Add bad block table overrides to Davinci NAND driver
...
Fixed up conflicts (mostly trivial) in
drivers/mtd/devices/m25p80.c
drivers/mtd/maps/pcmciamtd.c
drivers/mtd/nand/pxa3xx_nand.c
kernel/printk.c
Linus Torvalds [Wed, 16 Dec 2009 18:12:07 +0000 (10:12 -0800)]
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6:
parisc: Fixup last users of irq_chip->typename
parisc: convert /proc/pdc/{lcd,led} to seq_file
parisc: Convert BUG() to use unreachable()
parisc: Replace old style lock init in smp.c
parisc: use sort() instead of home-made implementation (v2)
parisc: add CALLER_ADDR{0-6} macros
parisc: remove unused IRQSTAT_SIRQ_PEND and IRQSTAT_SZ defines
parisc: remove duplicated #include
Linus Torvalds [Wed, 16 Dec 2009 18:11:38 +0000 (10:11 -0800)]
Merge git://git.infradead.org/iommu-2.6
* git://git.infradead.org/iommu-2.6:
implement early_io{re,un}map for ia64
Revert "Intel IOMMU: Avoid memory allocation failures in dma map api calls"
intel-iommu: ignore page table validation in pass through mode
intel-iommu: Fix oops with intel_iommu=igfx_off
intel-iommu: Check for an RMRR which ends before it starts.
intel-iommu: Apply BIOS sanity checks for interrupt remapping too.
intel-iommu: Detect DMAR in hyperspace at probe time.
dmar: Fix build failure without NUMA, warn on bogus RHSA tables and don't abort
iommu: Allocate dma-remapping structures using numa locality info
intr_remap: Allocate intr-remapping table using numa locality info
dmar: Allocate queued invalidation structure using numa locality info
dmar: support for parsing Remapping Hardware Static Affinity structure
Linus Torvalds [Wed, 16 Dec 2009 18:09:16 +0000 (10:09 -0800)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (116 commits)
V4L/DVB (13698): pms: replace asm/uaccess.h to linux/uaccess.h
V4L/DVB (13690): radio/si470x: #include <sched.h>
V4L/DVB (13688): au8522: modify the attributes of local filter coefficients
V4L/DVB (13687): cx231xx: use NULL when pointer is needed
V4L/DVB: Davinci VPFE Capture: remove unused #include <linux/version.h>
V4L/DVB (13685): Correct code taking the size of a pointer
V4L/DVB (13684): Fix some cut-and-paste noise in dib0090.h
V4L/DVB (13683): sanio-ms: clean up init, exit and id_table
V4L/DVB (13682): dib8000: make some constant static
V4L/DVB: lgs8gxx: Use shifts rather than multiply/divide when possible
V4L/DVB (13680b): DocBook/media: create links for included sources
V4L/DVB (13680a): DocBook/media: copy images after building HTML
V4L/DVB (13678): Add support for yet another DvbWorld, TeVii and Prof USB devices
V4L/DVB (13676): configurable IRQ mode on NetUP Dual DVB-S2 CI; IRQ from CAM processing (CI interface works faster)
V4L/DVB (13674): stv090x: Add DiSEqC envelope mode
V4L/DVB (13673): lnbp21: Implement 22 kHz tone control
V4L/DVB (13671): sh_mobile_ceu_camera: Remove frame size page alignment
V4L/DVB (13670): soc-camera: Add mt9t112 camera driver
V4L/DVB (13669): tw9910: Add sync polarity support
V4L/DVB (13668): tw9910: remove cropping
...
Linus Torvalds [Wed, 16 Dec 2009 18:06:39 +0000 (10:06 -0800)]
Merge branch 'akpm'
* akpm: (173 commits)
genalloc: use bitmap_find_next_zero_area
ia64: use bitmap_find_next_zero_area
sparc: use bitmap_find_next_zero_area
mlx4: use bitmap_find_next_zero_area
isp1362-hcd: use bitmap_find_next_zero_area
iommu-helper: use bitmap library
bitmap: introduce bitmap_set, bitmap_clear, bitmap_find_next_zero_area
qnx4: use hweight8
qnx4fs: remove remains of the (defunct) write support
resource: constify arg to resource_size() and resource_type()
gru: send cross partition interrupts using the gru
gru: function to generate chipset IPI values
gru: update driver version number
gru: improve GRU TLB dropin statistics
gru: fix GRU interrupt race at deallocate
gru: add hugepage support
gru: fix bug in allocation of kernel contexts
gru: update GRU structures to match latest hardware spec
gru: check for correct GRU chiplet assignment
gru: remove stray local_irq_enable
...
Borislav Petkov [Tue, 15 Dec 2009 15:03:53 +0000 (16:03 +0100)]
edac, mce, amd: silence GART TLB errors
Although reporting of benign GART TLB errors is disabled in
__mcheck_cpu_apply_quirks, those are still being logged, and, as a
result, trip up amd64_edac. Pull up reporting check so that machines
with loaded edac module bail out early and don't spit fragments into
dmesg.
Akinobu Mita [Wed, 16 Dec 2009 00:48:24 +0000 (16:48 -0800)]
qnx4: use hweight8
Use hweight8 instead of counting for each bit
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Anders Larsen <al@alarsen.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:21 +0000 (16:48 -0800)]
gru: send cross partition interrupts using the gru
GRU Message queue instructions are used to deliver messages to other SSIs
within the numalink domain. In most cases, a single GRU mesq instruction
will deliver both the message AND an interrupt to notify the other SSI
that a messsage is present. In some cases, however, the interrupt must be
sent explicitly.
To improve resilency, the GRU driver should send these explicit interrupts
using the GRU to write the remote chipset register. Current code sends
the interrupt using a cpu instruction to write the chipset register.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:20 +0000 (16:48 -0800)]
gru: function to generate chipset IPI values
Create a function to generate the value that is written to the UV hub MMR
to cause an IPI interrupt to be sent. The function will be used in the
GRU message queue error recovery code that sends IPIs to nodes in remote
partitions.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:18 +0000 (16:48 -0800)]
gru: improve GRU TLB dropin statistics
Update the TLB dropin statistics kept for each GRU context. Count TLB
dropins separate from the misses - some misses do not result in a TLB
dropin. Some of the diagnostics need both counts.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:17 +0000 (16:48 -0800)]
gru: fix bug in allocation of kernel contexts
Fix a bug in the assignment of GRU contexts used for kernel functions. If
a sleep occurs on the wait for a semaphore, the thread could switch cpus
and allocate resources on the wrong blade.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:12 +0000 (16:48 -0800)]
gru: expicitly set instruction status to active
Explicitly set GRU instructions to "ACTIVE". This eliminates the need for
barriers that would have been necessary to prevent reading the instruction
"status" field before the GRU had actually started the instruction.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:11 +0000 (16:48 -0800)]
gru: fix prefetch and speculation bugs
Fix several bugs related to prefetch, ordering & speculation:
- GRU cch_allocate() instruction causes cacheable memory
to be created. Add a barriers to prevent speculation
from prefetching data before it exists.
- Add memory barriers before cache-flush instructions to ensure
that previously stored data is included in the line flushed to memory.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:09 +0000 (16:48 -0800)]
gru: add debug option for cache flushing
Add a debug option to the SGI GRU driver for flushing GRU cache lines from
memory. In theory this is not needed but it is useful for debugging.
This has no use by end users.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:07 +0000 (16:48 -0800)]
gru: support 64-bit GRU addresses
Increase the maximum address supported by the SGI GRU driver to a full 64
bits. Note that GRU addresses are not always the same as socket virtual
addresses. Sockets may not necessarily support the full 64 bits.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:05 +0000 (16:48 -0800)]
gru: allow users to specify gru chiplet 2
Add support to the GRU driver to allow users to specify the blade &
chiplet for allocation of GRU contexts. Add new statistics for context
loading/unloading/retargeting. Also deleted a few GRU stats that were no
longer being unused.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:04 +0000 (16:48 -0800)]
gru: allow users to specify gru chiplet 1
Add table & user request infrastructure that is needed to allow users to
specify the blade and chiplet for allocation of GRU contexts. Use of this
information is in a subsequent patch.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:03 +0000 (16:48 -0800)]
gru: fix istatus race in GRU tlb dropin
TLB dropins require updates to the CBR instruction istatus field. This is
needed to resolve race conditions in the chip.
The code currently uses the user address of the CBR. This works but opens
up additional endcases related to stealing of contexts and accessing the
CBR from tasks that do not have access to the user address space. (Some
of this non-user task access is debug code that is not currently being
pushed to the community).
User CBRs are also directly accessible using the kernel mapping of the
CBR. Change the TLB dropin code to use the the kernel mapping of the CBR.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jack Steiner [Wed, 16 Dec 2009 00:48:01 +0000 (16:48 -0800)]
gru: initial GRU based on blade topology
Change the GRU initialization code to initialize based on blade topology
instead of node topology. The result is the same but blade-based
initialization is cleaner.
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This was a difficult bug to trip. XPC was in the middle of sending an
acknowledgement for a received message.
In xpc_received_payload_uv():
.
ret = xpc_send_gru_msg(ch->sn.uv.cached_notify_gru_mq_desc, msg,
sizeof(struct xpc_notify_mq_msghdr_uv));
if (ret != xpSuccess)
XPC_DEACTIVATE_PARTITION(&xpc_partitions[ch->partid], ret);
msg->hdr.msg_slot_number += ch->remote_nentries;
at the point in xpc_send_gru_msg() where the hardware has dispatched the
acknowledgement, the remote side is able to reuse the message structure
and send a message with a different slot number. This problem is made
worse by interrupts.
The adjustment of msg_slot_number and the BUG_ON in
xpc_handle_notify_mq_msg_uv() which verifies the msg_slot_number is
consistent are only used for debug purposes. Since a fix for this that
preserves the debug functionality would either have to infringe upon the
payload or allocate another structure just for debug, I decided to remove
it entirely.
Signed-off-by: Robin Holt <holt@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Robin Holt [Wed, 16 Dec 2009 00:47:58 +0000 (16:47 -0800)]
X86: uv: xpc_make_first_contact hang due to not accepting ACTIVE state
Many times while the initial connection is being made, the contacted
partition will send back both the ACTIVATING and the ACTIVE
remote_act_state changes in very close succescion. The 1/4 second delay
in the make first contact loop is large enough to nearly always miss the
ACTIVATING state change.
Since either state indicates the remote partition has acknowledged our
state change, accept either.
Signed-off-by: Robin Holt <holt@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Robin Holt [Wed, 16 Dec 2009 00:47:57 +0000 (16:47 -0800)]
x86: uv: xpc NULL deref when mesq becomes empty
Under heavy load conditions, our set of xpc messages may become exhausted.
The code handles this correctly with the exception of the management code
which hits a NULL pointer dereference.
Signed-off-by: Robin Holt <holt@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Robin Holt [Wed, 16 Dec 2009 00:47:56 +0000 (16:47 -0800)]
x86: uv: update XPC to handle updated BIOS interface
The UV BIOS has moved the location of some of their pointers to the
"partition reserved page" from memory into a uv hub MMR. The GRU does not
support bcopy operations from MMR space so we need to special case the MMR
addresses using VLOAD operations.
Additionally, the BIOS call for registering a message queue watchlist has
removed the 'blade' value and eliminated the structure that was being
passed in. This is also reflected in this patch.
Signed-off-by: Robin Holt <holt@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Robin Holt [Wed, 16 Dec 2009 00:47:55 +0000 (16:47 -0800)]
X86: uv: implement a gru_read_gpa kernel function
The BIOS has decided to store a pointer to the partition reserved page in
a scratch MMR. The GRU is only able to read an MMR using a vload
instruction. The gru_read_gpa() function will implemented.
Signed-off-by: Robin Holt <holt@sgi.com> Signed-off-by: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Robin Holt [Wed, 16 Dec 2009 00:47:52 +0000 (16:47 -0800)]
x86: uv: introduce a means to translate from gpa -> socket_paddr
The UV BIOS has been updated to implement some of our interface
functionality differently than originally expected. These patches update
the kernel to the bios implementation and include a few minor bug fixes
which prevent us from doing significant testing on real hardware.
This patch:
For SGI UV systems, translate from a global physical address back to a
socket physical address. This does nothing to ensure the socket physical
address is actually addressable by the kernel. That is the responsibility
of the user of the function.
Signed-off-by: Robin Holt <holt@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Currently the locking in blockdev_direct_IO is a mess, we have three
different locking types and very confusing checks for some of them. The
most complicated one is DIO_OWN_LOCKING for reads, which happens to not
actually be used.
This patch gets rid of the DIO_OWN_LOCKING - as mentioned above the read
case is unused anyway, and the write side is almost identical to
DIO_NO_LOCKING. The difference is that DIO_NO_LOCKING always sets the
create argument for the get_blocks callback to zero, but we can easily
move that to the actual get_blocks callbacks. There are four users of the
DIO_NO_LOCKING mode: gfs already ignores the create argument and thus is
fine with the new version, ocfs2 only errors out if create were ever set,
and we can remove this dead code now, the block device code only ever uses
create for an error message if we are fully beyond the device which can
never happen, and last but not least XFS will need the new behavour for
writes.
Now we can replace the lock_type variable with a flags one, where no flag
means the DIO_NO_LOCKING behaviour and DIO_LOCKING is kept as the first
flag. Separate out the check for not allowing to fill holes into a
separate flag, although for now both flags always get set at the same
time.
Also revamp the documentation of the locking scheme to actually make
sense.
[akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Dave Chinner <david@fromorbit.com> Cc: Badari Pulavarty <pbadari@us.ibm.com> Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Zach Brown <zach.brown@oracle.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Alex Elder <aelder@sgi.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <joel.becker@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
dio: zero struct dio with kzalloc instead of manually
This patch uses kzalloc to zero all of struct dio rather than
manually trying to track which fields we rely on being zero. It
passed aio+dio stress testing and some bug regression testing on
ext3.
This patch was introduced by Linus in the conversation that lead up
to Badari's minimal fix to manually zero .map_bh.b_state in commit:
I was unable to measure a stable difference in the number of cpu
cycles spent in blockdev_direct_IO() when pushing aio+dio 256K reads
at ~340MB/s.
So the resulting intent of the patch isn't a performance gain but to
avoid exposing ourselves to the risk of finding another field like
.map_bh.b_state where we rely on zeroing but don't enforce it in the
code.
Zach surmised that zeroing out the page array was what caused most of
the problem, and suggested the approach taken in the attached patch for
resolving the issue. Intel re-tested with this patch and saw a 0.6%
performance gain (the original regression was 0.5%).
[akpm@linux-foundation.org: add comment] Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Acked-by: Zach Brown <zach.brown@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Shaohua Li [Wed, 16 Dec 2009 00:47:47 +0000 (16:47 -0800)]
aio: remove unused field
Don't know the reason, but it appears ki_wait field of iocb never gets used.
Signed-off-by: Shaohua Li <shaohua.li@intel.com> Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Benjamin LaHaise <bcrl@kvack.org> Cc: Zach Brown <zach.brown@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
David Howells [Wed, 16 Dec 2009 00:47:46 +0000 (16:47 -0800)]
FS-Cache: Avoid maybe-used-uninitialised warning on variable
Andrew Morton's compiler sees the following warning in FS-Cache:
fs/fscache/object-list.c: In function 'fscache_objlist_lookup':
fs/fscache/object-list.c:94: warning: 'obj' may be used uninitialized in this function
which my compiler doesn't. This is a false positive as obj can only be
used in the comparison against minobj if minobj has been set to something
other than NULL, but for that to happen, obj has to be first set to
something.
Deal with this by preclearing obj too.
Reported-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>