]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agoAdd linux-next specific files for 20140116 next-20140116
Stephen Rothwell [Thu, 16 Jan 2014 06:37:11 +0000 (17:37 +1100)]
Add linux-next specific files for 20140116

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
10 years agoMerge branch 'akpm/master'
Stephen Rothwell [Thu, 16 Jan 2014 06:01:42 +0000 (17:01 +1100)]
Merge branch 'akpm/master'

10 years agomm: add strictlimit knob
Maxim Patlasov [Wed, 15 Jan 2014 05:56:13 +0000 (16:56 +1100)]
mm: add strictlimit knob

The "strictlimit" feature was introduced to enforce per-bdi dirty limits
for FUSE which sets bdi max_ratio to 1% by default:

http://article.gmane.org/gmane.linux.kernel.mm/105809

However the feature can be useful for other relatively slow or untrusted
BDIs like USB flash drives and DVD+RW.  The patch adds a knob to enable
the feature:

echo 1 > /sys/class/bdi/X:Y/strictlimit

Being enabled, the feature enforces bdi max_ratio limit even if global
(10%) dirty limit is not reached.  Of course, the effect is not visible
until /sys/class/bdi/X:Y/max_ratio is decreased to some reasonable value.

Signed-off-by: Maxim Patlasov <MPatlasov@parallels.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: "Artem S. Tashkinov" <t.artem@lycos.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Jan Kara <jack@suse.cz>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: remove zram->lock in read path and change it with mutex
Minchan Kim [Wed, 15 Jan 2014 05:56:13 +0000 (16:56 +1100)]
zram: remove zram->lock in read path and change it with mutex

Finally, we separated zram->lock dependency from 32bit stat/ table
handling so there is no reason to use rw_semaphore between read and write
path so this patch removes the lock from read path totally and changes
rw_semaphore with mutex.  So, we could do

old:

read-read: OK
read-write: NO
write-write: NO

Now:

read-read: OK
read-write: OK
write-write: NO

So below data proves mixed workload performs well 11 times
and there is also enhance on write-write path because current
rw-semaphore doesn't support SPIN_ON_OWNER.
It's side effect but anyway good thing for us.

Write-related test perform better(from 61% to 1058%) but
read path has good/bad(from -2.22% to 1.45%) but they are all
marginal within stddev.

CPU 12
iozone -t -T -l 12 -u 12 -r 16K -s 60M -I +Z -V 0

==Initial write           ==Initial write
records: 10               records: 10
avg:  516189.16           avg:  839907.96
std:   22486.53 (4.36%)   std:   47902.17 (5.70%)
max:  546970.60           max:  909910.35
min:  481131.54           min:  751148.38
==Rewrite                 ==Rewrite
records: 10               records: 10
avg:  509527.98           avg: 1050156.37
std:   45799.94 (8.99%)   std:   40695.44 (3.88%)
max:  611574.27           max: 1111929.26
min:  443679.95           min:  980409.62
==Read                    ==Read
records: 10               records: 10
avg: 4408624.17           avg: 4472546.76
std:  281152.61 (6.38%)   std:  163662.78 (3.66%)
max: 4867888.66           max: 4727351.03
min: 4058347.69           min: 4126520.88
==Re-read                 ==Re-read
records: 10               records: 10
avg: 4462147.53           avg: 4363257.75
std:  283546.11 (6.35%)   std:  247292.63 (5.67%)
max: 4912894.44           max: 4677241.75
min: 4131386.50           min: 4035235.84
==Reverse Read            ==Reverse Read
records: 10               records: 10
avg: 4565865.97           avg: 4485818.08
std:  313395.63 (6.86%)   std:  248470.10 (5.54%)
max: 5232749.16           max: 4789749.94
min: 4185809.62           min: 3963081.34
==Stride read             ==Stride read
records: 10               records: 10
avg: 4515981.80           avg: 4418806.01
std:  211192.32 (4.68%)   std:  212837.97 (4.82%)
max: 4889287.28           max: 4686967.22
min: 4210362.00           min: 4083041.84
==Random read             ==Random read
records: 10               records: 10
avg: 4410525.23           avg: 4387093.18
std:  236693.22 (5.37%)   std:  235285.23 (5.36%)
max: 4713698.47           max: 4669760.62
min: 4057163.62           min: 3952002.16
==Mixed workload          ==Mixed workload
records: 10               records: 10
avg:  243234.25           avg: 2818677.27
std:   28505.07 (11.72%)  std:  195569.70 (6.94%)
max:  288905.23           max: 3126478.11
min:  212473.16           min: 2484150.69
==Random write            ==Random write
records: 10               records: 10
avg:  555887.07           avg: 1053057.79
std:   70841.98 (12.74%)  std:   35195.36 (3.34%)
max:  683188.28           max: 1096125.73
min:  437299.57           min:  992481.93
==Pwrite                  ==Pwrite
records: 10               records: 10
avg:  501745.93           avg:  810363.09
std:   16373.54 (3.26%)   std:   19245.01 (2.37%)
max:  518724.52           max:  833359.70
min:  464208.73           min:  765501.87
==Pread                   ==Pread
records: 10               records: 10
avg: 4539894.60           avg: 4457680.58
std:  197094.66 (4.34%)   std:  188965.60 (4.24%)
max: 4877170.38           max: 4689905.53
min: 4226326.03           min: 4095739.72

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: remove workqueue for freeing removed pending slot
Minchan Kim [Wed, 15 Jan 2014 05:56:12 +0000 (16:56 +1100)]
zram: remove workqueue for freeing removed pending slot

a0c516c ("zram: don't grab mutex in zram_slot_free_noity") introduced free
request pending code to avoid scheduling by mutex under spinlock and it
was a mess which made code lenghty and increased overhead.

Now, we don't need zram->lock any more to free slot so this patch reverts
it and then, tb_lock should protect it.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: introduce zram->tb_lock
Minchan Kim [Wed, 15 Jan 2014 05:56:12 +0000 (16:56 +1100)]
zram: introduce zram->tb_lock

Currently, table is protected by zram->lock but it's rather coarse-grained
lock and it makes hard for scalibility.

Let's use own rwlock instead of depending on zram->lock.  This patch adds
new locking so obviously, it would make slow but this patch is just
prepartion for removing coarse-grained rw_semaphore(ie, zram->lock) which
is hurdle about zram scalability.

Final patch in this patchset series will remove the lock from read-path
and change rw_semaphore with mutex in write path.  With bonus, we could
drop pending slot free mess in next patch.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: use atomic operation for stat
Minchan Kim [Wed, 15 Jan 2014 05:56:12 +0000 (16:56 +1100)]
zram: use atomic operation for stat

Some of fields in zram->stats are protected by zram->lock which
is rather coarse-grained so let's use atomic operation without
explict locking.

This patch is ready for removing dependency of zram->lock in
read path which is very coarse-grained rw_semaphore.
Of course, this patch adds new atomic operation so it might make
slow but my 12CPU test couldn't spot any regression.
All gain/lose is marginal within stddev.

iozone -t -T -l 12 -u 12 -r 16K -s 60M -I +Z -V 0

==Initial write ==Initial write
records: 50 records: 50
avg:  412875.17 avg:  415638.23
std:   38543.12 (9.34%) std:   36601.11 (8.81%)
max:  521262.03 max:  502976.72
min:  343263.13 min:  351389.12
==Rewrite ==Rewrite
records: 50 records: 50
avg:  416640.34 avg:  397914.33
std:   60798.92 (14.59%) std:   46150.42 (11.60%)
max:  543057.07 max:  522669.17
min:  304071.67 min:  316588.77
==Read ==Read
records: 50 records: 50
avg: 4147338.63 avg: 4070736.51
std:  179333.25 (4.32%) std:  223499.89 (5.49%)
max: 4459295.28 max: 4539514.44
min: 3753057.53 min: 3444686.31
==Re-read ==Re-read
records: 50 records: 50
avg: 4096706.71 avg: 4117218.57
std:  229735.04 (5.61%) std:  171676.25 (4.17%)
max: 4430012.09 max: 4459263.94
min: 2987217.80 min: 3666904.28
==Reverse Read ==Reverse Read
records: 50 records: 50
avg: 4062763.83 avg: 4078508.32
std:  186208.46 (4.58%) std:  172684.34 (4.23%)
max: 4401358.78 max: 4424757.22
min: 3381625.00 min: 3679359.94
==Stride read ==Stride read
records: 50 records: 50
avg: 4094933.49 avg: 4082170.22
std:  185710.52 (4.54%) std:  196346.68 (4.81%)
max: 4478241.25 max: 4460060.97
min: 3732593.23 min: 3584125.78
==Random read ==Random read
records: 50 records: 50
avg: 4031070.04 avg: 4074847.49
std:  192065.51 (4.76%) std:  206911.33 (5.08%)
max: 4356931.16 max: 4399442.56
min: 3481619.62 min: 3548372.44
==Mixed workload ==Mixed workload
records: 50 records: 50
avg:  149925.73 avg:  149675.54
std:    7701.26 (5.14%) std:    6902.09 (4.61%)
max:  191301.56 max:  175162.05
min:  133566.28 min:  137762.87
==Random write ==Random write
records: 50 records: 50
avg:  404050.11 avg:  393021.47
std:   58887.57 (14.57%) std:   42813.70 (10.89%)
max:  601798.09 max:  524533.43
min:  325176.99 min:  313255.34
==Pwrite ==Pwrite
records: 50 records: 50
avg:  411217.70 avg:  411237.96
std:   43114.99 (10.48%) std:   33136.29 (8.06%)
max:  530766.79 max:  471899.76
min:  320786.84 min:  317906.94
==Pread ==Pread
records: 50 records: 50
avg: 4154908.65 avg: 4087121.92
std:  151272.08 (3.64%) std:  219505.04 (5.37%)
max: 4459478.12 max: 4435857.38
min: 3730512.41 min: 3101101.67

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: remove unnecessary free
Minchan Kim [Wed, 15 Jan 2014 05:56:12 +0000 (16:56 +1100)]
zram: remove unnecessary free

a0c516cbfc ("zram: don't grab mutex in zram_slot_free_noity") introduced
pending zram slot free in zram's write path in case of missing slot free
by memory allocation failure in zram_slot_free_notify but it is not
necessary because we have already freed the slot right before overwriting.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: delay pending free request in read path
Minchan Kim [Wed, 15 Jan 2014 05:56:11 +0000 (16:56 +1100)]
zram: delay pending free request in read path

Sergey reported we don't need to handle pending free request every I/O so
that this patch removes it in read path while we remain it in write path.

Let's consider below example.

Swap subsystem ask to zram "A" block free by swap_slot_free_notify but
zram had been pended it without real freeing.  Swap subsystem allocates
"A" block for new data but request pended for a long time just handled and
zram blindly free new data on the "A" block.  :(

That's why we couldn't remove handle pending free request right before
zram-write.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: fix race between reset and flushing pending work
Minchan Kim [Wed, 15 Jan 2014 05:56:11 +0000 (16:56 +1100)]
zram: fix race between reset and flushing pending work

Dan and Sergey reported that there is a racy between reset and flushing of
pending work so that it could make oops by freeing zram->meta in reset
while zram_slot_free can access zram->meta if new request is adding during
the race window.

This patch moves flush after taking init_lock so it prevents new request
so that it closes the race.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoarm: move arm_dma_limit to setup_dma_zone
Vladimir Murzin [Wed, 15 Jan 2014 05:56:11 +0000 (16:56 +1100)]
arm: move arm_dma_limit to setup_dma_zone

Since 4dcfa600 ("ARM: DMA-API: better handing of DMA masks for coherent
allocations") arm_dma_limit_pfn has almost substituted the arm_dma_limit.
The remaining user is dma_contiguous_reserve().  It is also referenced in
setup_dma_zone() to calculate arm_dma_limit_pfn.

Kill the global arm_dma_limit and equip setup_zone_dma with the local one.

Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
Reported-by: Vassili Karpov <av1474@comtv.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agokernel/smp.c: remove cpumask_ipi
Roman Gushchin [Wed, 15 Jan 2014 05:56:11 +0000 (16:56 +1100)]
kernel/smp.c: remove cpumask_ipi

After 9a46ad6 ("smp: make smp_call_function_many() use logic similar to
smp_call_function_single()"), cfd->cpumask is accessed only in
smp_call_function_many().  So there is no more need to copy it into
cfd->cpumask_ipi before putting csd into the list.  The cpumask_ipi field
is obsolete and can be removed.

Signed-off-by: Roman Gushchin <klamm@yandex-team.ru>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Wang YanQing <udknight@gmail.com>
Cc: Xie XiuQi <xiexiuqi@huawei.com>
Cc: Shaohua Li <shli@fusionio.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agokernel: use lockless list for smp_call_function_single
Christoph Hellwig [Wed, 15 Jan 2014 05:56:10 +0000 (16:56 +1100)]
kernel: use lockless list for smp_call_function_single

Make smp_call_function_single and friends more efficient by using
a lockless list.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoblock/blk-mq-cpu.c: use hotcpu_notifier()
Andrew Morton [Wed, 15 Jan 2014 05:56:10 +0000 (16:56 +1100)]
block/blk-mq-cpu.c: use hotcpu_notifier()

Cc: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozsmalloc: add maintainers
Minchan Kim [Wed, 15 Jan 2014 05:56:10 +0000 (16:56 +1100)]
zsmalloc: add maintainers

tAdd adds maintainer information for zsmalloc into the MAINTAINERS file.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: add zram maintainers
Minchan Kim [Wed, 15 Jan 2014 05:56:10 +0000 (16:56 +1100)]
zram: add zram maintainers

Add maintainer information for zram into the MAINTAINERS file.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozsmalloc: add copyright
Minchan Kim [Wed, 15 Jan 2014 05:56:09 +0000 (16:56 +1100)]
zsmalloc: add copyright

Add my copyright to the zsmalloc source code which I maintain.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: add copyright
Minchan Kim [Wed, 15 Jan 2014 05:56:09 +0000 (16:56 +1100)]
zram: add copyright

Add my copyright to the zram source code which I maintain.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: remove old private project comment
Minchan Kim [Wed, 15 Jan 2014 05:56:09 +0000 (16:56 +1100)]
zram: remove old private project comment

Remove the old private compcache project address so upcoming patches
should be sent to LKML because we Linux kernel community will take care.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch.pl: check for function declarations without arguments
Joe Perches [Wed, 15 Jan 2014 05:56:09 +0000 (16:56 +1100)]
checkpatch.pl: check for function declarations without arguments

Functions like this one are evil:

void foo()
{
...
}

Because these functions allow variadic arguments without
checking the arguments at all.

Original patch by Richard Weinberger.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/net/phy/mdio_bus.c: call put_device on device_register() failure
Levente Kurusa [Wed, 15 Jan 2014 05:56:08 +0000 (16:56 +1100)]
drivers/net/phy/mdio_bus.c: call put_device on device_register() failure

It is required to call put_device() if device_register() fails, so that we
give up the last reference to the device.  Calling put_device allows for
mdiobus_release to be executed, kfreeing the bus.

Signed-off-by: Levente Kurusa <levex@linux.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: David Daney <david.daney@cavium.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/video/backlight/lcd.c: call put_device if device_register fails
Levente Kurusa [Wed, 15 Jan 2014 05:56:08 +0000 (16:56 +1100)]
drivers/video/backlight/lcd.c: call put_device if device_register fails

Currently we kfree the container of the device which failed to register.
This is wrong as the last reference is not given up with a put_device
call.  Also, now that we have put_device() callen, we no longer need the
kfree as the new_ld->dev.release function will take care of kfreeing the
associated memory.

Signed-off-by: Levente Kurusa <levex@linux.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/w1/w1_int.c: call put_device if device_register fails
Levente Kurusa [Wed, 15 Jan 2014 05:56:08 +0000 (16:56 +1100)]
drivers/w1/w1_int.c: call put_device if device_register fails

Currently, memsetting and kfreeing the device is bad behaviour.  The
device will have a reference count of 1 and hence can cause trouble
because it has kfree'd.  Proper way to handle a failed device_register is
to call put_device right after it fails.

Signed-off-by: Levente Kurusa <levex@linux.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozram: promote zram from staging
Minchan Kim [Wed, 15 Jan 2014 05:56:08 +0000 (16:56 +1100)]
zram: promote zram from staging

Zram has lived in staging for a LONG LONG time and have been
fixed/improved by many contributors so code is clean and stable now.  Of
course, there are lots of product using zram in real practice.

The major TV companys have used zram as swap since two years ago and
recently our production team released android smart phone with zram which
is used as swap, too and recently Android Kitkat start to use zram for
small memory smart phone.  And there was a report Google released their
ChromeOS with zram, too and cyanogenmod have been used zram long time ago.
 And I heard some disto have used zram block device for tmpfs.  In
addition, I saw many report from many other peoples.  For example, Lubuntu
start to use it.

The benefit of zram is very clear.  With my experience, one of the benefit
was to remove jitter of video application with backgroud memory pressure.
It would be effect of efficient memory usage by compression but more issue
is whether swap is there or not in the system.  Recent mobile platforms
have used JAVA so there are many anonymous pages.  But embedded system
normally are reluctant to use eMMC or SDCard as swap because there is
wear-leveling and latency issues so if we do not use swap, it means we
can't reclaim anoymous pages and at last, we could encounter OOM kill.  :(

Although we have real storage as swap, it was a problem, too.  Because it
sometime ends up making system very unresponsible caused by slow swap
storage performance.

Quote from Luigi on Google
"
Since Chrome OS was mentioned: the main reason why we don't use swap
to a disk (rotating or SSD) is because it doesn't degrade gracefully
and leads to a bad interactive experience.  Generally we prefer to
manage RAM at a higher level, by transparently killing and restarting
processes.  But we noticed that zram is fast enough to be competitive
with the latter, and it lets us make more efficient use of the
available RAM.
"
and he announced. http://www.spinics.net/lists/linux-mm/msg57717.html

Other uses case is to use zram for block device.  Zram is block device so
anyone can format the block device and mount on it so some guys on the
internet start zram as /var/tmp.
http://forums.gentoo.org/viewtopic-t-838198-start-0.html

Let's promote zram and enhance/maintain it instead of removing.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Pekka Enberg <penberg@kernel.org>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Luigi Semenzato <semenzato@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agozsmalloc: move it under mm
Minchan Kim [Wed, 15 Jan 2014 05:56:07 +0000 (16:56 +1100)]
zsmalloc: move it under mm

This patch moves zsmalloc under mm directory.

Before that, description will explain why we have needed custom allocator.

Zsmalloc is a new slab-based memory allocator for storing compressed
pages.  It is designed for low fragmentation and high allocation success
rate on large object, but <= PAGE_SIZE allocations.

zsmalloc differs from the kernel slab allocator in two primary ways to
achieve these design goals.

zsmalloc never requires high order page allocations to back slabs, or
"size classes" in zsmalloc terms.  Instead it allows multiple single-order
pages to be stitched together into a "zspage" which backs the slab.  This
allows for higher allocation success rate under memory pressure.

Also, zsmalloc allows objects to span page boundaries within the zspage.
This allows for lower fragmentation than could be had with the kernel slab
allocator for objects between PAGE_SIZE/2 and PAGE_SIZE.  With the kernel
slab allocator, if a page compresses to 60% of it original size, the
memory savings gained through compression is lost in fragmentation because
another object of the same size can't be stored in the leftover space.

This ability to span pages results in zsmalloc allocations not being
directly addressable by the user.  The user is given an non-dereferencable
handle in response to an allocation request.  That handle must be mapped,
using zs_map_object(), which returns a pointer to the mapped region that
can be used.  The mapping is necessary since the object data may reside in
two different noncontigious pages.

The zsmalloc fulfills the allocation needs for zram perfectly

[sjenning@linux.vnet.ibm.com: borrow Seth's quote]
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Luigi Semenzato <semenzato@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agomm/migrate.c: fix setting of cpupid on page migration twice against normal page
Wanpeng Li [Wed, 15 Jan 2014 05:56:07 +0000 (16:56 +1100)]
mm/migrate.c: fix setting of cpupid on page migration twice against normal page

7851a45cd3 ("mm: numa: Copy cpupid on page migration") copies over the
cpupid at page migration time.  it is unnecessary to set it again in
alloc_misplaced_dst_page().

Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agosoftirq: use const char * const for softirq_to_name, whitespace neatening
Joe Perches [Wed, 15 Jan 2014 05:56:07 +0000 (16:56 +1100)]
softirq: use const char * const for softirq_to_name, whitespace neatening

Reduce data size a little.
Reduce checkpatch noise.

$ size kernel/softirq.o*
   text    data     bss     dec     hex filename
  11554    6013    4008   21575    5447 kernel/softirq.o.new
  11474    6093    4008   21575    5447 kernel/softirq.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agosoftirq: convert printks to pr_<level>
Joe Perches [Wed, 15 Jan 2014 05:56:07 +0000 (16:56 +1100)]
softirq: convert printks to pr_<level>

Use a more current logging style.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agosoftirq: use ffs() in __do_softirq()
Joe Perches [Wed, 15 Jan 2014 05:56:06 +0000 (16:56 +1100)]
softirq: use ffs() in __do_softirq()

Possible speed improvement of __do_softirq() by using ffs() instead of
using a while loop with an & 1 test then single bit shift.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agokernel/kexec.c: use vscnprintf() instead of vsnprintf() in vmcoreinfo_append_str()
Chen Gang [Wed, 15 Jan 2014 05:56:06 +0000 (16:56 +1100)]
kernel/kexec.c: use vscnprintf() instead of vsnprintf() in vmcoreinfo_append_str()

vsnprintf() may let 'r' larger than sizeof(buf), in this case, if 'r' is
also less than "vmcoreinfo_max_size - vmcoreinfo_size" (left size of
destination buffer), next memcpy() will read the unexpected addresses.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoMerge branch 'akpm-current/current'
Stephen Rothwell [Thu, 16 Jan 2014 05:43:09 +0000 (16:43 +1100)]
Merge branch 'akpm-current/current'

10 years agoMerge remote-tracking branch 'lzo-update/lzo-update'
Stephen Rothwell [Thu, 16 Jan 2014 05:29:27 +0000 (16:29 +1100)]
Merge remote-tracking branch 'lzo-update/lzo-update'

10 years agoMerge remote-tracking branch 'random/dev'
Stephen Rothwell [Thu, 16 Jan 2014 05:28:12 +0000 (16:28 +1100)]
Merge remote-tracking branch 'random/dev'

10 years agoMerge remote-tracking branch 'clk/clk-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:26:44 +0000 (16:26 +1100)]
Merge remote-tracking branch 'clk/clk-next'

Conflicts:
MAINTAINERS
drivers/clk/samsung/clk-exynos4.c

10 years agoMerge remote-tracking branch 'ktest/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:25:42 +0000 (16:25 +1100)]
Merge remote-tracking branch 'ktest/for-next'

10 years agoMerge remote-tracking branch 'userns/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:24:27 +0000 (16:24 +1100)]
Merge remote-tracking branch 'userns/for-next'

10 years agoMerge remote-tracking branch 'pwm/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:23:17 +0000 (16:23 +1100)]
Merge remote-tracking branch 'pwm/for-next'

10 years agoMerge remote-tracking branch 'gpio/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:21:35 +0000 (16:21 +1100)]
Merge remote-tracking branch 'gpio/for-next'

Conflicts:
arch/xtensa/Kconfig
drivers/leds/leds-s3c24xx.c

10 years agoMerge remote-tracking branch 'pinctrl/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:20:21 +0000 (16:20 +1100)]
Merge remote-tracking branch 'pinctrl/for-next'

10 years agoMerge remote-tracking branch 'writeback/writeback-for-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:19:05 +0000 (16:19 +1100)]
Merge remote-tracking branch 'writeback/writeback-for-next'

10 years agoMerge remote-tracking branch 'target-updates/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:17:11 +0000 (16:17 +1100)]
Merge remote-tracking branch 'target-updates/for-next'

Conflicts:
drivers/target/target_core_tpg.c

10 years agoMerge remote-tracking branch 'scsi/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:15:18 +0000 (16:15 +1100)]
Merge remote-tracking branch 'scsi/for-next'

10 years agoMerge remote-tracking branch 'char-misc/char-misc-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:14:02 +0000 (16:14 +1100)]
Merge remote-tracking branch 'char-misc/char-misc-next'

10 years agoMerge remote-tracking branch 'staging/staging-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:12:04 +0000 (16:12 +1100)]
Merge remote-tracking branch 'staging/staging-next'

Conflicts:
drivers/staging/imx-drm/imx-drm-core.c

10 years agoMerge remote-tracking branch 'usb/usb-next'
Stephen Rothwell [Thu, 16 Jan 2014 05:04:38 +0000 (16:04 +1100)]
Merge remote-tracking branch 'usb/usb-next'

10 years agoMerge remote-tracking branch 'tty/tty-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:54:08 +0000 (15:54 +1100)]
Merge remote-tracking branch 'tty/tty-next'

10 years agoMerge remote-tracking branch 'driver-core/driver-core-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:43:47 +0000 (15:43 +1100)]
Merge remote-tracking branch 'driver-core/driver-core-next'

10 years agoMerge remote-tracking branch 'leds/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:42:43 +0000 (15:42 +1100)]
Merge remote-tracking branch 'leds/for-next'

10 years agoMerge remote-tracking branch 'regmap/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:41:23 +0000 (15:41 +1100)]
Merge remote-tracking branch 'regmap/for-next'

10 years agoMerge remote-tracking branch 'chrome-platform/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:40:32 +0000 (15:40 +1100)]
Merge remote-tracking branch 'chrome-platform/for-next'

10 years agoMerge remote-tracking branch 'workqueues/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:39:15 +0000 (15:39 +1100)]
Merge remote-tracking branch 'workqueues/for-next'

Conflicts:
kernel/workqueue.c

10 years agoMerge remote-tracking branch 'percpu/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:38:01 +0000 (15:38 +1100)]
Merge remote-tracking branch 'percpu/for-next'

10 years agoMerge remote-tracking branch 'xen-tip/linux-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:29:12 +0000 (15:29 +1100)]
Merge remote-tracking branch 'xen-tip/linux-next'

Conflicts:
arch/arm/include/asm/xen/page.h

10 years agoMerge remote-tracking branch 'kvm-ppc/kvm-ppc-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:28:13 +0000 (15:28 +1100)]
Merge remote-tracking branch 'kvm-ppc/kvm-ppc-next'

10 years agoMerge remote-tracking branch 'kvm-arm/kvm-arm-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:27:24 +0000 (15:27 +1100)]
Merge remote-tracking branch 'kvm-arm/kvm-arm-next'

10 years agonext-20140109/kvm
Stephen Rothwell [Thu, 16 Jan 2014 04:20:22 +0000 (15:20 +1100)]
next-20140109/kvm

10 years agoMerge remote-tracking branch 'rcu/rcu/next'
Stephen Rothwell [Thu, 16 Jan 2014 04:02:19 +0000 (15:02 +1100)]
Merge remote-tracking branch 'rcu/rcu/next'

10 years agoMerge remote-tracking branch 'ftrace/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 04:00:34 +0000 (15:00 +1100)]
Merge remote-tracking branch 'ftrace/for-next'

10 years agoMerge remote-tracking branch 'edac-amd/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 03:59:34 +0000 (14:59 +1100)]
Merge remote-tracking branch 'edac-amd/for-next'

10 years agoMerge remote-tracking branch 'clockevents/clockevents/next'
Stephen Rothwell [Thu, 16 Jan 2014 03:58:40 +0000 (14:58 +1100)]
Merge remote-tracking branch 'clockevents/clockevents/next'

10 years agoRevert "x86 idle: restore mwait_idle()"
Stephen Rothwell [Thu, 16 Jan 2014 03:56:05 +0000 (14:56 +1100)]
Revert "x86 idle: restore mwait_idle()"

This reverts commit 7760518cce95c00ba1cbcbc81c8c1af7fd3425f4.

10 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Thu, 16 Jan 2014 03:19:02 +0000 (14:19 +1100)]
Merge remote-tracking branch 'tip/auto-latest'

Conflicts:
arch/mips/Kconfig
arch/mips/netlogic/xlp/setup.c
arch/xtensa/include/asm/barrier.h
drivers/acpi/acpi_extlog.c
drivers/acpi/apei/einj.c
drivers/acpi/processor_idle.c

10 years agoMerge remote-tracking branch 'spi/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 03:17:00 +0000 (14:17 +1100)]
Merge remote-tracking branch 'spi/for-next'

Conflicts:
drivers/spi/spi-mpc512x-psc.c

10 years agoMerge remote-tracking branch 'dt-rh/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 03:16:00 +0000 (14:16 +1100)]
Merge remote-tracking branch 'dt-rh/for-next'

10 years agoMerge remote-tracking branch 'audit/master'
Stephen Rothwell [Thu, 16 Jan 2014 03:14:20 +0000 (14:14 +1100)]
Merge remote-tracking branch 'audit/master'

Conflicts:
include/net/xfrm.h

10 years agoMerge remote-tracking branch 'trivial/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 03:05:59 +0000 (14:05 +1100)]
Merge remote-tracking branch 'trivial/for-next'

Conflicts:
drivers/gpu/drm/qxl/Kconfig

10 years agoMerge remote-tracking branch 'osd/linux-next'
Stephen Rothwell [Thu, 16 Jan 2014 03:05:05 +0000 (14:05 +1100)]
Merge remote-tracking branch 'osd/linux-next'

10 years agoMerge remote-tracking branch 'vfio/next'
Stephen Rothwell [Thu, 16 Jan 2014 02:59:45 +0000 (13:59 +1100)]
Merge remote-tracking branch 'vfio/next'

10 years agoMerge remote-tracking branch 'iommu/next'
Stephen Rothwell [Thu, 16 Jan 2014 02:58:26 +0000 (13:58 +1100)]
Merge remote-tracking branch 'iommu/next'

Conflicts:
drivers/gpu/drm/msm/Kconfig

10 years agoMerge remote-tracking branch 'watchdog/master'
Stephen Rothwell [Thu, 16 Jan 2014 02:57:21 +0000 (13:57 +1100)]
Merge remote-tracking branch 'watchdog/master'

10 years agoMerge remote-tracking branch 'security/next'
Stephen Rothwell [Thu, 16 Jan 2014 02:56:12 +0000 (13:56 +1100)]
Merge remote-tracking branch 'security/next'

Conflicts:
drivers/char/tpm/tpm_ppi.c

10 years agoMerge remote-tracking branch 'regulator/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:55:03 +0000 (13:55 +1100)]
Merge remote-tracking branch 'regulator/for-next'

10 years agoMerge remote-tracking branch 'omap_dss2/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:53:48 +0000 (13:53 +1100)]
Merge remote-tracking branch 'omap_dss2/for-next'

10 years agoMerge remote-tracking branch 'battery/master'
Stephen Rothwell [Thu, 16 Jan 2014 02:52:27 +0000 (13:52 +1100)]
Merge remote-tracking branch 'battery/master'

10 years agoMerge remote-tracking branch 'mfd-lj/for-mfd-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:51:11 +0000 (13:51 +1100)]
Merge remote-tracking branch 'mfd-lj/for-mfd-next'

10 years agoMerge remote-tracking branch 'md/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:50:12 +0000 (13:50 +1100)]
Merge remote-tracking branch 'md/for-next'

10 years agoMerge remote-tracking branch 'slab/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:48:54 +0000 (13:48 +1100)]
Merge remote-tracking branch 'slab/for-next'

10 years agoMerge remote-tracking branch 'kgdb/kgdb-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:48:51 +0000 (13:48 +1100)]
Merge remote-tracking branch 'kgdb/kgdb-next'

Conflicts:
kernel/debug/debug_core.h

10 years agoMerge remote-tracking branch 'mmc/mmc-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:47:37 +0000 (13:47 +1100)]
Merge remote-tracking branch 'mmc/mmc-next'

Conflicts:
MAINTAINERS

10 years agoMerge remote-tracking branch 'device-mapper/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:46:14 +0000 (13:46 +1100)]
Merge remote-tracking branch 'device-mapper/for-next'

Conflicts:
drivers/md/dm-thin.c

10 years agoMerge remote-tracking branch 'block/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:37:14 +0000 (13:37 +1100)]
Merge remote-tracking branch 'block/for-next'

Conflicts:
drivers/md/raid1.c
drivers/md/raid10.c
fs/btrfs/extent_io.c
fs/f2fs/data.c
fs/f2fs/segment.c
include/trace/events/f2fs.h

10 years agoMerge remote-tracking branch 'cgroup/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:31:34 +0000 (13:31 +1100)]
Merge remote-tracking branch 'cgroup/for-next'

10 years agoMerge remote-tracking branch 'input/next'
Stephen Rothwell [Thu, 16 Jan 2014 02:30:15 +0000 (13:30 +1100)]
Merge remote-tracking branch 'input/next'

10 years agoMerge remote-tracking branch 'virtio/virtio-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:29:26 +0000 (13:29 +1100)]
Merge remote-tracking branch 'virtio/virtio-next'

10 years agoMerge remote-tracking branch 'modules/modules-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:21:39 +0000 (13:21 +1100)]
Merge remote-tracking branch 'modules/modules-next'

Conflicts:
Documentation/module-signing.txt

10 years agoMerge remote-tracking branch 'sound-asoc/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:16:12 +0000 (13:16 +1100)]
Merge remote-tracking branch 'sound-asoc/for-next'

Conflicts:
sound/soc/fsl/fsl_ssi.c

10 years agoMerge remote-tracking branch 'sound/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:13:52 +0000 (13:13 +1100)]
Merge remote-tracking branch 'sound/for-next'

Conflicts:
sound/soc/fsl/fsl_ssi.c

10 years agoMerge remote-tracking branch 'drm-tegra/drm/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:12:26 +0000 (13:12 +1100)]
Merge remote-tracking branch 'drm-tegra/drm/for-next'

10 years agoMerge remote-tracking branch 'drm-intel/for-linux-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:10:46 +0000 (13:10 +1100)]
Merge remote-tracking branch 'drm-intel/for-linux-next'

Conflicts:
drivers/gpu/drm/i915/intel_pm.c

10 years agoMerge remote-tracking branch 'drm/drm-next'
Stephen Rothwell [Thu, 16 Jan 2014 02:08:56 +0000 (13:08 +1100)]
Merge remote-tracking branch 'drm/drm-next'

Conflicts:
drivers/gpu/drm/drm_stub.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_pm.c
drivers/staging/imx-drm/imx-drm-core.c

10 years agoMerge remote-tracking branch 'crypto/master'
Stephen Rothwell [Thu, 16 Jan 2014 01:57:31 +0000 (12:57 +1100)]
Merge remote-tracking branch 'crypto/master'

10 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Thu, 16 Jan 2014 01:56:36 +0000 (12:56 +1100)]
Merge remote-tracking branch 'l2-mtd/master'

10 years agoMerge remote-tracking branch 'infiniband/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 01:55:28 +0000 (12:55 +1100)]
Merge remote-tracking branch 'infiniband/for-next'

Conflicts:
include/linux/mlx4/device.h

10 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Thu, 16 Jan 2014 01:54:15 +0000 (12:54 +1100)]
Merge remote-tracking branch 'bluetooth/master'

10 years agoMerge remote-tracking branch 'wireless-next/master'
Stephen Rothwell [Thu, 16 Jan 2014 01:52:26 +0000 (12:52 +1100)]
Merge remote-tracking branch 'wireless-next/master'

10 years agoMerge remote-tracking branch 'net-next/master'
Stephen Rothwell [Thu, 16 Jan 2014 01:41:50 +0000 (12:41 +1100)]
Merge remote-tracking branch 'net-next/master'

Conflicts:
arch/mips/bcm47xx/setup.c
arch/um/include/asm/Kbuild

10 years agoMerge remote-tracking branch 'slave-dma/next'
Stephen Rothwell [Thu, 16 Jan 2014 01:07:04 +0000 (12:07 +1100)]
Merge remote-tracking branch 'slave-dma/next'

10 years agoMerge remote-tracking branch 'swiotlb/linux-next'
Stephen Rothwell [Thu, 16 Jan 2014 01:05:58 +0000 (12:05 +1100)]
Merge remote-tracking branch 'swiotlb/linux-next'

10 years agoMerge remote-tracking branch 'dlm/next'
Stephen Rothwell [Thu, 16 Jan 2014 01:05:09 +0000 (12:05 +1100)]
Merge remote-tracking branch 'dlm/next'

10 years agoMerge remote-tracking branch 'ieee1394/for-next'
Stephen Rothwell [Thu, 16 Jan 2014 01:04:21 +0000 (12:04 +1100)]
Merge remote-tracking branch 'ieee1394/for-next'