]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agosuper: fix calculation of shrinkable objects for small numbers
Glauber Costa [Thu, 18 Jul 2013 23:59:51 +0000 (09:59 +1000)]
super: fix calculation of shrinkable objects for small numbers

The sysctl knob sysctl_vfs_cache_pressure is used to determine which
percentage of the shrinkable objects in our cache we should actively try
to shrink.

It works great in situations in which we have many objects (at least more
than 100), because the aproximation errors will be negligible.  But if
this is not the case, specially when total_objects < 100, we may end up
concluding that we have no objects at all (total / 100 = 0, if total <
100).

This is certainly not the biggest killer in the world, but may matter in
very low kernel memory situations.

Signed-off-by: Glauber Costa <glommer@openvz.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Carlos Maiolino <cmaiolino@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Rientjes <rientjes@google.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: J. Bruce Fields <bfields@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Kent Overstreet <koverstreet@google.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofs: bump inode and dentry counters to long
Glauber Costa [Thu, 18 Jul 2013 23:59:51 +0000 (09:59 +1000)]
fs: bump inode and dentry counters to long

This series reworks our current object cache shrinking infrastructure in
two main ways:

 * Noticing that a lot of users copy and paste their own version of LRU
   lists for objects, we put some effort in providing a generic version.
   It is modeled after the filesystem users: dentries, inodes, and xfs
   (for various tasks), but we expect that other users could benefit in
   the near future with little or no modification.  Let us know if you
   have any issues.

 * The underlying list_lru being proposed automatically and
   transparently keeps the elements in per-node lists, and is able to
   manipulate the node lists individually.  Given this infrastructure, we
   are able to modify the up-to-now hammer called shrink_slab to proceed
   with node-reclaim instead of always searching memory from all over like
   it has been doing.

Per-node lru lists are also expected to lead to less contention in the lru
locks on multi-node scans, since we are now no longer fighting for a
global lock.  The locks usually disappear from the profilers with this
change.

Although we have no official benchmarks for this version - be our guest to
independently evaluate this - earlier versions of this series were
performance tested (details at
http://permalink.gmane.org/gmane.linux.kernel.mm/100537) yielding no
visible performance regressions while yielding a better qualitative
behavior in NUMA machines.

With this infrastructure in place, we can use the list_lru entry point to
provide memcg isolation and per-memcg targeted reclaim.  Historically,
those two pieces of work have been posted together.  This version presents
only the infrastructure work, deferring the memcg work for a later time,
so we can focus on getting this part tested.  You can see more about the
history of such work at http://lwn.net/Articles/552769/

Dave Chinner (18):
  dcache: convert dentry_stat.nr_unused to per-cpu counters
  dentry: move to per-sb LRU locks
  dcache: remove dentries from LRU before putting on dispose list
  mm: new shrinker API
  shrinker: convert superblock shrinkers to new API
  list: add a new LRU list type
  inode: convert inode lru list to generic lru list code.
  dcache: convert to use new lru list infrastructure
  list_lru: per-node list infrastructure
  shrinker: add node awareness
  fs: convert inode and dentry shrinking to be node aware
  xfs: convert buftarg LRU to generic code
  xfs: rework buffer dispose list tracking
  xfs: convert dquot cache lru to list_lru
  fs: convert fs shrinkers to new scan/count API
  drivers: convert shrinkers to new count/scan API
  shrinker: convert remaining shrinkers to count/scan API
  shrinker: Kill old ->shrink API.

Glauber Costa (7):
  fs: bump inode and dentry counters to long
  super: fix calculation of shrinkable objects for small numbers
  list_lru: per-node API
  vmscan: per-node deferred work
  i915: bail out earlier when shrinker cannot acquire mutex
  hugepage: convert huge zero page shrinker to new shrinker API
  list_lru: dynamically adjust node arrays

This patch:

There are situations in very large machines in which we can have a large
quantity of dirty inodes, unused dentries, etc.  This is particularly true
when umounting a filesystem, where eventually since every live object will
eventually be discarded.

Dave Chinner reported a problem with this while experimenting with the
shrinker revamp patchset.  So we believe it is time for a change.  This
patch just moves int to longs.  Machines where it matters should have a
big long anyway.

Signed-off-by: Glauber Costa <glommer@openvz.org>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Carlos Maiolino <cmaiolino@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: J. Bruce Fields <bfields@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Kent Overstreet <koverstreet@google.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoMerge branch 'akpm-current/current'
Stephen Rothwell [Fri, 19 Jul 2013 03:01:49 +0000 (13:01 +1000)]
Merge branch 'akpm-current/current'

11 years agoMerge remote-tracking branch 'aio/master'
Stephen Rothwell [Fri, 19 Jul 2013 02:49:15 +0000 (12:49 +1000)]
Merge remote-tracking branch 'aio/master'

11 years agoMerge remote-tracking branch 'ptr-ret/PTR_RET'
Stephen Rothwell [Fri, 19 Jul 2013 02:41:05 +0000 (12:41 +1000)]
Merge remote-tracking branch 'ptr-ret/PTR_RET'

11 years agoMerge remote-tracking branch 'lzo-update/lzo-update'
Stephen Rothwell [Fri, 19 Jul 2013 02:39:25 +0000 (12:39 +1000)]
Merge remote-tracking branch 'lzo-update/lzo-update'

11 years agoMerge remote-tracking branch 'userns/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:37:40 +0000 (12:37 +1000)]
Merge remote-tracking branch 'userns/for-next'

11 years agoMerge remote-tracking branch 'dma-mapping/dma-mapping-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:37:33 +0000 (12:37 +1000)]
Merge remote-tracking branch 'dma-mapping/dma-mapping-next'

11 years agoMerge remote-tracking branch 'tegra/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:35:56 +0000 (12:35 +1000)]
Merge remote-tracking branch 'tegra/for-next'

11 years agoMerge remote-tracking branch 'msm/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:35:42 +0000 (12:35 +1000)]
Merge remote-tracking branch 'msm/for-next'

11 years agoMerge remote-tracking branch 'imx-mxs/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:34:01 +0000 (12:34 +1000)]
Merge remote-tracking branch 'imx-mxs/for-next'

11 years agoMerge remote-tracking branch 'ep93xx/ep93xx-for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:34:00 +0000 (12:34 +1000)]
Merge remote-tracking branch 'ep93xx/ep93xx-for-next'

11 years agoMerge remote-tracking branch 'cortex/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:32:21 +0000 (12:32 +1000)]
Merge remote-tracking branch 'cortex/for-next'

11 years agoMerge remote-tracking branch 'arm-soc/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:30:44 +0000 (12:30 +1000)]
Merge remote-tracking branch 'arm-soc/for-next'

11 years agoMerge remote-tracking branch 'gpio-lw/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:29:07 +0000 (12:29 +1000)]
Merge remote-tracking branch 'gpio-lw/for-next'

11 years agoMerge remote-tracking branch 'vhost/linux-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:27:23 +0000 (12:27 +1000)]
Merge remote-tracking branch 'vhost/linux-next'

11 years agoMerge remote-tracking branch 'bcon/master'
Stephen Rothwell [Fri, 19 Jul 2013 02:25:07 +0000 (12:25 +1000)]
Merge remote-tracking branch 'bcon/master'

Conflicts:
drivers/block/Kconfig

11 years agoMerge remote-tracking branch 'scsi/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:24:51 +0000 (12:24 +1000)]
Merge remote-tracking branch 'scsi/for-next'

11 years agoMerge remote-tracking branch 'leds/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:23:07 +0000 (12:23 +1000)]
Merge remote-tracking branch 'leds/for-next'

11 years agoMerge remote-tracking branch 'regmap/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:21:26 +0000 (12:21 +1000)]
Merge remote-tracking branch 'regmap/for-next'

11 years agoMerge remote-tracking branch 'drivers-x86/linux-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:21:18 +0000 (12:21 +1000)]
Merge remote-tracking branch 'drivers-x86/linux-next'

11 years agoMerge remote-tracking branch 'workqueues/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:21:15 +0000 (12:21 +1000)]
Merge remote-tracking branch 'workqueues/for-next'

11 years agoMerge remote-tracking branch 'xen-two/linux-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:21:10 +0000 (12:21 +1000)]
Merge remote-tracking branch 'xen-two/linux-next'

11 years agoMerge remote-tracking branch 'kvm-ppc/kvm-ppc-next'
Stephen Rothwell [Fri, 19 Jul 2013 02:14:07 +0000 (12:14 +1000)]
Merge remote-tracking branch 'kvm-ppc/kvm-ppc-next'

Conflicts:
mm/Kconfig

11 years agoMerge remote-tracking branch 'rcu/rcu/next'
Stephen Rothwell [Fri, 19 Jul 2013 02:05:45 +0000 (12:05 +1000)]
Merge remote-tracking branch 'rcu/rcu/next'

11 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Fri, 19 Jul 2013 01:57:29 +0000 (11:57 +1000)]
Merge remote-tracking branch 'tip/auto-latest'

11 years agoMerge remote-tracking branch 'spi-mb/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:55:27 +0000 (11:55 +1000)]
Merge remote-tracking branch 'spi-mb/for-next'

11 years agoMerge remote-tracking branch 'trivial/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:53:38 +0000 (11:53 +1000)]
Merge remote-tracking branch 'trivial/for-next'

11 years agoMerge remote-tracking branch 'lblnet/master'
Stephen Rothwell [Fri, 19 Jul 2013 01:49:05 +0000 (11:49 +1000)]
Merge remote-tracking branch 'lblnet/master'

11 years agoMerge remote-tracking branch 'selinux/master'
Stephen Rothwell [Fri, 19 Jul 2013 01:49:02 +0000 (11:49 +1000)]
Merge remote-tracking branch 'selinux/master'

11 years agoMerge remote-tracking branch 'regulator/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:47:18 +0000 (11:47 +1000)]
Merge remote-tracking branch 'regulator/for-next'

11 years agoMerge remote-tracking branch 'omap_dss2/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:47:14 +0000 (11:47 +1000)]
Merge remote-tracking branch 'omap_dss2/for-next'

11 years agoMerge remote-tracking branch 'fbdev/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:45:37 +0000 (11:45 +1000)]
Merge remote-tracking branch 'fbdev/for-next'

11 years agoMerge remote-tracking branch 'md/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:42:55 +0000 (11:42 +1000)]
Merge remote-tracking branch 'md/for-next'

Conflicts:
drivers/md/raid1.c

11 years agoMerge remote-tracking branch 'slab/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:34:59 +0000 (11:34 +1000)]
Merge remote-tracking branch 'slab/for-next'

11 years agoMerge remote-tracking branch 'kgdb/kgdb-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:34:54 +0000 (11:34 +1000)]
Merge remote-tracking branch 'kgdb/kgdb-next'

11 years agoMerge remote-tracking branch 'block/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:33:01 +0000 (11:33 +1000)]
Merge remote-tracking branch 'block/for-next'

11 years agoMerge remote-tracking branch 'cgroup/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:28:31 +0000 (11:28 +1000)]
Merge remote-tracking branch 'cgroup/for-next'

11 years agoMerge remote-tracking branch 'sound-asoc/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:26:41 +0000 (11:26 +1000)]
Merge remote-tracking branch 'sound-asoc/for-next'

11 years agoMerge remote-tracking branch 'sound/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:25:05 +0000 (11:25 +1000)]
Merge remote-tracking branch 'sound/for-next'

11 years agoMerge remote-tracking branch 'drm-intel/for-linux-next'
Stephen Rothwell [Fri, 19 Jul 2013 01:23:16 +0000 (11:23 +1000)]
Merge remote-tracking branch 'drm-intel/for-linux-next'

Conflicts:
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_gem.c

11 years agoMerge remote-tracking branch 'crypto/master'
Stephen Rothwell [Fri, 19 Jul 2013 01:21:38 +0000 (11:21 +1000)]
Merge remote-tracking branch 'crypto/master'

11 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Fri, 19 Jul 2013 01:20:00 +0000 (11:20 +1000)]
Merge remote-tracking branch 'l2-mtd/master'

11 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Fri, 19 Jul 2013 01:18:22 +0000 (11:18 +1000)]
Merge remote-tracking branch 'bluetooth/master'

Conflicts:
drivers/net/wireless/rtlwifi/ps.c

11 years agoMerge remote-tracking branch 'ipsec-next/master'
Stephen Rothwell [Fri, 19 Jul 2013 01:15:02 +0000 (11:15 +1000)]
Merge remote-tracking branch 'ipsec-next/master'

11 years agoMerge remote-tracking branch 'slave-dma/next'
Stephen Rothwell [Fri, 19 Jul 2013 01:10:38 +0000 (11:10 +1000)]
Merge remote-tracking branch 'slave-dma/next'

11 years agoMerge remote-tracking branch 'thermal/next'
Stephen Rothwell [Fri, 19 Jul 2013 01:08:57 +0000 (11:08 +1000)]
Merge remote-tracking branch 'thermal/next'

11 years agoMerge remote-tracking branch 'idle/next'
Stephen Rothwell [Fri, 19 Jul 2013 01:07:14 +0000 (11:07 +1000)]
Merge remote-tracking branch 'idle/next'

11 years agoMerge remote-tracking branch 'pm/linux-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:59:07 +0000 (10:59 +1000)]
Merge remote-tracking branch 'pm/linux-next'

11 years agoMerge remote-tracking branch 'libata/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:57:18 +0000 (10:57 +1000)]
Merge remote-tracking branch 'libata/for-next'

11 years agoMerge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:57:08 +0000 (10:57 +1000)]
Merge remote-tracking branch 'kbuild/for-next'

11 years agoMerge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Fri, 19 Jul 2013 00:57:06 +0000 (10:57 +1000)]
Merge remote-tracking branch 'v4l-dvb/master'

11 years agoMerge remote-tracking branch 'hwmon-staging/hwmon-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:55:31 +0000 (10:55 +1000)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'

Conflicts:
drivers/hwmon/coretemp.c

11 years agoMerge branch 'jdelvare-hwmon/master'
Stephen Rothwell [Fri, 19 Jul 2013 00:36:43 +0000 (10:36 +1000)]
Merge branch 'jdelvare-hwmon/master'

11 years agoMerge remote-tracking branch 'hid/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:35:05 +0000 (10:35 +1000)]
Merge remote-tracking branch 'hid/for-next'

11 years agoMerge remote-tracking branch 'vfs/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:29:05 +0000 (10:29 +1000)]
Merge remote-tracking branch 'vfs/for-next'

11 years agoMerge remote-tracking branch 'ocfs2/linux-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:26:48 +0000 (10:26 +1000)]
Merge remote-tracking branch 'ocfs2/linux-next'

11 years agoMerge remote-tracking branch 'nfs/linux-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:25:12 +0000 (10:25 +1000)]
Merge remote-tracking branch 'nfs/linux-next'

11 years agoMerge remote-tracking branch 'logfs/master'
Stephen Rothwell [Fri, 19 Jul 2013 00:23:10 +0000 (10:23 +1000)]
Merge remote-tracking branch 'logfs/master'

11 years agoMerge remote-tracking branch 'gfs2/master'
Stephen Rothwell [Fri, 19 Jul 2013 00:21:35 +0000 (10:21 +1000)]
Merge remote-tracking branch 'gfs2/master'

11 years agoMerge remote-tracking branch 'fuse/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:20:02 +0000 (10:20 +1000)]
Merge remote-tracking branch 'fuse/for-next'

11 years agoMerge remote-tracking branch 'f2fs/dev'
Stephen Rothwell [Fri, 19 Jul 2013 00:18:29 +0000 (10:18 +1000)]
Merge remote-tracking branch 'f2fs/dev'

11 years agoMerge remote-tracking branch 'ext4/dev'
Stephen Rothwell [Fri, 19 Jul 2013 00:16:54 +0000 (10:16 +1000)]
Merge remote-tracking branch 'ext4/dev'

11 years agoMerge remote-tracking branch 'cifs/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:15:16 +0000 (10:15 +1000)]
Merge remote-tracking branch 'cifs/for-next'

11 years agoMerge remote-tracking branch 'btrfs/next'
Stephen Rothwell [Fri, 19 Jul 2013 00:15:13 +0000 (10:15 +1000)]
Merge remote-tracking branch 'btrfs/next'

11 years agoMerge remote-tracking branch 'tile/master'
Stephen Rothwell [Fri, 19 Jul 2013 00:13:38 +0000 (10:13 +1000)]
Merge remote-tracking branch 'tile/master'

11 years agoMerge remote-tracking branch 'sh/sh-latest'
Stephen Rothwell [Fri, 19 Jul 2013 00:12:04 +0000 (10:12 +1000)]
Merge remote-tracking branch 'sh/sh-latest'

Conflicts:
arch/sh/kernel/cpu/sh2a/Makefile
include/linux/serial_sci.h

11 years agoMerge remote-tracking branch 's390/features'
Stephen Rothwell [Fri, 19 Jul 2013 00:10:28 +0000 (10:10 +1000)]
Merge remote-tracking branch 's390/features'

11 years agoMerge remote-tracking branch 'parisc-hd/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:08:51 +0000 (10:08 +1000)]
Merge remote-tracking branch 'parisc-hd/for-next'

11 years agoMerge remote-tracking branch 'mips/mips-for-linux-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:07:17 +0000 (10:07 +1000)]
Merge remote-tracking branch 'mips/mips-for-linux-next'

11 years agoMerge remote-tracking branch 'm68knommu/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:05:44 +0000 (10:05 +1000)]
Merge remote-tracking branch 'm68knommu/for-next'

11 years agoMerge remote-tracking branch 'ia64/next'
Stephen Rothwell [Fri, 19 Jul 2013 00:04:10 +0000 (10:04 +1000)]
Merge remote-tracking branch 'ia64/next'

11 years agoMerge remote-tracking branch 'cris/for-next'
Stephen Rothwell [Fri, 19 Jul 2013 00:02:36 +0000 (10:02 +1000)]
Merge remote-tracking branch 'cris/for-next'

Conflicts:
arch/cris/arch-v32/drivers/Kconfig

11 years agoMerge remote-tracking branch 'blackfin/for-linus'
Stephen Rothwell [Fri, 19 Jul 2013 00:02:28 +0000 (10:02 +1000)]
Merge remote-tracking branch 'blackfin/for-linus'

11 years agoMerge remote-tracking branch 'arm64/upstream'
Stephen Rothwell [Fri, 19 Jul 2013 00:00:55 +0000 (10:00 +1000)]
Merge remote-tracking branch 'arm64/upstream'

11 years agostaging/lustre: replace num_physpages with totalram_pages
Peng Tao [Thu, 18 Jul 2013 23:57:00 +0000 (09:57 +1000)]
staging/lustre: replace num_physpages with totalram_pages

The global variable num_physpages is going away. Replace it
with totalram_pages.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agostaging/lustre/libcfs: cleanup linux-mem.h
Peng Tao [Thu, 18 Jul 2013 23:57:00 +0000 (09:57 +1000)]
staging/lustre/libcfs: cleanup linux-mem.h

remove shrinker related wrappers.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agostaging/lustre/ptlrpc: convert to new shrinker API
Peng Tao [Thu, 18 Jul 2013 23:56:59 +0000 (09:56 +1000)]
staging/lustre/ptlrpc: convert to new shrinker API

Convert sptlrpc encode pool shrinker to use scan/count API.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agostaging/lustre/obdclass: convert lu_object shrinker to count/scan API
Peng Tao [Thu, 18 Jul 2013 23:56:59 +0000 (09:56 +1000)]
staging/lustre/obdclass: convert lu_object shrinker to count/scan API

convert lu_object shrinker to new count/scan API.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agostaging/lustre/ldlm: convert to shrinkers to count/scan API
Peng Tao [Thu, 18 Jul 2013 23:56:59 +0000 (09:56 +1000)]
staging/lustre/ldlm: convert to shrinkers to count/scan API

convert ldlm shrinker to new count/scan API.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc: document general ipc locking scheme
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:58 +0000 (09:56 +1000)]
ipc: document general ipc locking scheme

As suggested by Andrew, add a generic initial locking scheme used
throughout all sysv ipc mechanisms.  Documenting the ids rwsem, how rcu
can be enough to do the initial checks and when to actually acquire the
kern_ipc_perm.lock spinlock.

I found that adding it to util.c was generic enough.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc,msg: drop msg_unlock
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:58 +0000 (09:56 +1000)]
ipc,msg: drop msg_unlock

There is only one user left, drop this function and just call
ipc_unlock_object() and rcu_read_unlock().

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc: rename ids->rw_mutex
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:58 +0000 (09:56 +1000)]
ipc: rename ids->rw_mutex

Since in some situations the lock can be shared for readers, we shouldn't
be calling it a mutex, rename it to rwsem.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc,shm: shorten critical region for shmat
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:58 +0000 (09:56 +1000)]
ipc,shm: shorten critical region for shmat

Similar to other system calls, acquire the kern_ipc_perm lock after doing
the initial permission and security checks.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc,shm: cleanup do_shmat pasta
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:57 +0000 (09:56 +1000)]
ipc,shm: cleanup do_shmat pasta

Clean up some of the messy do_shmat() spaghetti code, getting rid of
out_free and out_put_dentry labels.  This makes shortening the critical
region of this function in the next patch a little easier to do and read.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc,shm: shorten critical region for shmctl
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:57 +0000 (09:56 +1000)]
ipc,shm: shorten critical region for shmctl

With the *_INFO, *_STAT, IPC_RMID and IPC_SET commands already optimized,
deal with the remaining SHM_LOCK and SHM_UNLOCK commands.  Take the
shm_perm lock after doing the initial auditing and security checks.  The
rest of the logic remains unchanged.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipcshm-make-shmctl_nolock-lockless-checkpatch-fixes
Andrew Morton [Thu, 18 Jul 2013 23:56:57 +0000 (09:56 +1000)]
ipcshm-make-shmctl_nolock-lockless-checkpatch-fixes

WARNING: space prohibited between function name and open parenthesis '('
#65: FILE: ipc/shm.c:921:
+ if (copy_shmid_to_user (buf, &tbuf, version))

total: 0 errors, 1 warnings, 54 lines checked

./patches/ipcshm-make-shmctl_nolock-lockless.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc,shm: make shmctl_nolock lockless
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:56 +0000 (09:56 +1000)]
ipc,shm: make shmctl_nolock lockless

While the INFO cmd doesn't take the ipc lock, the STAT commands do acquire
it unnecessarily.  We can do the permissions and security checks only
holding the rcu lock.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc,shm: introduce shmctl_nolock
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:56 +0000 (09:56 +1000)]
ipc,shm: introduce shmctl_nolock

Similar to semctl and msgctl, when calling msgctl, the *_INFO and *_STAT
commands can be performed without acquiring the ipc object.

Add a shmctl_nolock() function and move the logic of *_INFO and *_STAT out
of msgctl().  Since we are just moving functionality, this change still
takes the lock and it will be properly lockless in the next patch.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc-drop-ipcctl_pre_down-fix
Andrew Morton [Thu, 18 Jul 2013 23:56:56 +0000 (09:56 +1000)]
ipc-drop-ipcctl_pre_down-fix

fix function name in kerneldoc, cleanups

Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc: drop ipcctl_pre_down
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:55 +0000 (09:56 +1000)]
ipc: drop ipcctl_pre_down

Now that sem, msgque and shm, through *_down(), all use the lockless
variant of ipcctl_pre_down(), go ahead and delete it.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc,shm: shorten critical region in shmctl_down
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:55 +0000 (09:56 +1000)]
ipc,shm: shorten critical region in shmctl_down

Instead of holding the ipc lock for the entire function, use the
ipcctl_pre_down_nolock and only acquire the lock for specific commands:
RMID and SET.

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoipc,shm: introduce lockless functions to obtain the ipc object
Davidlohr Bueso [Thu, 18 Jul 2013 23:56:55 +0000 (09:56 +1000)]
ipc,shm: introduce lockless functions to obtain the ipc object

This is the third and final patchset that deals with reducing the amount
of contention we impose on the ipc lock (kern_ipc_perm.lock).  These
changes mostly deal with shared memory, previous work has already been
done for semaphores and message queues:

http://lkml.org/lkml/2013/3/20/546 (sems)
http://lkml.org/lkml/2013/5/15/584 (mqueues)

With these patches applied, a custom shm microbenchmark stressing shmctl
doing IPC_STAT with 4 threads a million times, reduces the execution time
by 50%.  A similar run, this time with IPC_SET, reduces the execution time
from 3 mins and 35 secs to 27 seconds.

Patches 1-8: replaces blindly taking the ipc lock for a smarter combination
of rcu and ipc_obtain_object, only acquiring the spinlock when updating.

Patch 9: renames the ids rw_mutex to rwsem, which is what it already was.

Patch 10: is a trivial mqueue leftover cleanup

Patch 11: adds a brief lock scheme description, requested by Andrew.

This patch:

Add shm_obtain_object() and shm_obtain_object_check(), which will allow us
to get the ipc object without acquiring the lock.  Just as with other
forms of ipc, these functions are basically wrappers around
ipc_obtain_object*().

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorelay-fix-timer-madness-v2
zhangwei(Jovi) [Thu, 18 Jul 2013 23:56:54 +0000 (09:56 +1000)]
relay-fix-timer-madness-v2

Changed from v1:
mod timer interval changed from jiffies+1 to HZ/10, as Ingo suggested.

Signed-off-by: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agorelay: fix timer madness
Ingo Molnar [Thu, 18 Jul 2013 23:56:54 +0000 (09:56 +1000)]
relay: fix timer madness

When I'm using below ktap script to trace all event tracepoints, without
this patch, the system will hang in few seconds, the patch indeed fix the
problem as the changelog pointed.

function eventfun (e) {
         printf("%d %d\t%s\t%s", cpu(), pid(), execname(), e.annotate)
}

kdebug.probe("tp:", eventfun)

kdebug.probe_end(function () {
         printf("probe end\n")
})

This patch is old, I can found the original patch discussion in 2007.
http://marc.info/?l=linux-kernel&m=118544794717162&w=2 (In that mail
thread, the patch didn't fix that problem, but it fix the problem I
encountered now)

Ingo's original changelog:

Remove timer calls (!!!) from deep within the tracing infrastructure.
This was totally bogus code that can cause lockups and worse.
Poll the buffer every 2 jiffies for now.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomemstick: add support for legacy memorysticks
Maxim Levitsky [Thu, 18 Jul 2013 23:56:53 +0000 (09:56 +1000)]
memstick: add support for legacy memorysticks

Based partially on MS standard spec quotes from Alex Dubov.

As any code that works with user data this driver isn't recommended to use
to write cards that contain valuable data.

It tries its best though to avoid data corruption and possible damage to
the card.

Tested on MS DUO 64 MB card on Ricoh R592 card reader.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agomove-exit_task_namespaces-outside-of-exit_notify-fix
Andrew Morton [Thu, 18 Jul 2013 23:56:53 +0000 (09:56 +1000)]
move-exit_task_namespaces-outside-of-exit_notify-fix

make fput() comment more truthful

Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andrey Vagin <avagin@openvz.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agosignals: eventpoll: set ->saved_sigmask at the start
Oleg Nesterov [Thu, 18 Jul 2013 23:56:52 +0000 (09:56 +1000)]
signals: eventpoll: set ->saved_sigmask at the start

task_struct->saved_sigmask has no meaning unless we return with
set_restore_sigmask() and nobody except current can use it.

This means that sys_epoll_pwait() doesn't need to save ->blocked
into the local var and then memcopy it into ->saved_sigmask, we
can simply set ->saved_sigmask right before set_current_blocked().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Eric Wong <normalperson@yhbt.net>
Cc: Jason Baron <jbaron@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofat-additions-to-support-fat_fallocate-fix
Andrew Morton [Thu, 18 Jul 2013 23:56:52 +0000 (09:56 +1000)]
fat-additions-to-support-fat_fallocate-fix

fix min() warning

Cc: Amit Sahrawat <a.sahrawat@samsung.com>
Cc: Namjae Jeon <namjae.jeon@samsung.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Ravishankar N <ravi.n1@samsung.com>
Reported-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agofat: additions to support fat_fallocate
Namjae Jeon [Thu, 18 Jul 2013 23:56:52 +0000 (09:56 +1000)]
fat: additions to support fat_fallocate

Implement preallocation via the fallocate syscall on VFAT partitions.

With FALLOC_FL_KEEP_SIZE, there is no way to distinguish if the mismatch
between i_size and no.  of clusters allocated is a consequence of
fallocate or just plain corruption.  When a non fallocate aware (old)
linux fat driver tries to write to such a file, it throws an error.Also,
fsck detects this as inconsistency and truncates the prealloc'd blocks.

To avoid this, as suggested by OGAWA, remove changes that make fallocate
persistent across mounts and restrict lifetime of blocks from fallocate(2)
to file release.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ravishankar N <ravi.n1@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>