]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
13 years agoBased on earlier review comments, we'll no longer try to stick all of our
Daniel Drake [Sat, 16 Jul 2011 13:30:51 +0000 (23:30 +1000)]
Based on earlier review comments, we'll no longer try to stick all of our
XO-1 goodies in a single driver.  We'll split it into a power management
driver, and an EC/SCI driver.

As a first step, rename olpc-xo1 to olpc-xo1-pm, and make it builtin
instead of modular.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Andres Salomon <dilinger@queued.net>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoMove these definitions into the relevant header file. This was requested
Daniel Drake [Sat, 16 Jul 2011 13:30:50 +0000 (23:30 +1000)]
Move these definitions into the relevant header file.  This was requested
in the review of the upcoming XO-1 suspend/resume code.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Andres Salomon <dilinger@queued.net>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoIn response to new device tree code in the kernel, OLPC will start using
Daniel Drake [Sat, 16 Jul 2011 13:30:50 +0000 (23:30 +1000)]
In response to new device tree code in the kernel, OLPC will start using
it for probing of certain devices.  However, some firmware fixes are
needed to put the devicetree into a usable state.

Retain compatibility with old firmware by fixing up the device tree at
boot-time if it does not contain the new nodes/properties that we need for
probing.  This is the same approach taken on PPC platforms.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andres Salomon <dilinger@queued.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoReplace the bubble sort in sanitize_e820_map() with a call to the generic
Mike Ditto [Sat, 16 Jul 2011 13:30:50 +0000 (23:30 +1000)]
Replace the bubble sort in sanitize_e820_map() with a call to the generic
kernel sort function to avoid pathological performance with large maps.

On large (thousands of entries) E820 maps, the previous code took minutes
to run; with this change it's now milliseconds.

Signed-off-by: Mike Ditto <mditto@google.com>
Cc: Stefan Assmann <sassmann@kpanic.de>
Cc: Nancy Yuen <yuenn@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoThis new driver replaces the old PCEngines Alix 2/3 LED driver with a new
Ed Wildgoose [Sat, 16 Jul 2011 13:30:49 +0000 (23:30 +1000)]
This new driver replaces the old PCEngines Alix 2/3 LED driver with a new
driver that controls the LEDs through the leds-gpio driver.  The old
driver accessed GPIOs directly, which created a conflict and prevented
also loading the cs5535-gpio driver to read other GPIOs on the Alix board.
 With this new driver, we hook into leds-gpio which in turn uses GPIO to
control the LEDs and therefore it's possible to control both the LEDs and
access onboard GPIOs

Driver is moved to platform/geode and any other geode initialisation
modules should move here also.

This driver is inspired by leds-net5501.c by Alessandro Zummo.

Ideally, leds-net5501.c should also be moved to platform/geode.
Additionally the driver relies on parts of the patch: 7f131cf3ed ("leds:
leds-alix2c - take port address from MSR) by Daniel Mack to perform
detection of the Alix board.

Signed-off-by: Ed Wildgoose <kernel@wildgooses.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Daniel Mack <daniel@caiaq.de>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoOn x86_32 casting the unsigned int result of get_random_int() to long may
Ludwig Nussel [Sat, 16 Jul 2011 13:30:49 +0000 (23:30 +1000)]
On x86_32 casting the unsigned int result of get_random_int() to long may
result in a negative value.  On x86_32 the range of mmap_rnd() therefore
was -255 to 255.  The 32bit mode on x86_64 used 0 to 255 as intended.

The bug was introduced by 675a081 ("x86: unify mmap_{32|64}.c") in January
2008.

Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoThere was one code block that I commented to be able to test the patch dnd
Shérab [Sat, 16 Jul 2011 13:30:49 +0000 (23:30 +1000)]
There was one code block that I commented to be able to test the patch dnd
then forgot to uncomment again, and then you removed it but it should
actually have been uncommented rather than removed.  So here is the patch
tat corrects the code, to be applied on top of your own patch.

Cc: Len Brown <lenb@kernel.org>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years ago- remove commented-out code
Andrew Morton [Sat, 16 Jul 2011 13:30:48 +0000 (23:30 +1000)]
- remove commented-out code
- add missing space to printk
- clean up code layout

Cc: Len Brown <lenb@kernel.org>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Shérab <Sebastien.Hinderer@ens-lyon.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoThis makes the iris driver use the platform API, so it is properly exposed
Shérab [Sat, 16 Jul 2011 13:30:48 +0000 (23:30 +1000)]
This makes the iris driver use the platform API, so it is properly exposed
in /sys.

Signed-off-by: Shérab <Sebastien.Hinderer@ens-lyon.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoAdd support for Aspire 1410 BIOS v1.3314. Fixes the following error:
Clay Carpenter [Sat, 16 Jul 2011 13:30:48 +0000 (23:30 +1000)]
Add support for Aspire 1410 BIOS v1.3314.  Fixes the following error:

acerhdf: unknown (unsupported) BIOS version Acer/Aspire 1410/v1.3314,
please report, aborting!

Signed-off-by: Clay Carpenter <claycarpenter@gmail.com>
Signed-off-by: Peter Feuerer <peter@piie.net>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoLinux supports some optional features, but it should notify the BIOS about
Shaohua Li [Sat, 16 Jul 2011 13:30:47 +0000 (23:30 +1000)]
Linux supports some optional features, but it should notify the BIOS about
them via the _OSI method.  Currently Linux doesn't notify any, which might
make such features not work because the BIOS doesn't know about them.

Jarosz has a system which needs this to make ACPI processor aggregator
device work.

Reported-by: "Jarosz, Sebastian" <sebastian.jarosz@intel.com>
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agob552a8c56db8 ("ACPI: remove NID_INVAL") removed the left over uses of
David Rientjes [Sat, 16 Jul 2011 13:30:47 +0000 (23:30 +1000)]
b552a8c56db8 ("ACPI: remove NID_INVAL") removed the left over uses of
NID_INVAL, but didn't actually remove the definition.  Remove it.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoTHERMAL_HWMON is implemented inside the thermal_sys driver and has no
Jean Delvare [Sat, 16 Jul 2011 13:30:47 +0000 (23:30 +1000)]
THERMAL_HWMON is implemented inside the thermal_sys driver and has no
effect on drivers implementing thermal zones, so they shouldn't see
anything related to it in <linux/thermal.h>.  Making the THERMAL_HWMON
implementation fully internal has two advantages beyond the cleaner
design:

* This avoids rebuilding all thermal drivers if the THERMAL_HWMON
  implementation changes, or if CONFIG_THERMAL_HWMON gets enabled or
  disabled.

* This avoids breaking the thermal kABI in these cases too, which should
  make distributions happy.

The only drawback I can see is slightly higher memory fragmentation, as
the number of kzalloc() calls will increase by one per thermal zone.  But
I doubt it will be a problem in practice, as I've never seen a system with
more than two thermal zones.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rene Herman <rene.herman@gmail.com>
Cc: Len Brown <len.brown@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoWe'll soon need to reuse it.
Jean Delvare [Sat, 16 Jul 2011 13:30:46 +0000 (23:30 +1000)]
We'll soon need to reuse it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rene Herman <rene.herman@gmail.com>
Cc: Len Brown <len.brown@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoIt's about time to revert 16d752397301b9 ("thermal: Create
Jean Delvare [Sat, 16 Jul 2011 13:30:46 +0000 (23:30 +1000)]
It's about time to revert 16d752397301b9 ("thermal: Create
CONFIG_THERMAL_HWMON=n").  Anybody running a kernel >= 2.6.40 would also
be running a recent enough version of lm-sensors.

Actually having CONFIG_THERMAL_HWMON is pretty convenient so instead of
dropping it, we keep it but hide it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rene Herman <rene.herman@gmail.com>
Cc: Len Brown <len.brown@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agokernel/time.c:578: error: conflicting types for 'jiffies_to_clock_t'
Andrew Morton [Sat, 16 Jul 2011 13:30:46 +0000 (23:30 +1000)]
kernel/time.c:578: error: conflicting types for 'jiffies_to_clock_t'
include/linux/jiffies.h:306: note: previous declaration of 'jiffies_to_clock_t' was here

Cc: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: hank <pyu@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoThe parameter's origin type is long. On an i386 architecture, it can
hank [Sat, 16 Jul 2011 13:30:46 +0000 (23:30 +1000)]
The parameter's origin type is long.  On an i386 architecture, it can
easily be larger than 0x80000000, causing this function to convert it to a
sign-extended u64 type.  Change the type to unsigned long so we get the
correct result.

Signed-off-by: hank <pyu@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoThe out_msi_disable label should be before cleanup_nomem to additionally
Julia Lawall [Sat, 16 Jul 2011 13:30:45 +0000 (23:30 +1000)]
The out_msi_disable label should be before cleanup_nomem to additionally
benefit from the call to iounmap.  Subsequent gotos are adjusted to go to
out_msi_disable instead of cleanup_nomem, which now follows it.  This is
safe because pci_disable_msi does nothing if pci_enable_msi was not called.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression e1,e2;
statement S;
@@

e1 = pci_ioremap_bar(...);
... when != e1 = e2
    when != iounmap(e1)
    when any
(
 if (<+...e1...+>) S
|
 if(...) { ... return 0; }
|
 if (...) { ... when != iounmap(e1)
                when != if (...) { ... iounmap(e1) ... }
* return ...;
 } else S
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoThere's a code path in pmcraid that can be reached via device ioctl that
Dan Rosenberg [Sat, 16 Jul 2011 13:30:45 +0000 (23:30 +1000)]
There's a code path in pmcraid that can be reached via device ioctl that
causes all sorts of ugliness, including heap corruption or triggering the
OOM killer due to consecutive allocation of large numbers of pages.

First, the user can call pmcraid_chr_ioctl(), with a type
PMCRAID_PASSTHROUGH_IOCTL.  This calls through to
pmcraid_ioctl_passthrough().  Next, a pmcraid_passthrough_ioctl_buffer is
copied in, and the request_size variable is set to
buffer->ioarcb.data_transfer_length, which is an arbitrary 32-bit signed
value provided by the user.  If a negative value is provided here, bad
things can happen.  For example, pmcraid_build_passthrough_ioadls() is
called with this request_size, which immediately calls
pmcraid_alloc_sglist() with a negative size.  The resulting math on
allocating a scatter list can result in an overflow in the kzalloc() call
(if num_elem is 0, the sglist will be smaller than expected), or if
num_elem is unexpectedly large the subsequent loop will call alloc_pages()
repeatedly, a high number of pages will be allocated and the OOM killer
might be invoked.

It looks like preventing this value from being negative in
pmcraid_ioctl_passthrough() would be sufficient.  Something like this
might do:

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoarch/cris/arch-v10/kernel/irq.c:239: error: implicit declaration of function 'kgdb_init'
WANG Cong [Sat, 16 Jul 2011 13:30:44 +0000 (23:30 +1000)]
arch/cris/arch-v10/kernel/irq.c:239: error: implicit declaration of function 'kgdb_init'
arch/cris/arch-v10/kernel/irq.c:240: error: implicit declaration of function 'breakpoint'

Declare these two functions.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoarch/cris/arch-v10/drivers/sync_serial.c:961: error: conflicting types for 'sync_seri...
WANG Cong [Sat, 16 Jul 2011 13:30:44 +0000 (23:30 +1000)]
arch/cris/arch-v10/drivers/sync_serial.c:961: error: conflicting types for 'sync_serial_ioctl'

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoarch/cris/arch-v10/drivers/sync_serial.c:628: error: 'ret' undeclared (first use...
WANG Cong [Sat, 16 Jul 2011 13:30:44 +0000 (23:30 +1000)]
arch/cris/arch-v10/drivers/sync_serial.c:628: error: 'ret' undeclared (first use in this function)

'ret' should be 'err'.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoWARNING: line over 80 characters
Andrew Morton [Sat, 16 Jul 2011 13:30:43 +0000 (23:30 +1000)]
WARNING: line over 80 characters
#37: FILE: arch/cris/include/asm/thread_info.h:70:
+#define alloc_thread_info_node(tsk, node) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))

ERROR: space required after that ',' (ctx:VxV)
#37: FILE: arch/cris/include/asm/thread_info.h:70:
+#define alloc_thread_info_node(tsk, node) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
                                                                                              ^

total: 1 errors, 1 warnings, 18 lines checked

./patches/cris-fix-a-build-error-in-kernel-forkc.patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agokernel/fork.c:267: error: implicit declaration of function
WANG Cong [Sat, 16 Jul 2011 13:30:43 +0000 (23:30 +1000)]
kernel/fork.c:267: error: implicit declaration of function
'alloc_thread_info_node'

This is due to renaming alloc_thread_info() to alloc_thread_info_node().

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoVito said:
Peter Zijlstra [Sat, 16 Jul 2011 13:30:42 +0000 (23:30 +1000)]
Vito said:

: The system has many usb disks coming and going day to day, with their
: respective bdi's having min_ratio set to 1 when inserted.  It works for
: some time until eventually min_ratio can no longer be set, even when the
: active set of bdi's seen in /sys/class/bdi/*/min_ratio doesn't add up to
: anywhere near 100.
:
: This then leads to an unrelated starvation problem caused by write-heavy
: fuse mounts being used atop the usb disks, a problem the min_ratio setting
: at the underlying devices bdi effectively prevents.

Fix this leakage by resetting the bdi min_ratio when unregistering the
BDI.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Reported-by: Vito Caputo <lkml@pengaru.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoIf dmi_get_system_info() returns NULL, pch_phub_probe() will dereferencea
Alexander Stein [Sat, 16 Jul 2011 13:30:42 +0000 (23:30 +1000)]
If dmi_get_system_info() returns NULL, pch_phub_probe() will dereferencea
a zero pointer.

This oops was observed on an Atom based board which has no BIOS, but a
bootloder which doesn't privde DMI data.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Cc: Greg KH <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years ago2.6.36's 7e496299d4d2 ("tmpfs: make tmpfs scalable with percpu_counter for
Hugh Dickins [Sat, 16 Jul 2011 13:30:42 +0000 (23:30 +1000)]
2.6.36's 7e496299d4d2 ("tmpfs: make tmpfs scalable with percpu_counter for
used blocks") to make tmpfs scalable with percpu_counter used
inode->i_lock in place of sbinfo->stat_lock around i_blocks updates; but
that was adverse to scalability, and unnecessary, since info->lock is
already held there in the fast paths.

Remove those uses of i_lock, and add info->lock in the three error paths
where it's then needed across shmem_free_blocks().  It's not actually
needed across shmem_unacct_blocks(), but they're so often paired that it
looks wrong to split them apart.

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agotruncate_inode_pages_range()'s final loop has a nice pincer property,
Hugh Dickins [Sat, 16 Jul 2011 13:30:42 +0000 (23:30 +1000)]
truncate_inode_pages_range()'s final loop has a nice pincer property,
bringing start and end together, squeezing out the last pages.  But the
range handling missed out on that, just sliding up the range, perhaps
letting pages come in behind it.  Add one more test to give it the same
pincer effect.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoMake the pagevec_lookup loops in truncate_inode_pages_range(),
Hugh Dickins [Sat, 16 Jul 2011 13:30:41 +0000 (23:30 +1000)]
Make the pagevec_lookup loops in truncate_inode_pages_range(),
invalidate_mapping_pages() and invalidate_inode_pages2_range() more
consistent with each other.

They were relying upon page->index of an unlocked page, but apologizing
for it: accept it, embrace it, add comments and WARN_ONs, and simplify the
index handling.

invalidate_inode_pages2_range() had special handling for a wrapped
page->index + 1 = 0 case; but MAX_LFS_FILESIZE doesn't let us anywhere
near there, and a corrupt page->index in the radix_tree could cause more
trouble than that would catch.  Remove that wrapped handling.

invalidate_inode_pages2_range() uses min() to limit the pagevec_lookup
when near the end of the range: copy that into the other two, although
it's less useful than you might think (it limits the use of the buffer,
rather than the indices looked up).

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoUse consistent variable names in truncate_pagecache(), truncate_setsize(),
Hugh Dickins [Sat, 16 Jul 2011 13:30:41 +0000 (23:30 +1000)]
Use consistent variable names in truncate_pagecache(), truncate_setsize(),
vmtruncate() and vmtruncate_range().

unmap_mapping_range() and vmtruncate_range() have mismatched interfaces:
don't change either, but make the vmtruncates more precise about what they
expect unmap_mapping_range() to do.

vmtruncate_range() is currently called only with page-aligned start and
end+1: can handle unaligned start, but unaligned end+1 would hit BUG_ON in
truncate_inode_pages_range() (lacks partial clearing of the end page).

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoCorrect comment on truncate_inode_pages*() in linux/mm.h; and remove
Hugh Dickins [Sat, 16 Jul 2011 13:30:41 +0000 (23:30 +1000)]
Correct comment on truncate_inode_pages*() in linux/mm.h; and remove
declaration of page_unuse(), it didn't exist even in 2.2.26 or 2.4.0!

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoThe often-NULL data arg to read_cache_page() and read_mapping_page()
Hugh Dickins [Sat, 16 Jul 2011 13:30:40 +0000 (23:30 +1000)]
The often-NULL data arg to read_cache_page() and read_mapping_page()
functions is misdescribed as "destination for read data": no, it's the
first arg to the filler function, often struct file * to ->readpage().

Satisfy checkpatch.pl on those filler prototypes, and tidy up the
declarations in linux/pagemap.h.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agos/EIO/EFAULT/
Andrew Morton [Sat, 16 Jul 2011 13:30:40 +0000 (23:30 +1000)]
s/EIO/EFAULT/

Cc: <stable@kernel.org>
Cc: Christian Zankel <chris@zankel.net>
Cc: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoPrevent an arbitrary kernel read. Check the user pointer with access_ok()
Dan Rosenberg [Sat, 16 Jul 2011 13:30:40 +0000 (23:30 +1000)]
Prevent an arbitrary kernel read.  Check the user pointer with access_ok()
before copying data in.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Christian Zankel <chris@zankel.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agofix code layout
Andrew Morton [Sat, 16 Jul 2011 13:30:38 +0000 (23:30 +1000)]
fix code layout

Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoCurrently we are keeping faulted page locked throughout whole __do_fault
KAMEZAWA Hiroyuki [Sat, 16 Jul 2011 13:30:37 +0000 (23:30 +1000)]
Currently we are keeping faulted page locked throughout whole __do_fault
call (except for page_mkwrite code path) after calling file system's fault
code.  If we do early COW, we allocate a new page which has to be charged
for a memcg (mem_cgroup_newpage_charge).

This function, however, might block for unbounded amount of time if memcg
oom killer is disabled or fork-bomb is running because the only way out of
the OOM situation is either an external event or OOM-situation fix.

In the end we are keeping the faulted page locked and blocking other
processes from faulting it in which is not good at all because we are
basically punishing potentially an unrelated process for OOM condition in
a different group (I have seen stuck system because of ld-2.11.1.so being
locked).

We can do test easily.

 % cgcreate -g memory:A
 % cgset -r memory.limit_in_bytes=64M A
 % cgset -r memory.memsw.limit_in_bytes=64M A
 % cd kernel_dir; cgexec -g memory:A make -j

Then, the whole system will live-locked until you kill 'make -j'
by hands (or push reboot...) This is because some important page in a
a shared library are locked.

Considering again, the new page is not necessary to be allocated
with lock_page() held. And usual page allocation may dive into
long memory reclaim loop with holding lock_page() and can cause
very long latency.

There are 3 ways.
  1. do allocation/charge before lock_page()
     Pros. - simple and can handle page allocation in the same manner.
             This will reduce holding time of lock_page() in general.
     Cons. - we do page allocation even if ->fault() returns error.

  2. do charge after unlock_page(). Even if charge fails, it's just OOM.
     Pros. - no impact to non-memcg path.
     Cons. - implemenation requires special cares of LRU and we need to modify
             page_add_new_anon_rmap()...

  3. do unlock->charge->lock again method.
     Pros. - no impact to non-memcg path.
     Cons. - This may kill LOCK_PAGE_RETRY optimization. We need to release
             lock and get it again...

This patch moves "charge" and memory allocation for COW page
before lock_page(). Then, we can avoid scanning LRU with holding
a lock on a page and latency under lock_page() will be reduced.

Then, above livelock disappears.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reported-by: Lutz Vieweg <lvml@5t9.de>
Original-idea-by: Michal Hocko <mhocko@suse.cz>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Ying Han <yinghan@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 years agoMerge remote-tracking branch 'writeback/next'
Stephen Rothwell [Tue, 26 Jul 2011 04:44:09 +0000 (14:44 +1000)]
Merge remote-tracking branch 'writeback/next'

Conflicts:
fs/fs-writeback.c
mm/filemap.c

13 years agoMerge remote-tracking branch 'tmem/linux-next'
Stephen Rothwell [Tue, 26 Jul 2011 04:39:13 +0000 (14:39 +1000)]
Merge remote-tracking branch 'tmem/linux-next'

13 years agoMerge remote-tracking branch 'staging/staging-next'
Stephen Rothwell [Tue, 26 Jul 2011 04:37:29 +0000 (14:37 +1000)]
Merge remote-tracking branch 'staging/staging-next'

Conflicts:
Documentation/feature-removal-schedule.txt
drivers/staging/bcm/headers.h
drivers/staging/brcm80211/brcmfmac/dhd_linux.c
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
drivers/staging/brcm80211/brcmfmac/wl_iw.c
drivers/staging/et131x/et131x_netdev.c
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
drivers/staging/rtl8192e/r8192E.h
drivers/staging/tm6000/tm6000-alsa.c
drivers/staging/usbip/userspace/src/utils.h

13 years agoMerge remote-tracking branch 'usb/usb-next'
Stephen Rothwell [Tue, 26 Jul 2011 04:23:09 +0000 (14:23 +1000)]
Merge remote-tracking branch 'usb/usb-next'

Conflicts:
Documentation/feature-removal-schedule.txt

13 years agoMerge remote-tracking branch 'tty/tty-next'
Stephen Rothwell [Tue, 26 Jul 2011 04:19:42 +0000 (14:19 +1000)]
Merge remote-tracking branch 'tty/tty-next'

13 years agoMerge remote-tracking branch 'driver-core/driver-core-next'
Stephen Rothwell [Tue, 26 Jul 2011 04:18:15 +0000 (14:18 +1000)]
Merge remote-tracking branch 'driver-core/driver-core-next'

13 years agoMerge remote-tracking branch 'regmap/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 04:16:49 +0000 (14:16 +1000)]
Merge remote-tracking branch 'regmap/for-next'

13 years agoMerge remote-tracking branch 'namespace/master'
Stephen Rothwell [Tue, 26 Jul 2011 04:15:24 +0000 (14:15 +1000)]
Merge remote-tracking branch 'namespace/master'

13 years agoMerge remote-tracking branch 'sysctl/master'
Stephen Rothwell [Tue, 26 Jul 2011 04:14:06 +0000 (14:14 +1000)]
Merge remote-tracking branch 'sysctl/master'

13 years agoMerge remote-tracking branch 'drivers-x86/linux-next'
Stephen Rothwell [Tue, 26 Jul 2011 04:12:27 +0000 (14:12 +1000)]
Merge remote-tracking branch 'drivers-x86/linux-next'

Conflicts:
Documentation/feature-removal-schedule.txt

13 years agoMerge remote-tracking branch 'xen-two/linux-next'
Stephen Rothwell [Tue, 26 Jul 2011 04:06:46 +0000 (14:06 +1000)]
Merge remote-tracking branch 'xen-two/linux-next'

13 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Tue, 26 Jul 2011 04:06:10 +0000 (14:06 +1000)]
Merge remote-tracking branch 'tip/auto-latest'

13 years agoMerge remote-tracking branch 'i7300_edac/linux_next'
Stephen Rothwell [Tue, 26 Jul 2011 04:06:00 +0000 (14:06 +1000)]
Merge remote-tracking branch 'i7300_edac/linux_next'

13 years agoMerge remote-tracking branch 'i7core_edac/linux_next'
Stephen Rothwell [Tue, 26 Jul 2011 04:04:25 +0000 (14:04 +1000)]
Merge remote-tracking branch 'i7core_edac/linux_next'

13 years agoMerge remote-tracking branch 'fsnotify/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 04:01:45 +0000 (14:01 +1000)]
Merge remote-tracking branch 'fsnotify/for-next'

13 years agoMerge remote-tracking branch 'watchdog/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:59:56 +0000 (13:59 +1000)]
Merge remote-tracking branch 'watchdog/master'

13 years agoMerge remote-tracking branch 'agp/agp-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:59:10 +0000 (13:59 +1000)]
Merge remote-tracking branch 'agp/agp-next'

13 years agoMerge remote-tracking branch 'security-testing/next'
Stephen Rothwell [Tue, 26 Jul 2011 03:57:31 +0000 (13:57 +1000)]
Merge remote-tracking branch 'security-testing/next'

Conflicts:
security/tomoyo/realpath.c

13 years agoMerge remote-tracking branch 'voltage/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:55:58 +0000 (13:55 +1000)]
Merge remote-tracking branch 'voltage/for-next'

13 years agoMerge remote-tracking branch 'fbdev/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:54:18 +0000 (13:54 +1000)]
Merge remote-tracking branch 'fbdev/master'

13 years agoMerge remote-tracking branch 'drm/drm-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:52:38 +0000 (13:52 +1000)]
Merge remote-tracking branch 'drm/drm-next'

13 years agoMerge remote-tracking branch 'mfd/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:51:04 +0000 (13:51 +1000)]
Merge remote-tracking branch 'mfd/for-next'

Conflicts:
drivers/gpio/Makefile
drivers/mfd/Makefile

13 years agoMerge remote-tracking branch 'md/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:49:36 +0000 (13:49 +1000)]
Merge remote-tracking branch 'md/for-next'

13 years agoMerge remote-tracking branch 'slab/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:42:57 +0000 (13:42 +1000)]
Merge remote-tracking branch 'slab/for-next'

13 years agoMerge remote-tracking branch 'mmc/mmc-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:41:29 +0000 (13:41 +1000)]
Merge remote-tracking branch 'mmc/mmc-next'

13 years agoMerge remote-tracking branch 'leds/for-mm'
Stephen Rothwell [Tue, 26 Jul 2011 03:41:22 +0000 (13:41 +1000)]
Merge remote-tracking branch 'leds/for-mm'

Conflicts:
drivers/leds/Kconfig

13 years agoMerge remote-tracking branch 'battery/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:39:38 +0000 (13:39 +1000)]
Merge remote-tracking branch 'battery/master'

13 years agoMerge branch 'quilt/device-mapper'
Stephen Rothwell [Tue, 26 Jul 2011 03:37:59 +0000 (13:37 +1000)]
Merge branch 'quilt/device-mapper'

13 years agoMerge remote-tracking branch 'block/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:37:53 +0000 (13:37 +1000)]
Merge remote-tracking branch 'block/for-next'

13 years agoMerge remote-tracking branch 'input/next'
Stephen Rothwell [Tue, 26 Jul 2011 03:36:04 +0000 (13:36 +1000)]
Merge remote-tracking branch 'input/next'

13 years agoMerge branch 'quilt/rr'
Stephen Rothwell [Tue, 26 Jul 2011 03:36:00 +0000 (13:36 +1000)]
Merge branch 'quilt/rr'

Conflicts:
arch/m68k/kernel/module_mm.c
arch/m68k/kernel/module_no.c
arch/x86/lguest/i386_head.S

13 years agoMerge remote-tracking branch 'sound/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:31:54 +0000 (13:31 +1000)]
Merge remote-tracking branch 'sound/for-next'

13 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:30:21 +0000 (13:30 +1000)]
Merge remote-tracking branch 'l2-mtd/master'

Conflicts:
drivers/mtd/maps/pxa2xx-flash.c

13 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:28:56 +0000 (13:28 +1000)]
Merge remote-tracking branch 'bluetooth/master'

13 years agoMerge remote-tracking branch 'wireless/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:27:34 +0000 (13:27 +1000)]
Merge remote-tracking branch 'wireless/master'

13 years agoMerge remote-tracking branch 'async_tx/next'
Stephen Rothwell [Tue, 26 Jul 2011 03:24:33 +0000 (13:24 +1000)]
Merge remote-tracking branch 'async_tx/next'

13 years agoMerge remote-tracking branch 'slave-dma/next'
Stephen Rothwell [Tue, 26 Jul 2011 03:23:01 +0000 (13:23 +1000)]
Merge remote-tracking branch 'slave-dma/next'

Conflicts:
drivers/dma/mv_xor.c

13 years agoMerge remote-tracking branch 'iscsi-target/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:21:35 +0000 (13:21 +1000)]
Merge remote-tracking branch 'iscsi-target/for-next'

13 years agoMerge remote-tracking branch 'ibft/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:21:30 +0000 (13:21 +1000)]
Merge remote-tracking branch 'ibft/master'

13 years agoMerge remote-tracking branch 'swiotlb/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:21:25 +0000 (13:21 +1000)]
Merge remote-tracking branch 'swiotlb/master'

13 years agoMerge remote-tracking branch 'cpupowerutils/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:19:47 +0000 (13:19 +1000)]
Merge remote-tracking branch 'cpupowerutils/master'

13 years agoMerge remote-tracking branch 'powertools/tools-test'
Stephen Rothwell [Tue, 26 Jul 2011 03:18:25 +0000 (13:18 +1000)]
Merge remote-tracking branch 'powertools/tools-test'

13 years agoMerge remote-tracking branch 'idle-test/idle-test'
Stephen Rothwell [Tue, 26 Jul 2011 03:17:05 +0000 (13:17 +1000)]
Merge remote-tracking branch 'idle-test/idle-test'

13 years agoMerge remote-tracking branch 'acpi/test'
Stephen Rothwell [Tue, 26 Jul 2011 03:10:48 +0000 (13:10 +1000)]
Merge remote-tracking branch 'acpi/test'

Conflicts:
arch/ia64/Kconfig
arch/powerpc/Kconfig
arch/x86/Kconfig
lib/Kconfig
lib/Makefile

13 years agoMerge remote-tracking branch 'kconfig/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:10:36 +0000 (13:10 +1000)]
Merge remote-tracking branch 'kconfig/for-next'

13 years agoMerge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:09:01 +0000 (13:09 +1000)]
Merge remote-tracking branch 'kbuild/for-next'

13 years agoMerge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Tue, 26 Jul 2011 03:07:14 +0000 (13:07 +1000)]
Merge remote-tracking branch 'v4l-dvb/master'

13 years agoMerge branch 'quilt/kernel-doc'
Stephen Rothwell [Tue, 26 Jul 2011 03:05:55 +0000 (13:05 +1000)]
Merge branch 'quilt/kernel-doc'

13 years agoMerge remote-tracking branch 'hwmon-staging/hwmon-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:04:28 +0000 (13:04 +1000)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'

13 years agoMerge branch 'quilt/jdelvare-hwmon'
Stephen Rothwell [Tue, 26 Jul 2011 03:04:26 +0000 (13:04 +1000)]
Merge branch 'quilt/jdelvare-hwmon'

13 years agoMerge remote-tracking branch 'bjdooks-i2c/next-i2c'
Stephen Rothwell [Tue, 26 Jul 2011 03:03:11 +0000 (13:03 +1000)]
Merge remote-tracking branch 'bjdooks-i2c/next-i2c'

13 years agoMerge branch 'quilt/i2c'
Stephen Rothwell [Tue, 26 Jul 2011 03:03:09 +0000 (13:03 +1000)]
Merge branch 'quilt/i2c'

13 years agoMerge remote-tracking branch 'hid/for-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:03:00 +0000 (13:03 +1000)]
Merge remote-tracking branch 'hid/for-next'

13 years agoMerge remote-tracking branch 'pci/linux-next'
Stephen Rothwell [Tue, 26 Jul 2011 03:00:01 +0000 (13:00 +1000)]
Merge remote-tracking branch 'pci/linux-next'

13 years agoMerge remote-tracking branch 'squashfs/master'
Stephen Rothwell [Tue, 26 Jul 2011 02:58:38 +0000 (12:58 +1000)]
Merge remote-tracking branch 'squashfs/master'

13 years agoMerge remote-tracking branch 'ocfs2/linux-next'
Stephen Rothwell [Tue, 26 Jul 2011 02:57:18 +0000 (12:57 +1000)]
Merge remote-tracking branch 'ocfs2/linux-next'

13 years agoMerge remote-tracking branch 'nfsd/nfsd-next'
Stephen Rothwell [Tue, 26 Jul 2011 02:51:35 +0000 (12:51 +1000)]
Merge remote-tracking branch 'nfsd/nfsd-next'

Conflicts:
Documentation/feature-removal-schedule.txt

13 years agoMerge remote-tracking branch 'nfs/linux-next'
Stephen Rothwell [Tue, 26 Jul 2011 02:13:03 +0000 (12:13 +1000)]
Merge remote-tracking branch 'nfs/linux-next'

13 years agoMerge remote-tracking branch 'logfs/master'
Stephen Rothwell [Tue, 26 Jul 2011 02:12:59 +0000 (12:12 +1000)]
Merge remote-tracking branch 'logfs/master'

Conflicts:
fs/logfs/logfs.h

13 years agoMerge remote-tracking branch 'jfs/next'
Stephen Rothwell [Tue, 26 Jul 2011 02:11:13 +0000 (12:11 +1000)]
Merge remote-tracking branch 'jfs/next'

13 years agoMerge remote-tracking branch 'ext4/dev'
Stephen Rothwell [Tue, 26 Jul 2011 02:09:34 +0000 (12:09 +1000)]
Merge remote-tracking branch 'ext4/dev'

Conflicts:
fs/ext4/inode.c

13 years agoMerge remote-tracking branch 'ext3/for_next'
Stephen Rothwell [Tue, 26 Jul 2011 02:03:47 +0000 (12:03 +1000)]
Merge remote-tracking branch 'ext3/for_next'

Conflicts:
fs/ext3/fsync.c

13 years agoMerge remote-tracking branch 'ecryptfs/next'
Stephen Rothwell [Tue, 26 Jul 2011 02:03:40 +0000 (12:03 +1000)]
Merge remote-tracking branch 'ecryptfs/next'

13 years agoMerge remote-tracking branch 'cifs/master'
Stephen Rothwell [Tue, 26 Jul 2011 02:02:18 +0000 (12:02 +1000)]
Merge remote-tracking branch 'cifs/master'