Skip to content

Commit 63773d2

Browse files
committed
Merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes.
2 parents cf01724 + 814bc1d commit 63773d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+599
-364
lines changed

.mailmap

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Baolin Wang <baolin.wang@linux.alibaba.com> <baolin.wang@unisoc.com>
7070
Baolin Wang <baolin.wang@linux.alibaba.com> <baolin.wang7@gmail.com>
7171
Bart Van Assche <bvanassche@acm.org> <bart.vanassche@sandisk.com>
7272
Bart Van Assche <bvanassche@acm.org> <bart.vanassche@wdc.com>
73+
Ben Dooks <ben-linux@fluff.org> <ben.dooks@simtec.co.uk>
74+
Ben Dooks <ben-linux@fluff.org> <ben.dooks@sifive.com>
7375
Ben Gardner <bgardner@wabtec.com>
7476
Ben M Cahill <ben.m.cahill@intel.com>
7577
Ben Widawsky <bwidawsk@kernel.org> <ben@bwidawsk.net>
@@ -233,6 +235,7 @@ Jisheng Zhang <jszhang@kernel.org> <Jisheng.Zhang@synaptics.com>
233235
Johan Hovold <johan@kernel.org> <jhovold@gmail.com>
234236
Johan Hovold <johan@kernel.org> <johan@hovoldconsulting.com>
235237
John Crispin <john@phrozen.org> <blogic@openwrt.org>
238+
John Keeping <john@keeping.me.uk> <john@metanate.com>
236239
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
237240
John Stultz <johnstul@us.ibm.com>
238241
<jon.toppins+linux@gmail.com> <jtoppins@cumulusnetworks.com>

Documentation/trace/histogram.rst

+32-32
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Documentation written by Tom Zanussi
3535
in place of an explicit value field - this is simply a count of
3636
event hits. If 'values' isn't specified, an implicit 'hitcount'
3737
value will be automatically created and used as the only value.
38-
Keys can be any field, or the special string 'stacktrace', which
38+
Keys can be any field, or the special string 'common_stacktrace', which
3939
will use the event's kernel stacktrace as the key. The keywords
4040
'keys' or 'key' can be used to specify keys, and the keywords
4141
'values', 'vals', or 'val' can be used to specify values. Compound
@@ -54,7 +54,7 @@ Documentation written by Tom Zanussi
5454
'compatible' if the fields named in the trigger share the same
5555
number and type of fields and those fields also have the same names.
5656
Note that any two events always share the compatible 'hitcount' and
57-
'stacktrace' fields and can therefore be combined using those
57+
'common_stacktrace' fields and can therefore be combined using those
5858
fields, however pointless that may be.
5959

6060
'hist' triggers add a 'hist' file to each event's subdirectory.
@@ -547,9 +547,9 @@ Extended error information
547547
the hist trigger display symbolic call_sites, we can have the hist
548548
trigger additionally display the complete set of kernel stack traces
549549
that led to each call_site. To do that, we simply use the special
550-
value 'stacktrace' for the key parameter::
550+
value 'common_stacktrace' for the key parameter::
551551

552-
# echo 'hist:keys=stacktrace:values=bytes_req,bytes_alloc:sort=bytes_alloc' > \
552+
# echo 'hist:keys=common_stacktrace:values=bytes_req,bytes_alloc:sort=bytes_alloc' > \
553553
/sys/kernel/tracing/events/kmem/kmalloc/trigger
554554

555555
The above trigger will use the kernel stack trace in effect when an
@@ -561,9 +561,9 @@ Extended error information
561561
every callpath to a kmalloc for a kernel compile)::
562562

563563
# cat /sys/kernel/tracing/events/kmem/kmalloc/hist
564-
# trigger info: hist:keys=stacktrace:vals=bytes_req,bytes_alloc:sort=bytes_alloc:size=2048 [active]
564+
# trigger info: hist:keys=common_stacktrace:vals=bytes_req,bytes_alloc:sort=bytes_alloc:size=2048 [active]
565565

566-
{ stacktrace:
566+
{ common_stacktrace:
567567
__kmalloc_track_caller+0x10b/0x1a0
568568
kmemdup+0x20/0x50
569569
hidraw_report_event+0x8a/0x120 [hid]
@@ -581,7 +581,7 @@ Extended error information
581581
cpu_startup_entry+0x315/0x3e0
582582
rest_init+0x7c/0x80
583583
} hitcount: 3 bytes_req: 21 bytes_alloc: 24
584-
{ stacktrace:
584+
{ common_stacktrace:
585585
__kmalloc_track_caller+0x10b/0x1a0
586586
kmemdup+0x20/0x50
587587
hidraw_report_event+0x8a/0x120 [hid]
@@ -596,7 +596,7 @@ Extended error information
596596
do_IRQ+0x5a/0xf0
597597
ret_from_intr+0x0/0x30
598598
} hitcount: 3 bytes_req: 21 bytes_alloc: 24
599-
{ stacktrace:
599+
{ common_stacktrace:
600600
kmem_cache_alloc_trace+0xeb/0x150
601601
aa_alloc_task_context+0x27/0x40
602602
apparmor_cred_prepare+0x1f/0x50
@@ -608,15 +608,15 @@ Extended error information
608608
.
609609
.
610610
.
611-
{ stacktrace:
611+
{ common_stacktrace:
612612
__kmalloc+0x11b/0x1b0
613613
i915_gem_execbuffer2+0x6c/0x2c0 [i915]
614614
drm_ioctl+0x349/0x670 [drm]
615615
do_vfs_ioctl+0x2f0/0x4f0
616616
SyS_ioctl+0x81/0xa0
617617
system_call_fastpath+0x12/0x6a
618618
} hitcount: 17726 bytes_req: 13944120 bytes_alloc: 19593808
619-
{ stacktrace:
619+
{ common_stacktrace:
620620
__kmalloc+0x11b/0x1b0
621621
load_elf_phdrs+0x76/0xa0
622622
load_elf_binary+0x102/0x1650
@@ -625,7 +625,7 @@ Extended error information
625625
SyS_execve+0x3a/0x50
626626
return_from_execve+0x0/0x23
627627
} hitcount: 33348 bytes_req: 17152128 bytes_alloc: 20226048
628-
{ stacktrace:
628+
{ common_stacktrace:
629629
kmem_cache_alloc_trace+0xeb/0x150
630630
apparmor_file_alloc_security+0x27/0x40
631631
security_file_alloc+0x16/0x20
@@ -636,7 +636,7 @@ Extended error information
636636
SyS_open+0x1e/0x20
637637
system_call_fastpath+0x12/0x6a
638638
} hitcount: 4766422 bytes_req: 9532844 bytes_alloc: 38131376
639-
{ stacktrace:
639+
{ common_stacktrace:
640640
__kmalloc+0x11b/0x1b0
641641
seq_buf_alloc+0x1b/0x50
642642
seq_read+0x2cc/0x370
@@ -1026,7 +1026,7 @@ Extended error information
10261026
First we set up an initially paused stacktrace trigger on the
10271027
netif_receive_skb event::
10281028

1029-
# echo 'hist:key=stacktrace:vals=len:pause' > \
1029+
# echo 'hist:key=common_stacktrace:vals=len:pause' > \
10301030
/sys/kernel/tracing/events/net/netif_receive_skb/trigger
10311031

10321032
Next, we set up an 'enable_hist' trigger on the sched_process_exec
@@ -1060,9 +1060,9 @@ Extended error information
10601060
$ wget https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.19.xz
10611061

10621062
# cat /sys/kernel/tracing/events/net/netif_receive_skb/hist
1063-
# trigger info: hist:keys=stacktrace:vals=len:sort=hitcount:size=2048 [paused]
1063+
# trigger info: hist:keys=common_stacktrace:vals=len:sort=hitcount:size=2048 [paused]
10641064

1065-
{ stacktrace:
1065+
{ common_stacktrace:
10661066
__netif_receive_skb_core+0x46d/0x990
10671067
__netif_receive_skb+0x18/0x60
10681068
netif_receive_skb_internal+0x23/0x90
@@ -1079,7 +1079,7 @@ Extended error information
10791079
kthread+0xd2/0xf0
10801080
ret_from_fork+0x42/0x70
10811081
} hitcount: 85 len: 28884
1082-
{ stacktrace:
1082+
{ common_stacktrace:
10831083
__netif_receive_skb_core+0x46d/0x990
10841084
__netif_receive_skb+0x18/0x60
10851085
netif_receive_skb_internal+0x23/0x90
@@ -1097,7 +1097,7 @@ Extended error information
10971097
irq_thread+0x11f/0x150
10981098
kthread+0xd2/0xf0
10991099
} hitcount: 98 len: 664329
1100-
{ stacktrace:
1100+
{ common_stacktrace:
11011101
__netif_receive_skb_core+0x46d/0x990
11021102
__netif_receive_skb+0x18/0x60
11031103
process_backlog+0xa8/0x150
@@ -1115,7 +1115,7 @@ Extended error information
11151115
inet_sendmsg+0x64/0xa0
11161116
sock_sendmsg+0x3d/0x50
11171117
} hitcount: 115 len: 13030
1118-
{ stacktrace:
1118+
{ common_stacktrace:
11191119
__netif_receive_skb_core+0x46d/0x990
11201120
__netif_receive_skb+0x18/0x60
11211121
netif_receive_skb_internal+0x23/0x90
@@ -1142,14 +1142,14 @@ Extended error information
11421142
into the histogram. In order to avoid having to set everything up
11431143
again, we can just clear the histogram first::
11441144

1145-
# echo 'hist:key=stacktrace:vals=len:clear' >> \
1145+
# echo 'hist:key=common_stacktrace:vals=len:clear' >> \
11461146
/sys/kernel/tracing/events/net/netif_receive_skb/trigger
11471147

11481148
Just to verify that it is in fact cleared, here's what we now see in
11491149
the hist file::
11501150

11511151
# cat /sys/kernel/tracing/events/net/netif_receive_skb/hist
1152-
# trigger info: hist:keys=stacktrace:vals=len:sort=hitcount:size=2048 [paused]
1152+
# trigger info: hist:keys=common_stacktrace:vals=len:sort=hitcount:size=2048 [paused]
11531153

11541154
Totals:
11551155
Hits: 0
@@ -1485,12 +1485,12 @@ Extended error information
14851485

14861486
And here's an example that shows how to combine histogram data from
14871487
any two events even if they don't share any 'compatible' fields
1488-
other than 'hitcount' and 'stacktrace'. These commands create a
1488+
other than 'hitcount' and 'common_stacktrace'. These commands create a
14891489
couple of triggers named 'bar' using those fields::
14901490

1491-
# echo 'hist:name=bar:key=stacktrace:val=hitcount' > \
1491+
# echo 'hist:name=bar:key=common_stacktrace:val=hitcount' > \
14921492
/sys/kernel/tracing/events/sched/sched_process_fork/trigger
1493-
# echo 'hist:name=bar:key=stacktrace:val=hitcount' > \
1493+
# echo 'hist:name=bar:key=common_stacktrace:val=hitcount' > \
14941494
/sys/kernel/tracing/events/net/netif_rx/trigger
14951495

14961496
And displaying the output of either shows some interesting if
@@ -1501,16 +1501,16 @@ Extended error information
15011501

15021502
# event histogram
15031503
#
1504-
# trigger info: hist:name=bar:keys=stacktrace:vals=hitcount:sort=hitcount:size=2048 [active]
1504+
# trigger info: hist:name=bar:keys=common_stacktrace:vals=hitcount:sort=hitcount:size=2048 [active]
15051505
#
15061506

1507-
{ stacktrace:
1507+
{ common_stacktrace:
15081508
kernel_clone+0x18e/0x330
15091509
kernel_thread+0x29/0x30
15101510
kthreadd+0x154/0x1b0
15111511
ret_from_fork+0x3f/0x70
15121512
} hitcount: 1
1513-
{ stacktrace:
1513+
{ common_stacktrace:
15141514
netif_rx_internal+0xb2/0xd0
15151515
netif_rx_ni+0x20/0x70
15161516
dev_loopback_xmit+0xaa/0xd0
@@ -1528,7 +1528,7 @@ Extended error information
15281528
call_cpuidle+0x3b/0x60
15291529
cpu_startup_entry+0x22d/0x310
15301530
} hitcount: 1
1531-
{ stacktrace:
1531+
{ common_stacktrace:
15321532
netif_rx_internal+0xb2/0xd0
15331533
netif_rx_ni+0x20/0x70
15341534
dev_loopback_xmit+0xaa/0xd0
@@ -1543,7 +1543,7 @@ Extended error information
15431543
SyS_sendto+0xe/0x10
15441544
entry_SYSCALL_64_fastpath+0x12/0x6a
15451545
} hitcount: 2
1546-
{ stacktrace:
1546+
{ common_stacktrace:
15471547
netif_rx_internal+0xb2/0xd0
15481548
netif_rx+0x1c/0x60
15491549
loopback_xmit+0x6c/0xb0
@@ -1561,7 +1561,7 @@ Extended error information
15611561
sock_sendmsg+0x38/0x50
15621562
___sys_sendmsg+0x14e/0x270
15631563
} hitcount: 76
1564-
{ stacktrace:
1564+
{ common_stacktrace:
15651565
netif_rx_internal+0xb2/0xd0
15661566
netif_rx+0x1c/0x60
15671567
loopback_xmit+0x6c/0xb0
@@ -1579,7 +1579,7 @@ Extended error information
15791579
sock_sendmsg+0x38/0x50
15801580
___sys_sendmsg+0x269/0x270
15811581
} hitcount: 77
1582-
{ stacktrace:
1582+
{ common_stacktrace:
15831583
netif_rx_internal+0xb2/0xd0
15841584
netif_rx+0x1c/0x60
15851585
loopback_xmit+0x6c/0xb0
@@ -1597,7 +1597,7 @@ Extended error information
15971597
sock_sendmsg+0x38/0x50
15981598
SYSC_sendto+0xef/0x170
15991599
} hitcount: 88
1600-
{ stacktrace:
1600+
{ common_stacktrace:
16011601
kernel_clone+0x18e/0x330
16021602
SyS_clone+0x19/0x20
16031603
entry_SYSCALL_64_fastpath+0x12/0x6a
@@ -1949,7 +1949,7 @@ uninterruptible state::
19491949

19501950
# cd /sys/kernel/tracing
19511951
# echo 's:block_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events
1952-
# echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=stacktrace if prev_state == 2' >> events/sched/sched_switch/trigger
1952+
# echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=common_stacktrace if prev_state == 2' >> events/sched/sched_switch/trigger
19531953
# echo 'hist:keys=prev_pid:delta=common_timestamp.usecs-$ts,s=$st:onmax($delta).trace(block_lat,prev_pid,$delta,$s)' >> events/sched/sched_switch/trigger
19541954
# echo 1 > events/synthetic/block_lat/enable
19551955
# cat trace

arch/powerpc/purgatory/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ KCSAN_SANITIZE := n
55

66
targets += trampoline_$(BITS).o purgatory.ro
77

8+
# When profile-guided optimization is enabled, llvm emits two different
9+
# overlapping text sections, which is not supported by kexec. Remove profile
10+
# optimization flags.
11+
KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%,$(KBUILD_CFLAGS))
12+
813
LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined
914

1015
$(obj)/purgatory.ro: $(obj)/trampoline_$(BITS).o FORCE

arch/riscv/purgatory/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ CFLAGS_sha256.o := -D__DISABLE_EXPORTS
3535
CFLAGS_string.o := -D__DISABLE_EXPORTS
3636
CFLAGS_ctype.o := -D__DISABLE_EXPORTS
3737

38+
# When profile-guided optimization is enabled, llvm emits two different
39+
# overlapping text sections, which is not supported by kexec. Remove profile
40+
# optimization flags.
41+
KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%,$(KBUILD_CFLAGS))
42+
3843
# When linking purgatory.ro with -r unresolved symbols are not checked,
3944
# also link a purgatory.chk binary without -r to check for unresolved symbols.
4045
PURGATORY_LDFLAGS := -e purgatory_start -z nodefaultlib

arch/x86/crypto/aria-aesni-avx-asm_64.S

-2
Original file line numberDiff line numberDiff line change
@@ -773,8 +773,6 @@
773773
.octa 0x3F893781E95FE1576CDA64D2BA0CB204
774774

775775
#ifdef CONFIG_AS_GFNI
776-
.section .rodata.cst8, "aM", @progbits, 8
777-
.align 8
778776
/* AES affine: */
779777
#define tf_aff_const BV8(1, 1, 0, 0, 0, 1, 1, 0)
780778
.Ltf_aff_bitmatrix:

arch/x86/purgatory/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ $(obj)/sha256.o: $(srctree)/lib/crypto/sha256.c FORCE
1414

1515
CFLAGS_sha256.o := -D__DISABLE_EXPORTS
1616

17+
# When profile-guided optimization is enabled, llvm emits two different
18+
# overlapping text sections, which is not supported by kexec. Remove profile
19+
# optimization flags.
20+
KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%,$(KBUILD_CFLAGS))
21+
1722
# When linking purgatory.ro with -r unresolved symbols are not checked,
1823
# also link a purgatory.chk binary without -r to check for unresolved symbols.
1924
PURGATORY_LDFLAGS := -e purgatory_start -z nodefaultlib

drivers/dma-buf/udmabuf.c

+6-41
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/shmem_fs.h>
1313
#include <linux/slab.h>
1414
#include <linux/udmabuf.h>
15-
#include <linux/hugetlb.h>
1615
#include <linux/vmalloc.h>
1716
#include <linux/iosys-map.h>
1817

@@ -207,9 +206,7 @@ static long udmabuf_create(struct miscdevice *device,
207206
struct udmabuf *ubuf;
208207
struct dma_buf *buf;
209208
pgoff_t pgoff, pgcnt, pgidx, pgbuf = 0, pglimit;
210-
struct page *page, *hpage = NULL;
211-
pgoff_t subpgoff, maxsubpgs;
212-
struct hstate *hpstate;
209+
struct page *page;
213210
int seals, ret = -EINVAL;
214211
u32 i, flags;
215212

@@ -245,7 +242,7 @@ static long udmabuf_create(struct miscdevice *device,
245242
if (!memfd)
246243
goto err;
247244
mapping = memfd->f_mapping;
248-
if (!shmem_mapping(mapping) && !is_file_hugepages(memfd))
245+
if (!shmem_mapping(mapping))
249246
goto err;
250247
seals = memfd_fcntl(memfd, F_GET_SEALS, 0);
251248
if (seals == -EINVAL)
@@ -256,48 +253,16 @@ static long udmabuf_create(struct miscdevice *device,
256253
goto err;
257254
pgoff = list[i].offset >> PAGE_SHIFT;
258255
pgcnt = list[i].size >> PAGE_SHIFT;
259-
if (is_file_hugepages(memfd)) {
260-
hpstate = hstate_file(memfd);
261-
pgoff = list[i].offset >> huge_page_shift(hpstate);
262-
subpgoff = (list[i].offset &
263-
~huge_page_mask(hpstate)) >> PAGE_SHIFT;
264-
maxsubpgs = huge_page_size(hpstate) >> PAGE_SHIFT;
265-
}
266256
for (pgidx = 0; pgidx < pgcnt; pgidx++) {
267-
if (is_file_hugepages(memfd)) {
268-
if (!hpage) {
269-
hpage = find_get_page_flags(mapping, pgoff,
270-
FGP_ACCESSED);
271-
if (!hpage) {
272-
ret = -EINVAL;
273-
goto err;
274-
}
275-
}
276-
page = hpage + subpgoff;
277-
get_page(page);
278-
subpgoff++;
279-
if (subpgoff == maxsubpgs) {
280-
put_page(hpage);
281-
hpage = NULL;
282-
subpgoff = 0;
283-
pgoff++;
284-
}
285-
} else {
286-
page = shmem_read_mapping_page(mapping,
287-
pgoff + pgidx);
288-
if (IS_ERR(page)) {
289-
ret = PTR_ERR(page);
290-
goto err;
291-
}
257+
page = shmem_read_mapping_page(mapping, pgoff + pgidx);
258+
if (IS_ERR(page)) {
259+
ret = PTR_ERR(page);
260+
goto err;
292261
}
293262
ubuf->pages[pgbuf++] = page;
294263
}
295264
fput(memfd);
296265
memfd = NULL;
297-
if (hpage) {
298-
put_page(hpage);
299-
hpage = NULL;
300-
}
301266
}
302267

303268
exp_info.ops = &udmabuf_ops;

0 commit comments

Comments
 (0)