]> www.infradead.org Git - users/willy/linux.git/log
users/willy/linux.git
6 years agomm: Move kvmalloc declarations to slab.h printf-state
Matthew Wilcox [Sun, 20 Jan 2019 16:03:51 +0000 (11:03 -0500)]
mm: Move kvmalloc declarations to slab.h

Contrary to popular belief, not every file in the kernel includes mm.h
and this helps transition users from kmalloc to kvmalloc.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert ip4_addr_string_sa to printf_state
Matthew Wilcox [Sun, 20 Jan 2019 15:53:38 +0000 (10:53 -0500)]
printf: Convert ip4_addr_string_sa to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert ip6_addr_string_sa to printf_state
Matthew Wilcox [Thu, 20 Dec 2018 21:11:04 +0000 (16:11 -0500)]
printf: Convert ip6_addr_string_sa to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert escaped_string to printf_state
Matthew Wilcox [Thu, 20 Dec 2018 21:10:50 +0000 (16:10 -0500)]
printf: Convert escaped_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert uuid_string to printf_state
Matthew Wilcox [Thu, 20 Dec 2018 14:14:41 +0000 (09:14 -0500)]
printf: Convert uuid_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert mac_address_string to printf_state
Matthew Wilcox [Thu, 20 Dec 2018 04:00:33 +0000 (23:00 -0500)]
printf: Convert mac_address_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert dentry_name to printf_char
Matthew Wilcox [Wed, 19 Dec 2018 21:03:50 +0000 (16:03 -0500)]
printf: Convert dentry_name to printf_char

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Add printf_char
Matthew Wilcox [Wed, 19 Dec 2018 20:59:27 +0000 (15:59 -0500)]
printf: Add printf_char

Convert all open-coded versions.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert device_node_string to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 17:50:30 +0000 (12:50 -0500)]
printf: Convert device_node_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert flags_string to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 17:05:51 +0000 (12:05 -0500)]
printf: Convert flags_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert bitmap_string to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 15:49:29 +0000 (10:49 -0500)]
printf: Convert bitmap_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert bitmap_list_string to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 15:44:30 +0000 (10:44 -0500)]
printf: Convert bitmap_list_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert pointer_string to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 15:38:18 +0000 (10:38 -0500)]
printf: Convert pointer_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert restricted_pointer to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 15:35:24 +0000 (10:35 -0500)]
printf: Convert restricted_pointer to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert ptr_to_id to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 15:33:10 +0000 (10:33 -0500)]
printf: Convert ptr_to_id to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert clock to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 15:30:06 +0000 (10:30 -0500)]
printf: Convert clock to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert special_hex_number to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 15:25:44 +0000 (10:25 -0500)]
printf: Convert special_hex_number to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert address_val to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 15:21:47 +0000 (10:21 -0500)]
printf: Convert address_val to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert netdev_bits to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 14:13:51 +0000 (09:13 -0500)]
printf: Convert netdev_bits to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert hex_string to printf_state
Matthew Wilcox [Wed, 19 Dec 2018 13:59:58 +0000 (08:59 -0500)]
printf: Convert hex_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert resource_string to printf_state
Matthew Wilcox [Sat, 15 Dec 2018 10:58:12 +0000 (05:58 -0500)]
printf: Convert resource_string to printf_state

6 years agoprintf: Convert symbol_string to printf_state
Matthew Wilcox [Wed, 12 Dec 2018 19:11:23 +0000 (14:11 -0500)]
printf: Convert symbol_string to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert dentry_name() to printf_state
Matthew Wilcox [Wed, 12 Dec 2018 19:00:08 +0000 (14:00 -0500)]
printf: Convert dentry_name() to printf_state

Turn %pD into a fallthrough instead of a separate call.
Add printf_widen_string() as widen_string() still has legacy callers.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert bdev_name() to printf_state
Matthew Wilcox [Wed, 12 Dec 2018 18:52:06 +0000 (13:52 -0500)]
printf: Convert bdev_name() to printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoprintf: Convert pointer() to take a printf_state
Matthew Wilcox [Wed, 12 Dec 2018 18:46:09 +0000 (13:46 -0500)]
printf: Convert pointer() to take a printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoIntroduce printf_state
Matthew Wilcox [Wed, 12 Dec 2018 16:56:51 +0000 (11:56 -0500)]
Introduce printf_state

Signed-off-by: Matthew Wilcox <willy@infradead.org>
6 years agoAdd linux-next specific files for 20181210
Stephen Rothwell [Mon, 10 Dec 2018 09:12:07 +0000 (20:12 +1100)]
Add linux-next specific files for 20181210

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agoMerge branch 'akpm/master'
Stephen Rothwell [Mon, 10 Dec 2018 08:31:09 +0000 (19:31 +1100)]
Merge branch 'akpm/master'

6 years agodrivers/media/platform/sti/delta/delta-ipc.c: fix read buffer overflow
Andi Kleen [Wed, 5 Dec 2018 00:14:27 +0000 (11:14 +1100)]
drivers/media/platform/sti/delta/delta-ipc.c: fix read buffer overflow

The single caller passes a string to delta_ipc_open, which copies with a
fixed size larger than the string.  So it copies some random data after
the original string the ro segment.

If the string was at the end of a page it may fault.

Just copy the string with a normal strcpy after clearing the field.

Found by a LTO build (which errors out)
because the compiler inlines the functions and can resolve
the string sizes and triggers the compile time checks in memcpy.

In function `memcpy',
    inlined from `delta_ipc_open.constprop' at linux/drivers/media/platform/sti/delta/delta-ipc.c:178:0,
    inlined from `delta_mjpeg_ipc_open' at linux/drivers/media/platform/sti/delta/delta-mjpeg-dec.c:227:0,
    inlined from `delta_mjpeg_decode' at linux/drivers/media/platform/sti/delta/delta-mjpeg-dec.c:403:0:
/home/andi/lsrc/linux/include/linux/string.h:337:0: error: call to `__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter
    __read_overflow2();

Link: http://lkml.kernel.org/r/20171222001212.1850-1-andi@firstfloor.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Hugues FRUCHET <hugues.fruchet@st.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agofs: don't open code lru_to_page()
Nikolay Borisov [Wed, 5 Dec 2018 00:14:26 +0000 (11:14 +1100)]
fs: don't open code lru_to_page()

Multiple filesystems open code lru_to_page().  Rectify this by moving the
macro from mm_inline (which is specific to lru stuff) to the more generic
mm.h header and start using the macro where appropriate.

No functional changes.

Link: http://lkml.kernel.org/r/20181129104810.23361-1-nborisov@suse.com
Link: https://lkml.kernel.org/r/20181129075301.29087-1-nborisov@suse.com
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Pankaj gupta <pagupta@redhat.com>
Acked-by: "Yan, Zheng" <zyan@redhat.com> [ceph]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agoinclude/linux/sched/signal.h: replace `tsk' with `task'
Andrei Vagin [Wed, 5 Dec 2018 00:14:26 +0000 (11:14 +1100)]
include/linux/sched/signal.h: replace `tsk' with `task'

This file uses "task" 85 times and "tsk" 25 times.  It is better to be
consistent.

Link: http://lkml.kernel.org/r/20181129180547.15976-1-avagin@gmail.com
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agofs-remove-caller-signal_pending-branch-predictions-fix
Andrew Morton [Wed, 5 Dec 2018 00:14:26 +0000 (11:14 +1100)]
fs-remove-caller-signal_pending-branch-predictions-fix

fix fs/buffer.c

Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agofs/: remove caller signal_pending branch predictions
Davidlohr Bueso [Wed, 5 Dec 2018 00:14:26 +0000 (11:14 +1100)]
fs/: remove caller signal_pending branch predictions

This is already done for us internally by the signal machinery.

Link: http://lkml.kernel.org/r/20181116002713.8474-7-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agomm/: remove caller signal_pending branch predictions
Davidlohr Bueso [Wed, 5 Dec 2018 00:14:26 +0000 (11:14 +1100)]
mm/: remove caller signal_pending branch predictions

This is already done for us internally by the signal machinery.

Link: http://lkml.kernel.org/r/20181116002713.8474-5-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agoarch/arc/mm/fault.c: remove caller signal_pending_branch predictions
Davidlohr Bueso [Wed, 5 Dec 2018 00:14:25 +0000 (11:14 +1100)]
arch/arc/mm/fault.c: remove caller signal_pending_branch predictions

This is already done for us internally by the signal machinery.

Link: http://lkml.kernel.org/r/20181116002713.8474-4-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agokernel/sched/: remove caller signal_pending branch predictions
Davidlohr Bueso [Wed, 5 Dec 2018 00:14:25 +0000 (11:14 +1100)]
kernel/sched/: remove caller signal_pending branch predictions

This is already done for us internally by the signal machinery.

Link: http://lkml.kernel.org/r/20181116002713.8474-3-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agokernel/locking/mutex.c: remove caller signal_pending branch predictions
Davidlohr Bueso [Wed, 5 Dec 2018 00:14:25 +0000 (11:14 +1100)]
kernel/locking/mutex.c: remove caller signal_pending branch predictions

This is already done for us internally by the signal machinery.

Link: http://lkml.kernel.org/r/20181116002713.8474-2-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agozram: default to lzo-rle instead of lzo
Dave Rodgman [Wed, 5 Dec 2018 00:14:25 +0000 (11:14 +1100)]
zram: default to lzo-rle instead of lzo

lzo-rle gives higher performance and similar compression ratios to lzo.

Testing with 80 browser tabs showed a 27% reduction in total time spent
(de)compressing data during swapping.

Link: http://lkml.kernel.org/r/20181130142600.13782-9-dave.rodgman@arm.com
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Matt Sealey <matt.sealey@arm.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolib-lzo-separate-lzo-rle-from-lzo-v4
Dave Rodgman [Wed, 5 Dec 2018 00:14:25 +0000 (11:14 +1100)]
lib-lzo-separate-lzo-rle-from-lzo-v4

v4

Link: http://lkml.kernel.org/r/20181130142600.13782-8-dave.rodgman@arm.com
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolib/lzo: separate lzo-rle from lzo
Dave Rodgman [Wed, 5 Dec 2018 00:14:24 +0000 (11:14 +1100)]
lib/lzo: separate lzo-rle from lzo

To prevent any issues with persistent data, separate lzo-rle
from lzo so that it is treated as a separate algorithm, and
lzo is still available.

Use lzo-rle as the default algorithm for
zram.

Link: http://lkml.kernel.org/r/20181127161913.23863-8-dave.rodgman@arm.com
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Matt Sealey <matt.sealey@arm.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolib-lzo-implement-run-length-encoding-v4.txt
Dave Rodgman [Wed, 5 Dec 2018 00:14:24 +0000 (11:14 +1100)]
lib-lzo-implement-run-length-encoding-v4.txt

fix warning

Link: http://lkml.kernel.org/r/20181130142600.13782-7-dave.rodgman@arm.com
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolib/lzo: implement run-length encoding
Dave Rodgman [Wed, 5 Dec 2018 00:14:24 +0000 (11:14 +1100)]
lib/lzo: implement run-length encoding

When using zram, we frequently encounter long runs of zero bytes.
This adds a special case which identifies runs of zeros and encodes
them using run-length encoding.

This is faster for both compression and decompresion. For
high-entropy data which doesn't hit this case, impact is minimal.

Compression ratio is within a few percent in all cases.

This modifies the bitstream in a way which is backwards compatible
(i.e., we can decompress old bitstreams, but old versions of lzo
cannot decompress new bitstreams).

Link: http://lkml.kernel.org/r/20181127161913.23863-7-dave.rodgman@arm.com
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Matt Sealey <matt.sealey@arm.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolib/lzo: fast 8-byte copy on arm64
Matt Sealey [Wed, 5 Dec 2018 00:14:24 +0000 (11:14 +1100)]
lib/lzo: fast 8-byte copy on arm64

Enable faster 8-byte copies on arm64.

Link: http://lkml.kernel.org/r/20181127161913.23863-6-dave.rodgman@arm.com
Signed-off-by: Matt Sealey <matt.sealey@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolib/lzo: 64-bit CTZ on arm64
Matt Sealey [Wed, 5 Dec 2018 00:14:24 +0000 (11:14 +1100)]
lib/lzo: 64-bit CTZ on arm64

LZO leaves some performance on the table by not realising that arm64 can
optimize count-trailing-zeros bit operations.

Add CONFIG_ARM64 to the checked definitions alongside CONFIG_X86_64 to
enable the use of rbit/clz instructions on full 64-bit quantities.

Link: http://lkml.kernel.org/r/20181127161913.23863-5-dave.rodgman@arm.com
Signed-off-by: Matt Sealey <matt.sealey@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolib/lzo: enable 64-bit CTZ on Arm
Matt Sealey [Wed, 5 Dec 2018 00:14:23 +0000 (11:14 +1100)]
lib/lzo: enable 64-bit CTZ on Arm

ARMv6 Thumb state introduced an RBIT instruction which, combined with CLZ
as present in ARMv5, introduces an extremely fast path for counting
trailing zeroes.

Enable the use of the GCC builtin for this on ARMv6+ with
CONFIG_THUMB2_KERNEL to ensure we get the 'new' instruction usage.

We do not bother enabling LZO_USE_CTZ64 support for ARMv5 as the builtin
code path does the same thing as the LZO_USE_CTZ32 code, only with more
register pressure.

Link: http://lkml.kernel.org/r/20181127161913.23863-4-dave.rodgman@arm.com
Signed-off-by: Matt Sealey <matt.sealey@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolib/lzo: clean-up by introducing COPY16
Matt Sealey [Wed, 5 Dec 2018 00:14:23 +0000 (11:14 +1100)]
lib/lzo: clean-up by introducing COPY16

Most compilers should be able to merge adjacent loads/stores of sizes
which are less than but effect a multiple of a machine word size (in
effect a memcpy() of a constant amount). However the semantics of the
macro are that it just does the copy, the pointer increment is in the
code, hence we see

    *a = *b
    a += 8
    b += 8
    *a = *b
    a += 8
    b += 8

This introduces a dependency between the two groups of statements which
seems to defeat said compiler optimizers and generate some very strange
sequences of addition and subtraction of address offsets (i.e. it is
overcomplicated).

Since COPY8 is only ever used to copy amounts of 16 bytes (in pairs),
just define COPY16 as COPY8,COPY8. We leave the definition to preserve
the need to do unaligned accesses to machine-sized words per the
original code intent, we just don't use it in the code proper.

COPY16 then gives us code like:

    *a = *b
    *(a+8) = *(b+8)
    a += 16
    b += 16

This seems to allow compilers to generate much better code by using
base register writeback or simply positively incrementing offsets which
seems to positively affect performance. It is, at least, fewer
instructions to do the same job.

Link: http://lkml.kernel.org/r/20181127161913.23863-3-dave.rodgman@arm.com
Signed-off-by: Matt Sealey <matt.sealey@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolib/lzo: tidy-up ifdefs
Dave Rodgman [Wed, 5 Dec 2018 00:14:23 +0000 (11:14 +1100)]
lib/lzo: tidy-up ifdefs

Patch series "lib/lzo: performance improvements", v4.

This series introduces performance improvements for lzo.

The previous version of this patchset is here:
https://lkml.org/lkml/2018/11/21/625

This version tidies up the ifdefs as per Christoph's comment (although
certainly more could be done, this is at least a bit more consistent
with normal kernel coding style).

On 23/11/2018 2:12 am, Sergey Senozhatsky wrote:

>> The graph below shows the weighted round-trip throughput of lzo, lz4 and
>> lzo-rle, for randomly generated 4k chunks of data with varying levels of
>> entropy. (To calculate weighted round-trip throughput, compression performance
>> is emphasised to reflect the fact that zram does around 2.25x more compression
>> than decompression.
>
> Right. The number is data dependent. Not all swapped out pages can be
> compressed; compressed pages that end up being >= zs_huge_class_size() are
> considered incompressible and stored as it.
>
> I'd say that on my setups around 50-60% of pages are incompressible.

So, just to give a bit more detail: the test setup was a Samsung
Chromebook Pro, cycling through 80 tabs in Chrome. With lzo-rle, only
5% of pages increased in size, and 90% of pages compress to 75% of
original size (or better). Mean compression ratio was 41%. Importantly
for lzo-rle, there are a lot of low-entropy pages where it can do well:
in total about 20% of the data is zeros forming part of a run of 4 or
more bytes.

As a quick summary of the impact of these patches on bigger chunks of
data, I've compared the performance of four different variants of lzo
on two large (~40 MB) files. The numbers show round-trip throughput
in MB/s:

Variant         | Low-entropy | High-entropy
Current lzo     |  242        | 157
Arm opts        |  290        | 159
RLE             |  876        | 151
Arm opts + RLE  | 1150        | 181

So both the Arm optimisations (8,16-byte copy & CTZ patches), and the
RLE implementation make a significant contribution to the overall
performance uplift.

This patch (of 8):

Modify the ifdefs in lzodefs.h to be more consistent with normal kernel
macros (e.g., change __aarch64__ to CONFIG_ARM64).

Link: http://lkml.kernel.org/r/20181127161913.23863-2-dave.rodgman@arm.com
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David S. Miller <davem@davemloft.net>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Matt Sealey <matt.sealey@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agopm-hibernate-exclude-all-pageoffline-pages-v2
David Hildenbrand [Wed, 5 Dec 2018 00:14:23 +0000 (11:14 +1100)]
pm-hibernate-exclude-all-pageoffline-pages-v2

In saveable_highmem_page(), move the PageReserved() check to a new
check along with the PageOffline() check to separate it from the
swsusp checks.

Link: http://lkml.kernel.org/r/20181122100627.5189-9-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <len.brown@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pankaj gupta <pagupta@redhat.com>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agoPM/Hibernate: exclude all PageOffline() pages
David Hildenbrand [Wed, 5 Dec 2018 00:14:22 +0000 (11:14 +1100)]
PM/Hibernate: exclude all PageOffline() pages

The content of pages that are marked PG_offline is not of interest (e.g.
inflated by a balloon driver), let's skip these pages.

In saveable_highmem_page(), move the PageReserved() check to a new check
along with the PageOffline() check to separate it from the swsusp checks.

Link: http://lkml.kernel.org/r/20181119101616.8901-9-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <len.brown@intel.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pankaj gupta <pagupta@redhat.com>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agoPM/Hibernate: use pfn_to_online_page()
David Hildenbrand [Wed, 5 Dec 2018 00:14:22 +0000 (11:14 +1100)]
PM/Hibernate: use pfn_to_online_page()

Let's use pfn_to_online_page() instead of pfn_to_page() when checking for
saveable pages to not save/restore offline memory sections.

Link: http://lkml.kernel.org/r/20181119101616.8901-8-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Suggested-by: Michal Hocko <mhocko@kernel.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pankaj gupta <pagupta@redhat.com>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agovmw_balloon-mark-inflated-pages-pg_offline-v2
David Hildenbrand [Wed, 5 Dec 2018 00:14:22 +0000 (11:14 +1100)]
vmw_balloon-mark-inflated-pages-pg_offline-v2

use vmballoon_page_in_frames more widely

Link: http://lkml.kernel.org/r/20181122100627.5189-7-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Nadav Amit <namit@vmware.com>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pankaj gupta <pagupta@redhat.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agovmw_balloon: mark inflated pages PG_offline
David Hildenbrand [Wed, 5 Dec 2018 00:14:22 +0000 (11:14 +1100)]
vmw_balloon: mark inflated pages PG_offline

Mark inflated and never onlined pages PG_offline, to tell the world that
the content is stale and should not be dumped.

Link: http://lkml.kernel.org/r/20181119101616.8901-7-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Nadav Amit <namit@vmware.com>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pankaj gupta <pagupta@redhat.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agohv_balloon: mark inflated pages PG_offline
David Hildenbrand [Wed, 5 Dec 2018 00:14:22 +0000 (11:14 +1100)]
hv_balloon: mark inflated pages PG_offline

Mark inflated and never onlined pages PG_offline, to tell the world that
the content is stale and should not be dumped.

Link: http://lkml.kernel.org/r/20181119101616.8901-6-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Pankaj gupta <pagupta@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agoxen/balloon: mark inflated pages PG_offline
David Hildenbrand [Wed, 5 Dec 2018 00:14:21 +0000 (11:14 +1100)]
xen/balloon: mark inflated pages PG_offline

Mark inflated and never onlined pages PG_offline, to tell the world that
the content is stale and should not be dumped.

Link: http://lkml.kernel.org/r/20181119101616.8901-5-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pankaj gupta <pagupta@redhat.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agokexec: export PG_offline to VMCOREINFO
David Hildenbrand [Wed, 5 Dec 2018 00:14:21 +0000 (11:14 +1100)]
kexec: export PG_offline to VMCOREINFO

Right now, pages inflated as part of a balloon driver will be dumped by
dump tools like makedumpfile.  While XEN is able to check in the crash
kernel whether a certain pfn is actuall backed by memory in the hypervisor
(see xen_oldmem_pfn_is_ram) and optimize this case, dumps of other balloon
inflated memory will essentially result in zero pages getting allocated by
the hypervisor and the dump getting filled with this data.

The allocation and reading of zero pages can directly be avoided if a
dumping tool could know which pages only contain stale information not to
be dumped.

We now have PG_offline which can be (and already is by virtio-balloon)
used for marking pages as logically offline.  Follow up patches will make
use of this flag also in other balloon implementations.

Let's export PG_offline via PAGE_OFFLINE_MAPCOUNT_VALUE, so makedumpfile
can directly skip pages that are logically offline and the content
therefore stale.

Please note that this is also helpful for a problem we were seeing under
Hyper-V: Dumping logically offline memory (pages kept fake offline while
onlining a section via online_page_callback) would under some condicions
result in a kernel panic when dumping them.

Link: http://lkml.kernel.org/r/20181119101616.8901-4-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Pankaj gupta <pagupta@redhat.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agomm-convert-pg_balloon-to-pg_offline-fix-fix
Andrew Morton [Wed, 5 Dec 2018 00:14:21 +0000 (11:14 +1100)]
mm-convert-pg_balloon-to-pg_offline-fix-fix

fix PAGE_TYPE_ALL

Cc: Anthony Yznaga <anthony.yznaga@oracle.com>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agomm-convert-pg_balloon-to-pg_offline-fix
Andrew Morton [Wed, 5 Dec 2018 00:14:21 +0000 (11:14 +1100)]
mm-convert-pg_balloon-to-pg_offline-fix

fix comment text, per David

Cc: David Hildenbrand <david@redhat.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pankaj gupta <pagupta@redhat.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agomm: convert PG_balloon to PG_offline
David Hildenbrand [Wed, 5 Dec 2018 00:14:21 +0000 (11:14 +1100)]
mm: convert PG_balloon to PG_offline

PG_balloon was introduced to implement page migration/compaction for pages
inflated in virtio-balloon.  Nowadays, it is only a marker that a page is
part of virtio-balloon and therefore logically offline.

We also want to make use of this flag in other balloon drivers - for
inflated pages or when onlining a section but keeping some pages offline
(e.g.  used right now by XEN and Hyper-V via set_online_page_callback()).

We are going to expose this flag to dump tools like makedumpfile.  But
instead of exposing PG_balloon, let's generalize the concept of marking
pages as logically offline, so it can be reused for other purposes later
on.

Rename PG_balloon to PG_offline.  This is an indicator that the page is
logically offline, the content stale and that it should not be touched
(e.g.  a hypervisor would have to allocate backing storage in order for
the guest to dump an unused page).  We can then e.g.  exclude such pages
from dumps.

We replace and reuse KPF_BALLOON (23), as this shouldn't really harm (and
for now the semantics stay the same).  In following patches, we will make
use of this bit also in other balloon drivers.  While at it, document
PGTABLE.

Link: http://lkml.kernel.org/r/20181119101616.8901-3-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Konstantin Khlebnikov <koct9i@gmail.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Pankaj gupta <pagupta@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Nadav Amit <namit@vmware.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agomm: balloon: update comment about isolation/migration/compaction
David Hildenbrand [Wed, 5 Dec 2018 00:14:20 +0000 (11:14 +1100)]
mm: balloon: update comment about isolation/migration/compaction

Patch series "mm/kdump: allow to exclude pages that are logically offline"

Right now, pages inflated as part of a balloon driver will be dumped by
dump tools like makedumpfile.  While XEN is able to check in the crash
kernel whether a certain pfn is actuall backed by memory in the hypervisor
(see xen_oldmem_pfn_is_ram) and optimize this case, dumps of
virtio-balloon, hv-balloon and VMWare balloon inflated memory will
essentially result in zero pages getting allocated by the hypervisor and
the dump getting filled with this data.

The allocation and reading of zero pages can directly be avoided if a
dumping tool could know which pages only contain stale information not to
be dumped.

Also for XEN, calling into the kernel and asking the hypervisor if a pfn
is backed can be avoided if the duming tool would skip such pages right
from the beginning.

Dumping tools have no idea whether a given page is part of a balloon
driver and shall not be dumped.  Esp.  PG_reserved cannot be used for that
purpose as all memory allocated during early boot is also PG_reserved, see
discussion at [1].  So some other way of indication is required and a new
page flag is frowned upon.

We have PG_balloon (MAPCOUNT value), which is essentially unused now.  I
suggest renaming it to something more generic (PG_offline) to mark pages
as logically offline.  This flag can than e.g.  also be used by virtio-mem
in the future to mark subsections as offline.  Or by other code that wants
to put pages logically offline (e.g.  later maybe poisoned pages that
shall no longer be used).

This series converts PG_balloon to PG_offline, allows dumping tools to
query the value to detect such pages and marks pages in the hv-balloon and
XEN balloon properly as PG_offline.  Note that virtio-balloon already set
pages to PG_balloon (and now PG_offline).

Please note that this is also helpful for a problem we were seeing under
Hyper-V: Dumping logically offline memory (pages kept fake offline while
onlining a section via online_page_callback) would under some condicions
result in a kernel panic when dumping them.

As I don't have access to neither XEN nor Hyper-V nor VMWare
installations, this was only tested with the virtio-balloon and pages were
properly skipped when dumping.  I'll also attach the makedumpfile patch to
this series.

[1] https://lkml.org/lkml/2018/7/20/566

This patch (of 8):

b1123ea6d3b3 ("mm: balloon: use general non-lru movable page feature")
reworked balloon handling to make use of the general non-lru movable page
feature.  The big comment block in balloon_compaction.h contains quite
some outdated information.  Let's fix this.

Link: http://lkml.kernel.org/r/20181119101616.8901-2-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Christian Hansen <chansen3@cisco.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: Julien Freche <jfreche@vmware.com>
Cc: Kairui Song <kasong@redhat.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Lianbo Jiang <lijiang@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Miles Chen <miles.chen@mediatek.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Pankaj gupta <pagupta@redhat.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agomm/sparse: add common helper to mark all memblocks present
Logan Gunthorpe [Wed, 5 Dec 2018 00:14:20 +0000 (11:14 +1100)]
mm/sparse: add common helper to mark all memblocks present

Presently the arches arm64, arm and sh have a function which loops through
each memblock and calls memory present. riscv will require a similar
function.

Introduce a common memblocks_present() function that can be used by
all the arches. Subsequent patches will cleanup the arches that
make use of this.

Link: http://lkml.kernel.org/r/20181107205433.3875-3-logang@deltatee.com
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agomm: Introduce common STRUCT_PAGE_MAX_SHIFT define
Logan Gunthorpe [Wed, 5 Dec 2018 00:14:20 +0000 (11:14 +1100)]
mm: Introduce common STRUCT_PAGE_MAX_SHIFT define

This define is used by arm64 to calculate the size of the vmemmap
region. It is defined as the log2 of the upper bound on the size
of a struct page.

We move it into mm_types.h so it can be defined properly instead of
set and checked with a build bug. This also allows us to use the same
define for riscv.

Link: http://lkml.kernel.org/r/20181107205433.3875-2-logang@deltatee.com
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agolocking/atomics: build atomic headers as required
Mark Rutland [Wed, 5 Dec 2018 00:14:20 +0000 (11:14 +1100)]
locking/atomics: build atomic headers as required

Andrew and Ingo report that the check-atomics.sh script is simply too slow
to run for every kernel build, and it's impractical to make it faster
without rewriting it in something other than shell.

Rather than committing the generated headers, let's regenerate these
as-required for a pristine tree.

That ensures they're always up-to-date, allows them to be built in
parallel, and avoid redundant rebuilds, which is a 2-8s saving per
incremental build.  Since the results are not committed, it's very obvious
that they should not be modified directly.  If we need to generate more
headers in future, it's easy to extend Makefile.genheader to permit this.

I've verified that this works in the cases we previously had issues with
(out-of-tree builds and where scripts have no execute permissions), and
have tested these cases for both x86_64 and arm64.

The diffstat looks nice, at least...

Link: http://lkml.kernel.org/r/20181123153321.8561-1-mark.rutland@arm.com
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agokernel/signal.c: remove some duplicated includes
Yangtao Li [Wed, 5 Dec 2018 00:14:19 +0000 (11:14 +1100)]
kernel/signal.c: remove some duplicated includes

tty.h and fs.h are included twice.  It's unnecessary.  so remove them.

Link: http://lkml.kernel.org/r/20181126150900.32235-1-tiny.windzz@gmail.com
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agokernel/signal.c: remove some duplicated includes
Yangtao Li [Wed, 5 Dec 2018 00:14:19 +0000 (11:14 +1100)]
kernel/signal.c: remove some duplicated includes

We include workqueue.h twice.  It's unnecessary, so just remove them.

Link: http://lkml.kernel.org/r/20181126143710.31409-1-tiny.windzz@gmail.com
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agoscripts/atomic/check-atomics.sh: don't assume that scripts are executable
Andrew Morton [Wed, 5 Dec 2018 00:14:19 +0000 (11:14 +1100)]
scripts/atomic/check-atomics.sh: don't assume that scripts are executable

patch(1) doesn't set the x bit on files.  So if someone downloads and
applies patch-4.21.xz, their kernel won't build.  Fix that by executing
/bin/sh.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
6 years agoMerge branch 'akpm-current/current'
Stephen Rothwell [Mon, 10 Dec 2018 08:16:52 +0000 (19:16 +1100)]
Merge branch 'akpm-current/current'

6 years agoMerge remote-tracking branch 'xarray/xarray'
Stephen Rothwell [Mon, 10 Dec 2018 07:28:52 +0000 (18:28 +1100)]
Merge remote-tracking branch 'xarray/xarray'

6 years agoMerge remote-tracking branch 'nvmem/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 07:28:46 +0000 (18:28 +1100)]
Merge remote-tracking branch 'nvmem/for-next'

6 years agoMerge remote-tracking branch 'slimbus/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 07:27:15 +0000 (18:27 +1100)]
Merge remote-tracking branch 'slimbus/for-next'

6 years agoMerge remote-tracking branch 'cisco/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 07:24:54 +0000 (18:24 +1100)]
Merge remote-tracking branch 'cisco/for-next'

6 years agoMerge remote-tracking branch 'rtc/rtc-next'
Stephen Rothwell [Mon, 10 Dec 2018 07:22:21 +0000 (18:22 +1100)]
Merge remote-tracking branch 'rtc/rtc-next'

6 years agoMerge remote-tracking branch 'coresight/next'
Stephen Rothwell [Mon, 10 Dec 2018 07:20:47 +0000 (18:20 +1100)]
Merge remote-tracking branch 'coresight/next'

6 years agoMerge remote-tracking branch 'livepatching/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 07:20:43 +0000 (18:20 +1100)]
Merge remote-tracking branch 'livepatching/for-next'

6 years agoMerge remote-tracking branch 'y2038/y2038'
Stephen Rothwell [Mon, 10 Dec 2018 07:09:08 +0000 (18:09 +1100)]
Merge remote-tracking branch 'y2038/y2038'

6 years agoMerge remote-tracking branch 'kselftest/next'
Stephen Rothwell [Mon, 10 Dec 2018 07:07:35 +0000 (18:07 +1100)]
Merge remote-tracking branch 'kselftest/next'

6 years agoMerge remote-tracking branch 'random/dev'
Stephen Rothwell [Mon, 10 Dec 2018 07:05:23 +0000 (18:05 +1100)]
Merge remote-tracking branch 'random/dev'

6 years agoMerge remote-tracking branch 'pwm/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 07:03:46 +0000 (18:03 +1100)]
Merge remote-tracking branch 'pwm/for-next'

6 years agoMerge remote-tracking branch 'pinctrl/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 07:01:31 +0000 (18:01 +1100)]
Merge remote-tracking branch 'pinctrl/for-next'

6 years agonext-20181207/gpio
Stephen Rothwell [Mon, 10 Dec 2018 06:58:56 +0000 (17:58 +1100)]
next-20181207/gpio

6 years agoMerge remote-tracking branch 'rpmsg/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 06:20:08 +0000 (17:20 +1100)]
Merge remote-tracking branch 'rpmsg/for-next'

6 years agoMerge remote-tracking branch 'vhost/linux-next'
Stephen Rothwell [Mon, 10 Dec 2018 06:18:35 +0000 (17:18 +1100)]
Merge remote-tracking branch 'vhost/linux-next'

6 years agoMerge remote-tracking branch 'scsi-mkp/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 06:16:50 +0000 (17:16 +1100)]
Merge remote-tracking branch 'scsi-mkp/for-next'

6 years agoMerge remote-tracking branch 'scsi/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 06:05:55 +0000 (17:05 +1100)]
Merge remote-tracking branch 'scsi/for-next'

6 years agoMerge remote-tracking branch 'cgroup/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:58:58 +0000 (16:58 +1100)]
Merge remote-tracking branch 'cgroup/for-next'

6 years agoMerge remote-tracking branch 'slave-dma/next'
Stephen Rothwell [Mon, 10 Dec 2018 05:56:45 +0000 (16:56 +1100)]
Merge remote-tracking branch 'slave-dma/next'

6 years agoMerge remote-tracking branch 'icc/icc-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:55:11 +0000 (16:55 +1100)]
Merge remote-tracking branch 'icc/icc-next'

6 years agoMerge remote-tracking branch 'mux/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:55:06 +0000 (16:55 +1100)]
Merge remote-tracking branch 'mux/for-next'

6 years agoMerge remote-tracking branch 'staging/staging-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:52:43 +0000 (16:52 +1100)]
Merge remote-tracking branch 'staging/staging-next'

6 years agoMerge remote-tracking branch 'thunderbolt/next'
Stephen Rothwell [Mon, 10 Dec 2018 05:43:27 +0000 (16:43 +1100)]
Merge remote-tracking branch 'thunderbolt/next'

6 years agoMerge remote-tracking branch 'extcon/extcon-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:41:52 +0000 (16:41 +1100)]
Merge remote-tracking branch 'extcon/extcon-next'

6 years agoMerge remote-tracking branch 'char-misc/char-misc-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:39:21 +0000 (16:39 +1100)]
Merge remote-tracking branch 'char-misc/char-misc-next'

6 years agoMerge remote-tracking branch 'tty/tty-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:33:21 +0000 (16:33 +1100)]
Merge remote-tracking branch 'tty/tty-next'

6 years agoMerge remote-tracking branch 'phy-next/next'
Stephen Rothwell [Mon, 10 Dec 2018 05:31:05 +0000 (16:31 +1100)]
Merge remote-tracking branch 'phy-next/next'

6 years agoMerge remote-tracking branch 'usb-serial/usb-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:29:30 +0000 (16:29 +1100)]
Merge remote-tracking branch 'usb-serial/usb-next'

6 years agoMerge remote-tracking branch 'usb-gadget/next'
Stephen Rothwell [Mon, 10 Dec 2018 05:27:54 +0000 (16:27 +1100)]
Merge remote-tracking branch 'usb-gadget/next'

6 years agoMerge remote-tracking branch 'usb/usb-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:25:39 +0000 (16:25 +1100)]
Merge remote-tracking branch 'usb/usb-next'

6 years agoMerge remote-tracking branch 'driver-core/driver-core-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:14:07 +0000 (16:14 +1100)]
Merge remote-tracking branch 'driver-core/driver-core-next'

6 years agoMerge remote-tracking branch 'ipmi/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:07:06 +0000 (16:07 +1100)]
Merge remote-tracking branch 'ipmi/for-next'

6 years agoMerge remote-tracking branch 'leds/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:05:33 +0000 (16:05 +1100)]
Merge remote-tracking branch 'leds/for-next'

6 years agoMerge remote-tracking branch 'hsi/for-next'
Stephen Rothwell [Mon, 10 Dec 2018 05:04:01 +0000 (16:04 +1100)]
Merge remote-tracking branch 'hsi/for-next'