-
Notifications
You must be signed in to change notification settings - Fork 16
/
ingens.diff
7313 lines (7060 loc) · 203 KB
/
ingens.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/arch/x86/kernel/sys_x86_64.c linux-4.3-osa/arch/x86/kernel/sys_x86_64.c
--- linux-4.3-org/arch/x86/kernel/sys_x86_64.c 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/arch/x86/kernel/sys_x86_64.c 2016-03-04 19:57:43.645958822 -0600
@@ -140,7 +140,10 @@
return -ENOMEM;
if (addr) {
- addr = PAGE_ALIGN(addr);
+ if (flags & MAP_HPAGE)
+ addr = HPAGE_ALIGN(addr);
+ else
+ addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
if (end - len >= addr &&
(!vma || addr + len <= vma->vm_start))
@@ -148,6 +151,10 @@
}
info.flags = 0;
+ if (flags & MAP_HPAGE)
+ info.map_flags = MAP_HPAGE;
+ else
+ info.map_flags = 0;
info.length = len;
info.low_limit = begin;
info.high_limit = end;
@@ -183,7 +190,10 @@
/* requesting a specific address */
if (addr) {
- addr = PAGE_ALIGN(addr);
+ if (flags & MAP_HPAGE)
+ addr = HPAGE_ALIGN(addr);
+ else
+ addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
if (TASK_SIZE - len >= addr &&
(!vma || addr + len <= vma->vm_start))
@@ -191,6 +201,11 @@
}
info.flags = VM_UNMAPPED_AREA_TOPDOWN;
+ if (flags & MAP_HPAGE)
+ info.map_flags = MAP_HPAGE;
+ //info.map_flags = 0;
+ else
+ info.map_flags = 0;
info.length = len;
info.low_limit = PAGE_SIZE;
info.high_limit = mm->mmap_base;
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/arch/x86/kvm/kvm_osa.c linux-4.3-osa/arch/x86/kvm/kvm_osa.c
--- linux-4.3-org/arch/x86/kvm/kvm_osa.c 1969-12-31 18:00:00.000000000 -0600
+++ linux-4.3-osa/arch/x86/kvm/kvm_osa.c 2016-03-04 19:57:43.649958822 -0600
@@ -0,0 +1,27 @@
+#include <osa/kvm.h>
+#include <linux/printk.h>
+#include <linux/mm_types.h>
+#include <linux/page-flags.h>
+
+int osa_get_hpage_info(struct kvm *kvm, unsigned long gfn)
+{
+ unsigned long pfn;
+ struct page *page;
+ pfn = gfn_to_pfn(kvm, gfn);
+
+ if (is_error_noslot_pfn(pfn))
+ return -EPERM;
+
+ //printk("%lx %lx\n", gfn, pfn);
+
+ page = pfn_to_page(pfn);
+
+ if (page) {
+ if (PageTransHuge(page))
+ return 1;
+ } else {
+ return -EFAULT;
+ }
+
+ return 0;
+}
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/arch/x86/kvm/Makefile linux-4.3-osa/arch/x86/kvm/Makefile
--- linux-4.3-org/arch/x86/kvm/Makefile 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/arch/x86/kvm/Makefile 2016-03-04 19:57:43.645958822 -0600
@@ -9,6 +9,9 @@
kvm-y += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
$(KVM)/eventfd.o $(KVM)/irqchip.o $(KVM)/vfio.o
+
+kvm-y += kvm_osa.o
+
kvm-$(CONFIG_KVM_ASYNC_PF) += $(KVM)/async_pf.o
kvm-y += x86.o mmu.o emulate.o i8259.o irq.o lapic.o \
@@ -19,6 +22,6 @@
kvm-intel-y += vmx.o pmu_intel.o
kvm-amd-y += svm.o pmu_amd.o
-obj-$(CONFIG_KVM) += kvm.o
+obj-$(CONFIG_KVM) += kvm.o
obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
obj-$(CONFIG_KVM_AMD) += kvm-amd.o
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/arch/x86/kvm/x86.c linux-4.3-osa/arch/x86/kvm/x86.c
--- linux-4.3-org/arch/x86/kvm/x86.c 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/arch/x86/kvm/x86.c 2016-03-04 19:57:43.653958823 -0600
@@ -52,6 +52,7 @@
#include <linux/timekeeper_internal.h>
#include <linux/pvclock_gtod.h>
#include <trace/events/kvm.h>
+#include <osa/kvm.h>
#define CREATE_TRACE_POINTS
#include "trace.h"
@@ -5728,10 +5729,12 @@
a3 &= 0xFFFFFFFF;
}
+ /* Allowing user-level hypercall
if (kvm_x86_ops->get_cpl(vcpu) != 0) {
ret = -KVM_EPERM;
goto out;
}
+ */
switch (nr) {
case KVM_HC_VAPIC_POLL_IRQ:
@@ -5741,11 +5744,14 @@
kvm_pv_kick_cpu_op(vcpu->kvm, a0, a1);
ret = 0;
break;
+ case KVM_HC_OSA_GET_HUGEINFO:
+ ret = osa_get_hpage_info(vcpu->kvm, a0);
+ break;
default:
ret = -KVM_ENOSYS;
break;
}
-out:
+//out:
if (!op_64_bit)
ret = (u32)ret;
kvm_register_write(vcpu, VCPU_REGS_RAX, ret);
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/arch/x86/mm/fault.c linux-4.3-osa/arch/x86/mm/fault.c
--- linux-4.3-org/arch/x86/mm/fault.c 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/arch/x86/mm/fault.c 2016-10-07 00:07:54.745405225 -0500
@@ -1012,7 +1012,6 @@
return 0;
}
- /* read, present: */
if (unlikely(error_code & PF_PROT))
return 1;
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/build_tags.sh linux-4.3-osa/build_tags.sh
--- linux-4.3-org/build_tags.sh 1969-12-31 18:00:00.000000000 -0600
+++ linux-4.3-osa/build_tags.sh 2016-03-04 19:57:43.693958824 -0600
@@ -0,0 +1,17 @@
+#! /bin/bash
+
+PWD=`pwd`\/;
+find $PWD \( -name '*.c' -o -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.s' -o -name '*.S' -o -name '*.java' \) -type f -print > cscope.tmp
+egrep -v arch cscope.tmp > cscope.files
+egrep arch cscope.tmp | egrep x86 >> cscope.files
+rm -rf cscope.tmp
+cscope -bR
+
+ctags="ctags --c-kinds=+defgpstux -R"
+for l in `ls ./arch | egrep -v x86`;
+do
+ ctags+=" --exclude=arch/$l"
+done
+
+echo $ctags
+$ctags
Binary files linux-4.3-org/drivers/staging/ft1000/ft1000-pcmcia/ft1000.img and linux-4.3-osa/drivers/staging/ft1000/ft1000-pcmcia/ft1000.img differ
Binary files linux-4.3-org/drivers/staging/ft1000/ft1000-usb/ft3000.img and linux-4.3-osa/drivers/staging/ft1000/ft1000-usb/ft3000.img differ
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/drivers/virtio/virtio_balloon.c linux-4.3-osa/drivers/virtio/virtio_balloon.c
--- linux-4.3-org/drivers/virtio/virtio_balloon.c 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/drivers/virtio/virtio_balloon.c 2016-03-04 19:57:45.749958878 -0600
@@ -31,6 +31,9 @@
#include <linux/oom.h>
#include <linux/wait.h>
+#include <linux/cgroup.h>
+#include <linux/vmpressure.h>
+
/*
* Balloon device works in 4K page units. So each page is pointed to by
* multiple balloon pages. All memory counters in this driver are in balloon
@@ -45,9 +48,11 @@
module_param(oom_pages, int, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(oom_pages, "pages to free on OOM");
+#define VIRTIO_BALLOON_MSG_PRESSURE 1
+
struct virtio_balloon {
struct virtio_device *vdev;
- struct virtqueue *inflate_vq, *deflate_vq, *stats_vq;
+ struct virtqueue *inflate_vq, *deflate_vq, *stats_vq, *message_vq;
/* Where the ballooning thread waits for config to change. */
wait_queue_head_t config_change;
@@ -58,6 +63,8 @@
/* Waiting for host to ack the pages we released. */
wait_queue_head_t acked;
+ wait_queue_head_t message_acked;
+
/* Number of balloon pages we've told the Host we're not using. */
unsigned int num_pages;
/*
@@ -81,6 +88,9 @@
/* To register callback in oom notifier call chain */
struct notifier_block nb;
+
+ /* Message virtqueue */
+ atomic_t guest_pressure;
};
static struct virtio_device_id id_table[] = {
@@ -88,6 +98,41 @@
{ 0 },
};
+static inline bool guest_under_pressure(const struct virtio_balloon *vb)
+{
+ return atomic_read(&vb->guest_pressure) == 1;
+}
+
+static void vmpressure_event_handler(void *data, int level)
+{
+ struct virtio_balloon *vb = data;
+
+ atomic_set(&vb->guest_pressure, 1);
+ wake_up(&vb->config_change);
+}
+
+static void tell_host_pressure(struct virtio_balloon *vb)
+{
+ const uint32_t msg = VIRTIO_BALLOON_MSG_PRESSURE;
+ struct scatterlist sg;
+ unsigned int len;
+ int err;
+
+ sg_init_one(&sg, &msg, sizeof(msg));
+
+ err = virtqueue_add_outbuf(vb->message_vq, &sg, 1, vb, GFP_KERNEL);
+ if (err < 0) {
+ printk(KERN_WARNING "virtio-balloon: failed to send host message (%d)\n", err);
+ goto out;
+ }
+ virtqueue_kick(vb->message_vq);
+
+ wait_event(vb->message_acked, virtqueue_get_buf(vb->message_vq, &len));
+
+out:
+ atomic_set(&vb->guest_pressure, 0);
+}
+
static u32 page_to_balloon_pfn(struct page *page)
{
unsigned long pfn = page_to_pfn(page);
@@ -110,6 +155,13 @@
wake_up(&vb->acked);
}
+static void message_ack(struct virtqueue *vq)
+{
+ struct virtio_balloon *vb = vq->vdev->priv;
+
+ wake_up(&vb->message_acked);
+}
+
static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
{
struct scatterlist sg;
@@ -145,8 +197,13 @@
mutex_lock(&vb->balloon_lock);
for (vb->num_pfns = 0; vb->num_pfns < num;
vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) {
- struct page *page = balloon_page_enqueue(vb_dev_info);
+ struct page *page;
+
+ if (guest_under_pressure(vb)) {
+ break;
+ }
+ page = balloon_page_enqueue(vb_dev_info);
if (!page) {
dev_info_ratelimited(&vb->vdev->dev,
"Out of puff! Can't get %u pages\n",
@@ -359,6 +416,7 @@
add_wait_queue(&vb->config_change, &wait);
for (;;) {
if ((diff = towards_target(vb)) != 0 ||
+ guest_under_pressure(vb) ||
vb->need_stats_update ||
kthread_should_stop() ||
freezing(current))
@@ -375,6 +433,9 @@
leak_balloon(vb, -diff);
update_balloon_size(vb);
+ if (guest_under_pressure(vb))
+ tell_host_pressure(vb);
+
/*
* For large balloon changes, we could spend a lot of time
* and always have work to do. Be nice if preempt disabled.
@@ -386,25 +447,28 @@
static int init_vqs(struct virtio_balloon *vb)
{
- struct virtqueue *vqs[3];
- vq_callback_t *callbacks[] = { balloon_ack, balloon_ack, stats_request };
- const char *names[] = { "inflate", "deflate", "stats" };
- int err, nvqs;
+ struct virtqueue *vqs[4];
+ vq_callback_t *callbacks[] = { balloon_ack, balloon_ack,
+ stats_request, message_ack };
+ const char *names[] = { "inflate", "deflate", "stats", "pressure" };
+ int err, nvqs, idx;
/*
* We expect two virtqueues: inflate and deflate, and
- * optionally stat.
+ * optionally stat and message.
*/
- nvqs = virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ) ? 3 : 2;
+ nvqs = 2 + virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ) +
+ virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_MESSAGE_VQ);
err = vb->vdev->config->find_vqs(vb->vdev, nvqs, vqs, callbacks, names);
if (err)
return err;
- vb->inflate_vq = vqs[0];
- vb->deflate_vq = vqs[1];
+ idx = 0;
+ vb->inflate_vq = vqs[idx++];
+ vb->deflate_vq = vqs[idx++];
if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ)) {
struct scatterlist sg;
- vb->stats_vq = vqs[2];
+ vb->stats_vq = vqs[idx++];
/*
* Prime this virtqueue with one buffer so the hypervisor can
@@ -416,6 +480,9 @@
BUG();
virtqueue_kick(vb->stats_vq);
}
+ if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_MESSAGE_VQ))
+ vb->message_vq = vqs[idx];
+
return 0;
}
@@ -502,9 +569,11 @@
vb->num_pages = 0;
mutex_init(&vb->balloon_lock);
init_waitqueue_head(&vb->config_change);
+ init_waitqueue_head(&vb->message_acked);
init_waitqueue_head(&vb->acked);
vb->vdev = vdev;
vb->need_stats_update = 0;
+ atomic_set(&vb->guest_pressure, 0);
balloon_devinfo_init(&vb->vb_dev_info);
#ifdef CONFIG_BALLOON_COMPACTION
@@ -523,6 +592,12 @@
virtio_device_ready(vdev);
+ if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_MESSAGE_VQ)) {
+ err = vmpressure_register_kernel_event(NULL, vmpressure_event_handler, vb);
+ if (err)
+ goto out_free_vb;
+ }
+
vb->thread = kthread_run(balloon, vb, "vballoon");
if (IS_ERR(vb->thread)) {
err = PTR_ERR(vb->thread);
@@ -599,6 +674,7 @@
VIRTIO_BALLOON_F_MUST_TELL_HOST,
VIRTIO_BALLOON_F_STATS_VQ,
VIRTIO_BALLOON_F_DEFLATE_ON_OOM,
+ VIRTIO_BALLOON_F_MESSAGE_VQ,
};
static struct virtio_driver virtio_balloon_driver = {
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/fs/proc/base.c linux-4.3-osa/fs/proc/base.c
--- linux-4.3-org/fs/proc/base.c 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/fs/proc/base.c 2016-11-01 00:24:48.726089091 -0500
@@ -2763,6 +2763,11 @@
REG("smaps", S_IRUGO, proc_pid_smaps_operations),
REG("pagemap", S_IRUSR, proc_pagemap_operations),
#endif
+#ifdef CONFIG_OSA
+ REG("hugepage", S_IRUSR, osa_hpage_proc_operations),
+ REG("hugepage_madvise", S_IRUSR, osa_hpage_madvise_operations),
+ REG("hugepage_stats", S_IRUSR|S_IWUSR, osa_hpage_stats_operations),
+#endif
#ifdef CONFIG_SECURITY
DIR("attr", S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations),
#endif
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/fs/proc/internal.h linux-4.3-osa/fs/proc/internal.h
--- linux-4.3-org/fs/proc/internal.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/fs/proc/internal.h 2016-11-01 00:24:48.726089091 -0500
@@ -297,6 +297,12 @@
extern const struct file_operations proc_tid_smaps_operations;
extern const struct file_operations proc_clear_refs_operations;
extern const struct file_operations proc_pagemap_operations;
+#ifdef CONFIG_OSA
+extern struct file_operations osa_hpage_proc_operations;
+extern struct file_operations osa_hpage_madvise_operations;
+extern struct file_operations osa_hpage_stats_operations;
+extern struct file_operations osa_dump_lru_operations;
+#endif
extern unsigned long task_vsize(struct mm_struct *);
extern unsigned long task_statm(struct mm_struct *,
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/.get_maintainer.ignore linux-4.3-osa/.get_maintainer.ignore
--- linux-4.3-org/.get_maintainer.ignore 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/.get_maintainer.ignore 1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-Christoph Hellwig <[email protected]>
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/compaction.h linux-4.3-osa/include/linux/compaction.h
--- linux-4.3-org/include/linux/compaction.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/compaction.h 2016-03-15 05:18:42.287158072 -0500
@@ -28,6 +28,13 @@
struct alloc_context; /* in mm/internal.h */
#ifdef CONFIG_COMPACTION
+struct contig_page_info {
+ unsigned long free_pages;
+ unsigned long free_blocks_total;
+ unsigned long free_pages_suitable;
+ unsigned long free_blocks_suitable;
+};
+
extern int sysctl_compact_memory;
extern int sysctl_compaction_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *length, loff_t *ppos);
@@ -37,10 +44,16 @@
extern int sysctl_compact_unevictable_allowed;
extern int fragmentation_index(struct zone *zone, unsigned int order);
+extern void fill_contig_page_info(struct zone *zone,
+ unsigned int suitable_order,
+ struct contig_page_info *info);
extern unsigned long try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
int alloc_flags, const struct alloc_context *ac,
enum migrate_mode mode, int *contended);
extern void compact_pgdat(pg_data_t *pgdat, int order);
+#ifdef CONFIG_OSA
+extern void compact_pgdat_periodic(pg_data_t *pgdat, int order);
+#endif
extern void reset_isolation_suitable(pg_data_t *pgdat);
extern unsigned long compaction_suitable(struct zone *zone, int order,
int alloc_flags, int classzone_idx);
@@ -60,6 +73,12 @@
return COMPACT_CONTINUE;
}
+#ifdef CONFIG_OSA
+static inline void compact_pgdat_periodic(pg_data_t *pgdat, int order)
+{
+}
+#endif
+
static inline void compact_pgdat(pg_data_t *pgdat, int order)
{
}
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/huge_mm.h linux-4.3-osa/include/linux/huge_mm.h
--- linux-4.3-org/include/linux/huge_mm.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/huge_mm.h 2016-11-01 00:24:48.726089091 -0500
@@ -14,7 +14,7 @@
pmd_t orig_pmd, int dirty);
extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
unsigned long address, pmd_t *pmd,
- pmd_t orig_pmd);
+ pmd_t orig_pmd, unsigned int flags);
extern struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
unsigned long addr,
pmd_t *pmd,
@@ -69,6 +69,12 @@
extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
+#define thp_enabled \
+ (transparent_hugepage_flags & \
+ (1<<TRANSPARENT_HUGEPAGE_FLAG) || \
+ (transparent_hugepage_flags & \
+ (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG)))
+
#define transparent_hugepage_enabled(__vma) \
((transparent_hugepage_flags & \
(1<<TRANSPARENT_HUGEPAGE_FLAG) || \
@@ -220,4 +226,15 @@
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+extern struct kobject *sysfs_hugepage_kobj;
+
+#ifdef CONFIG_OSA
+extern struct list_head osa_hpage_scan_list;
+extern unsigned int deferred_mode;
+extern unsigned int util_threshold;
+extern unsigned int hugepage_fairness;
+extern unsigned long distance_divisor;
+#endif
+
+
#endif /* _LINUX_HUGE_MM_H */
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/khugepaged.h linux-4.3-osa/include/linux/khugepaged.h
--- linux-4.3-org/include/linux/khugepaged.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/khugepaged.h 2016-03-05 00:06:04.762351086 -0600
@@ -9,6 +9,8 @@
extern int khugepaged_enter_vma_merge(struct vm_area_struct *vma,
unsigned long vm_flags);
+static DECLARE_WAIT_QUEUE_HEAD(khugepaged_wait);
+
#define khugepaged_enabled() \
(transparent_hugepage_flags & \
((1<<TRANSPARENT_HUGEPAGE_FLAG) | \
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/migrate.h linux-4.3-osa/include/linux/migrate.h
--- linux-4.3-org/include/linux/migrate.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/migrate.h 2016-09-20 00:21:29.166619531 -0500
@@ -23,7 +23,9 @@
MR_SYSCALL, /* also applies to cpusets */
MR_MEMPOLICY_MBIND,
MR_NUMA_MISPLACED,
- MR_CMA
+ MR_CMA,
+ MR_HUGEPAGE_RECLAIM,
+ MR_GFN_AGGREGATE,
};
#ifdef CONFIG_MIGRATION
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/mm.h linux-4.3-osa/include/linux/mm.h
--- linux-4.3-org/include/linux/mm.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/mm.h 2016-09-20 00:21:29.166619531 -0500
@@ -84,11 +84,28 @@
#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
+/* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */
+#define PAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)addr, PAGE_SIZE)
+#define HPAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)addr, HPAGE_SIZE)
+
/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
+static inline unsigned long PAGE_ALIGN_FLOOR(unsigned long addr)
+{
+ if (PAGE_ALIGNED(addr))
+ return addr;
+ else
+ return PAGE_ALIGN(addr) - PAGE_SIZE;
+}
-/* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */
-#define PAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)addr, PAGE_SIZE)
+#define HPAGE_ALIGN(addr) ALIGN(addr, HPAGE_SIZE)
+static inline unsigned long HPAGE_ALIGN_FLOOR(unsigned long addr)
+{
+ if (HPAGE_ALIGNED(addr))
+ return addr;
+ else
+ return HPAGE_ALIGN(addr) - HPAGE_SIZE;
+}
/*
* Linux kernel virtual memory manager primitives.
@@ -215,6 +232,7 @@
#define FAULT_FLAG_KILLABLE 0x10 /* The fault task is in SIGKILL killable region */
#define FAULT_FLAG_TRIED 0x20 /* Second try */
#define FAULT_FLAG_USER 0x40 /* The fault originated in userspace */
+#define FAULT_FLAG_INST 0x100 /* The fault is caused by instruction access */
/*
* vm_fault is filled by the the pagefault handler and passed to the vma's
@@ -1526,6 +1544,10 @@
}
#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */
+#ifdef CONFIG_OSA
+void __init osa_kmem_cache_init(void);
+#endif
+
#if USE_SPLIT_PTE_PTLOCKS
#if ALLOC_SPLIT_PTLOCKS
void __init ptlock_cache_init(void);
@@ -1602,6 +1624,9 @@
{
ptlock_cache_init();
pgtable_cache_init();
+#ifdef CONFIG_OSA
+ osa_kmem_cache_init();
+#endif
}
static inline bool pgtable_page_ctor(struct page *page)
@@ -1972,7 +1997,9 @@
struct vm_unmapped_area_info {
#define VM_UNMAPPED_AREA_TOPDOWN 1
- unsigned long flags;
+ //unsigned long flags;
+ unsigned int flags;
+ unsigned int map_flags;
unsigned long length;
unsigned long low_limit;
unsigned long high_limit;
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/mm_inline.h linux-4.3-osa/include/linux/mm_inline.h
--- linux-4.3-org/include/linux/mm_inline.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/mm_inline.h 2016-11-02 00:29:15.881345842 -0500
@@ -31,6 +31,53 @@
__mod_zone_page_state(lruvec_zone(lruvec), NR_LRU_BASE + lru, nr_pages);
}
+/* lurvec->lists[lru].prev : tail of lru list
+ * pages are checked from the tail.
+ * lurvec->lists[lru].next : head of lru list
+ */
+static __always_inline void
+//static void __attribute__((optimize("O0")))
+add_page_to_lru_list_tail(struct page *page,
+ struct lruvec *lruvec, enum lru_list lru)
+{
+ int nr_pages = hpage_nr_pages(page);
+ struct list_head *l, *head;
+ unsigned long i, inactive_lru_size, active_lru_size, lru_size;
+ struct page *lru_page;
+ //int from_tail = 1;
+
+ mem_cgroup_update_lru_size(lruvec, lru, nr_pages);
+
+ inactive_lru_size = mem_cgroup_get_lru_size(lruvec,
+ LRU_INACTIVE_ANON);
+ active_lru_size = mem_cgroup_get_lru_size(lruvec,
+ LRU_INACTIVE_ANON + LRU_ACTIVE);
+
+ head = &lruvec->lists[lru];
+
+ //BUG_ON(is_active_lru(lru));
+
+ if (is_active_lru(lru))
+ lru_size = active_lru_size;
+ else
+ lru_size = inactive_lru_size;
+
+ lru_size = lru_size / 10;
+ lru_size = distance_divisor * lru_size;
+
+ for (i = 0, l = head->next; i < lru_size; l = l->next) {
+ if (l == head)
+ break;
+
+ lru_page = list_entry(l, struct page, lru);
+ i += hpage_nr_pages(page);
+ }
+
+ list_add(&page->lru, l);
+
+ __mod_zone_page_state(lruvec_zone(lruvec), NR_LRU_BASE + lru, nr_pages);
+}
+
static __always_inline void del_page_from_lru_list(struct page *page,
struct lruvec *lruvec, enum lru_list lru)
{
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/mm_types.h linux-4.3-osa/include/linux/mm_types.h
--- linux-4.3-org/include/linux/mm_types.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/mm_types.h 2016-11-01 00:24:48.726089091 -0500
@@ -14,6 +14,9 @@
#include <linux/page-flags-layout.h>
#include <asm/page.h>
#include <asm/mmu.h>
+#ifdef CONFIG_OSA
+#include <linux/radix-tree.h>
+#endif
#ifndef AT_VECTOR_SIZE_ARCH
#define AT_VECTOR_SIZE_ARCH 0
@@ -30,6 +33,23 @@
typedef void compound_page_dtor(struct page *);
+#ifdef CONFIG_OSA
+//#define FREQ_BITMAP_SIZE 16
+//#define PRI_HISTORY_SIZE 5
+#define FREQ_BITMAP_SIZE 8
+#define PRI_HISTORY_SIZE 3
+
+/* structure for tracking temporal utilization */
+typedef struct utilmap_node {
+ struct list_head link;
+ DECLARE_BITMAP(freq_bitmap, FREQ_BITMAP_SIZE);
+ int32_t frequency[PRI_HISTORY_SIZE];
+ // for debugging
+ unsigned long addr;
+ struct page *page;
+} util_node_t;
+#endif
+
/*
* Each physical page in the system has a struct page associated with
* it to keep track of whatever it is we are using the page for at the
@@ -163,8 +183,10 @@
#endif
#endif
struct kmem_cache *slab_cache; /* SL[AU]B: Pointer to slab */
- struct page *first_page; /* Compound tail pages */
};
+ /* Moved out from previous union block
+ * to support huge slab page */
+ struct page *first_page; /* Compound tail pages */
#ifdef CONFIG_MEMCG
struct mem_cgroup *mem_cgroup;
@@ -192,6 +214,10 @@
*/
void *shadow;
#endif
+#ifdef CONFIG_OSA
+ unsigned long osa_flag;
+ util_node_t util_info;
+#endif
#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS
int _last_cpupid;
@@ -366,6 +392,19 @@
atomic_long_t count[NR_MM_COUNTERS];
};
+
+#ifdef CONFIG_OSA
+struct osa_hpage_stats {
+ unsigned int hpage_requirement;
+ unsigned int total_hpage_count;
+ unsigned long total_bpage_count;
+ unsigned int idle_hpage_count;
+ unsigned long idle_bpage_count;
+ unsigned int idle_tau; //idle page penalty parameter
+ unsigned int weight;
+};
+#endif
+
struct kioctx_table;
struct mm_struct {
struct vm_area_struct *mmap; /* list of VMAs */
@@ -486,6 +525,12 @@
/* address of the bounds directory */
void __user *bd_addr;
#endif
+#ifdef CONFIG_OSA
+ struct osa_hpage_stats hpage_stats;
+ struct list_head osa_hpage_reclaim_link;
+ struct list_head osa_hpage_scan_link;
+ struct radix_tree_root root_popl_map;
+#endif
};
static inline void mm_init_cpumask(struct mm_struct *mm)
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/page_ext.h linux-4.3-osa/include/linux/page_ext.h
--- linux-4.3-org/include/linux/page_ext.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/page_ext.h 2016-09-20 00:21:29.166619531 -0500
@@ -4,6 +4,10 @@
#include <linux/types.h>
#include <linux/stacktrace.h>
+#ifdef CONFIG_OSA
+#include <osa/osa.h>
+#endif
+
struct pglist_data;
struct page_ext_operations {
bool (*need)(void);
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/page_idle.h linux-4.3-osa/include/linux/page_idle.h
--- linux-4.3-org/include/linux/page_idle.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/page_idle.h 2016-03-04 19:57:46.101958887 -0600
@@ -107,4 +107,9 @@
#endif /* CONFIG_IDLE_PAGE_TRACKING */
+extern struct page *page_idle_get_page(unsigned long pfn);
+extern int page_idle_clear_pte_refs_one(struct page *page,
+ struct vm_area_struct *vma,
+ unsigned long addr, void *arg);
+extern void page_idle_clear_pte_refs(struct page *page);
#endif /* _LINUX_MM_PAGE_IDLE_H */
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/slab.h linux-4.3-osa/include/linux/slab.h
--- linux-4.3-org/include/linux/slab.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/slab.h 2016-11-01 00:24:48.726089091 -0500
@@ -90,6 +90,7 @@
/* The following flags affect the page allocator grouping pages by mobility */
#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
#define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */
+
/*
* ZERO_SIZE_PTR will be returned for zero sized kmalloc requests.
*
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/linux/vmpressure.h linux-4.3-osa/include/linux/vmpressure.h
--- linux-4.3-org/include/linux/vmpressure.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/linux/vmpressure.h 2016-03-04 19:57:46.141958888 -0600
@@ -20,6 +20,9 @@
/* Have to grab the lock on events traversal or modifications. */
struct mutex events_lock;
+ /* False if only kernel users want to be notified, true otherwise. */
+ bool notify_userspace;
+
struct work_struct work;
};
@@ -34,9 +37,13 @@
extern void vmpressure_cleanup(struct vmpressure *vmpr);
extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg);
extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr);
+extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css);
extern int vmpressure_register_event(struct mem_cgroup *memcg,
struct eventfd_ctx *eventfd,
const char *args);
+extern int vmpressure_register_kernel_event(struct cgroup_subsys_state *css,
+ void (*fn)(void *data, int level),
+ void *data);
extern void vmpressure_unregister_event(struct mem_cgroup *memcg,
struct eventfd_ctx *eventfd);
#else
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/osa/kvm.h linux-4.3-osa/include/osa/kvm.h
--- linux-4.3-org/include/osa/kvm.h 1969-12-31 18:00:00.000000000 -0600
+++ linux-4.3-osa/include/osa/kvm.h 2016-03-04 19:57:46.165958889 -0600
@@ -0,0 +1,7 @@
+#ifndef _OSA_KVM_H_
+#define _OSA_KVM_H_
+#include <linux/kvm_host.h>
+
+int osa_get_hpage_info(struct kvm *kvm, unsigned long gfn);
+
+#endif
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/osa/osa.h linux-4.3-osa/include/osa/osa.h
--- linux-4.3-org/include/osa/osa.h 1969-12-31 18:00:00.000000000 -0600
+++ linux-4.3-osa/include/osa/osa.h 2016-11-01 00:24:48.726089091 -0500
@@ -0,0 +1,82 @@
+#ifndef _OSA_H_
+#define _OSA_H_
+#include <linux/mm.h>
+
+#define AGGR_BITMAP_SIZE 4
+
+//Page flags for osa_flag in struct page
+#define OSA_PF_AGGR 0x1 //Page is aggregated by osa_hpage_scand
+
+extern spinlock_t osa_hpage_list_lock;
+
+/* SLAB cache for worklist node */
+extern struct kmem_cache *osa_poplmap_node_cachep;
+extern struct kmem_cache *osa_work_node_cachep;
+extern struct kmem_cache *osa_aggregate_node_cachep;
+
+typedef struct osa_aggregation_node {
+ struct list_head link;
+ struct page *page;
+ DECLARE_BITMAP(access_bitmap, AGGR_BITMAP_SIZE);
+} aggr_node_t;
+
+typedef struct population_node {
+ //bitmap for tracking spatial utilization of 2MB region.
+ DECLARE_BITMAP(popl_bitmap, 512);
+ u8 committed;
+} popl_node_t;
+
+void *osa_popl_node_lookup(struct mm_struct *mm,
+ unsigned long address);
+int osa_popl_node_insert(struct mm_struct *mm,
+ unsigned long address,
+ popl_node_t *node);
+void *osa_popl_node_delete(struct mm_struct *mm,
+ unsigned long address);
+
+extern spinlock_t osa_poplmap_lock;
+
+popl_node_t *osa_poplmap_node_alloc(void);
+void osa_poplmap_node_free(popl_node_t *node);
+
+int osa_util_node_insert(struct mm_struct *mm,
+ unsigned long address,
+ util_node_t *node);
+void *osa_util_node_delete(struct mm_struct *mm,
+ unsigned long address);
+void *osa_util_node_lookup(struct mm_struct *mm,
+ unsigned long address);
+void osa_clear_poplmap_range(struct mm_struct *mm,
+ unsigned long start, unsigned long end);
+void frequency_update(util_node_t *node);
+
+unsigned long osa_get_hpage_count(struct mm_struct *mm);
+void osa_hpage_enter_list(struct mm_struct *mm);
+void osa_hpage_exit_list(struct mm_struct *mm);
+
+extern long madvise_vma(struct vm_area_struct *vma,
+ struct vm_area_struct **prev,
+ unsigned long start, unsigned long end, int behavior);
+
+int is_member_of_scan_list(struct mm_struct *mm);
+unsigned int osa_compute_fairness_metric(struct mm_struct *mm);
+
+#define MAX_WORKLIST_SIZE 513
+extern struct list_head hugepage_worklist;
+
+typedef struct work_node {
+ struct list_head list;
+ struct mm_struct *mm;
+ unsigned long address;
+} work_node_t;
+
+work_node_t *osa_work_node_alloc(void);
+void osa_work_node_free(work_node_t *node);
+
+extern spinlock_t worklist_lock;
+
+extern wait_queue_head_t osa_hpage_scand_wait;
+extern wait_queue_head_t osa_aggregationd_wait;
+extern int osa_inst_get_page_owner(struct page *page, int references);
+
+#endif
diff -urN '--exclude=.git*' '--exclude=*.config*' '--exclude=tag*' '--exclude=*cscope*' '--exclude=*.o' '--exclude=tools*' '--exclude=Documentation*' '--exclude=*vmlinux.scr*' '--exclude=*.tmp' linux-4.3-org/include/trace/events/vmscan.h linux-4.3-osa/include/trace/events/vmscan.h
--- linux-4.3-org/include/trace/events/vmscan.h 2015-11-01 18:05:25.000000000 -0600
+++ linux-4.3-osa/include/trace/events/vmscan.h 2016-03-04 19:57:46.185958889 -0600
@@ -384,6 +384,233 @@
show_reclaim_flags(__entry->reclaim_flags))
);
+TRACE_EVENT(mm_vmscan_lru_reclaim_stat,
+
+ TP_PROTO(int flag, int zone_idx, unsigned long nr_reclaimed, unsigned long anon_lru_size,
+ unsigned long file_lru_size, struct zone_reclaim_stat reclaim_stat),
+
+ TP_ARGS(flag, zone_idx, nr_reclaimed, anon_lru_size, file_lru_size, reclaim_stat),
+
+ TP_STRUCT__entry(
+ __field(int, flag)
+ __field(int, zone_idx)
+ __field(unsigned long, nr_reclaimed)
+ __field(unsigned long, anon_lru_size)
+ __field(unsigned long, file_lru_size)
+ __field(unsigned long, anon_nr_scanned)
+ __field(unsigned long, anon_nr_rotated)
+ __field(unsigned long, file_nr_scanned)
+ __field(unsigned long, file_nr_rotated)
+ ),
+
+ TP_fast_assign(
+ __entry->flag = flag;
+ __entry->zone_idx = zone_idx;
+ __entry->nr_reclaimed = nr_reclaimed;
+ __entry->anon_lru_size = anon_lru_size;
+ __entry->file_lru_size = file_lru_size;
+ __entry->anon_nr_scanned = reclaim_stat.recent_scanned[0];
+ __entry->anon_nr_rotated = reclaim_stat.recent_rotated[0];
+ __entry->file_nr_scanned = reclaim_stat.recent_scanned[1];
+ __entry->file_nr_rotated = reclaim_stat.recent_rotated[1];
+ ),
+
+ TP_printk("flag %d zone %d nr_reclaimed %lu anon lru_size %lu nr_scanned %lu nr_rotated %lu "
+ "file lru_size %lu nr_scanned %lu nr_rotated %lu",
+ __entry->flag,
+ __entry->zone_idx,
+ __entry->nr_reclaimed,
+ __entry->anon_lru_size,
+ __entry->anon_nr_scanned, __entry->anon_nr_rotated,
+ __entry->file_lru_size,
+ __entry->file_nr_scanned, __entry->file_nr_rotated
+ )
+);
+
+TRACE_EVENT(mm_vmscan_reclaim_stat,
+
+ TP_PROTO(int flag, unsigned long nr_scanned, unsigned long nr_reclaimed),
+
+ TP_ARGS(flag, nr_scanned, nr_reclaimed),
+
+ TP_STRUCT__entry(
+ __field(int, flag)
+ __field(unsigned long, nr_scanned)
+ __field(unsigned long, nr_reclaimed)
+ ),
+
+ TP_fast_assign(
+ __entry->flag = flag;
+ __entry->nr_scanned = nr_scanned;
+ __entry->nr_reclaimed = nr_reclaimed;
+ ),
+
+ TP_printk("flag %d nr_scanned %lu nr_reclaimed %lu",
+ __entry->flag,
+ __entry->nr_scanned,
+ __entry->nr_reclaimed
+ )