Commit graph

873,075 commits

Author SHA1 Message Date
qctecmdr
f8479eca07 Merge "net: qrtr: Add IPC logging for qrtr" 2019-10-25 04:44:31 -07:00
qctecmdr
039c7ea65a Merge "msm: IPA: mhi_proxy: correct the mhi vote for both bus and device" 2019-10-25 03:24:32 -07:00
qctecmdr
f4de4c753b Merge "mm: vmscan: support complete shrinker reclaim" 2019-10-25 02:45:51 -07:00
qctecmdr
6500d721cf Merge "mm: run the showmem notifier in alloc failure" 2019-10-25 02:00:47 -07:00
qctecmdr
1a805820af Merge "mm, oom: run the showmem notifier in oom" 2019-10-25 01:05:34 -07:00
qctecmdr
7cadb9f2ea Merge "mm: cma: retry only on EBUSY" 2019-10-25 00:25:58 -07:00
qctecmdr
b95c1d307e Merge "mm: cma: Increase retries if less blocks available" 2019-10-24 23:39:33 -07:00
qctecmdr
6324083247 Merge "mm: cma: Register with show_mem notification framework" 2019-10-24 22:55:53 -07:00
Banajit Goswami
c5cd69e267 msm: qdsp6v2: Add timestamp support for compress capture
Add timestamp support for compress driver.

CRs-fixed: 1072067
Change-Id: I1c46befc223285495b3c0650e6c3eaae81f58771
Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2019-10-25 13:38:24 +08:00
qctecmdr
95c1375460 Merge "mm: cma: add trace events for CMA alloc perf testing" 2019-10-24 22:12:28 -07:00
qctecmdr
92902fc9d0 Merge "mm: vmscan: support equal reclaim for anon and file pages" 2019-10-24 21:33:01 -07:00
qctecmdr
52fabc3455 Merge "iommu/io-pgtable: Deprecate IO_PGTABLE_QUIRK_NO_DMA" 2019-10-24 20:49:18 -07:00
Lina Iyer
d7e609a4d7 drivers: cpuidle: lpm-levels-of: conform to arm,idle-state definition
Start confirming to arm,idle-state compatible definition. In addition to
being compliant, this allows us to use the new API to setup the PSCI
cluster state ids for the CPU, before entering the idle state.

Let's do the following:
    - Rename enter/exit latency, residency, label properties
    - In addition to qcom,psci-cpu-mode specify
      arm,psci-suspend-param.
    - Update copyright

Change-Id: I3930fce9788e8be1e43e0e7c9ff247df2ec23f55
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
2019-10-24 20:37:04 -07:00
Lina Iyer
6d5e000248 drivers: soc: qcom: snapshot of sleep drivers for Lahaina
This is a snapshot of the Sleep driver and related functionality as of
'commit b252df6e0200 ("cpuidle: lpm-levels: log enabled regulators
before entering suspend")' on msm-4.19 branch.

Updates:
        - Remove event timers
        - Remove per-cpu PM QoS
        - Remove rpm stats (Use new soc_sleep_stats driver instead)
        - Update __arch_counter_get_cntvct (new)
        - Update to get next wakeup from cpuidle device
	- Remove pending_ipi and is_IPI_pending() (defined in smp.c)
	- Update copyright
	- Update Kconfig menu items
	- Update hotplug enum to use the already upstreamed
	- ifdef's around scheduler functions that are not upstreamed

Change-Id: I75336ec927932d93c0c193a20973fc84e3b05ff5
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
2019-10-24 20:36:57 -07:00
qctecmdr
5de94c187b Merge "mm: cma: sleep between retries in cma_alloc" 2019-10-24 20:07:50 -07:00
qctecmdr
52c2866900 Merge "msm: ipa: Add IPA producer and consumer clients for AQC" 2019-10-24 19:26:46 -07:00
qctecmdr
0dbf8da3bc Merge "icc: qcom: Refactor icc rpmh support" 2019-10-24 18:49:24 -07:00
Isaac J. Manjarres
ca80ea7348 ion: msm: Remove dentry_path() usage on heap debugfs file creation errors
Knowing the path of which heap stats debugfs file was not
created is not any more useful than simply knowing that
the heap stats debugfs file could not be created for a
specific heap. Thus, only print the name of the heap and
debugfs file that could not be created.

Change-Id: I177a49cdb5117996971cae626d65ef9cb75c83d8
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 18:27:50 -07:00
qctecmdr
498f4708ad Merge "iommu/arm-smmu: Use existing facilities for I/O Coherent PTWs" 2019-10-24 17:59:46 -07:00
qctecmdr
630194ff78 Merge "pinctrl: qcom: lahaina: add GPIO wakeup interrupt map" 2019-10-24 17:22:06 -07:00
qctecmdr
b8a219dfca Merge "mm: swap: free up swap on mm reap" 2019-10-24 16:42:58 -07:00
Sumukh Hallymysore Ravindra
1250336256 synx: Add synx cancel signaling status
Add cancel signaling status for the synx object. This
can be used by the clients to signal cancellation to
other clients waiting on the synx object and helps
distinguish from any error occurred during signaling.

Change-Id: Idba21d364c2306ef65d53ae6728da8a49131605d
Signed-off-by: Sumukh Hallymysore Ravindra <shallymy@codeaurora.org>
2019-10-24 16:40:23 -07:00
Liangliang Lu
ad2d551ece usb: gadget: Add check gadget function bind or not
For NCM gadget function, net device structure opts->net
will be freed when NCM unbind, but user space related
device node doesn't know it, will access net structre
without checking it exist or not, leading to potential
use-after-free.

Fix this by adding check gadget function bind or not.

Change-Id: I6af9e3868f71e7fa923600721e1f716508de9b55
Signed-off-by: Liangliang Lu <luliang@codeaurora.org>
2019-10-24 16:34:09 -07:00
Chris Goldsworthy
377007c976 iommu/arm-smmu: bypass hypervisor and read sync/inval status register
ARM_SMMU_STATS_SYNC_INV_TBU_ACK has been made accessible to HLOS 1, read
it's value directly instead of making an SCM call to retrieve it.

Change-Id: I34f5d18e9a5bdee6857f2398974257a49b1f54fb
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
2019-10-24 16:10:32 -07:00
qctecmdr
192ae22b3a Merge "pinctrl: qcom: setup GPIO chip in hierarchy" 2019-10-24 16:03:16 -07:00
qctecmdr
ea48d885f6 Merge "usb: gadget: f_ncm: allocate/free net device upon driver bind/unbind" 2019-10-24 15:24:01 -07:00
Jack Pham
6920889361 usb: dwc3: gadget: Keep track of IRQ timing statistics
It may be useful to debug how much time is spent in the
DWC3 hard IRQ context. Add low-overhead statistics counters
which keep a histogram of the last 10 interrupts' time of
occurrence, time spent, and number of events read (which will
get processed in the bottom half handler).

Change-Id: I466144d8141f4236b9fb834dded93225b56d0422
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-24 15:04:18 -07:00
Jack Pham
82dc6471a5 usb: dwc3: Keep track of interrupt statistics
This change adds debug support to log all received different
events with endpoint0, other endpoints and gadget events. It
tracks these events per endpoint and displays the same.

For each of the endpoint event counters, add the rate (in Hz)
at which it occurs in order to better analyze performance and
aid in optimization.

How to use:
  - Mount debugfs
  - To see received all dwc3 events/interrupts
	cat /sys/kernel/debug/<base_address>.dwc3/int_events
  - To clear all received dwc3 events/interrupts
	echo 0 > /sys/kernel/debug/<base_address>.dwc3/int_events

Change-Id: Ibf5f3ee57f69c87f94f55a58f50792075be24fbb
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-24 14:59:18 -07:00
Mayank Rana
adb9732230 usb: dwc3: debug: Add logging APIs using IPC logging framework
This change creates separate debug buffer with each DWC instance and
provides debug API to log different important events using IPC
logging framework.

CRs-Fixed: 1040809
Change-Id: I9aee21a99f5bcd0e82e81092c05bc2238863f5e4
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
[jackp@codeaurora: since debug.c is gone, added debug_ipc.c]
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-24 14:56:48 -07:00
Mayank Rana
041aaac1fe usb: xhci-plat: Add DT parameter to program xhci imod_interval
XHCI allows interrupt moderation using imod_interval at 250ns
increments. Add DT parameter to specify this imod_value for
targets mainly with single CPU to reduce CPU interrupt loads.
This allows better balance between CPU usage and performance.

CRs-fixed: 1019219
Change-Id: Id479c162da6492caff4dd83de4054fee63b6abc5
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-24 14:56:47 -07:00
Hemant Kumar
15d5e755c0 usb: dwc3: Increase the inter packet gap for USB 2.0
Default 0 value for IP_GAP_ADD_ON field of DWC3_GUCTL1
register is causing failure of EL_23 test. This value
corresponds to inter-packet gap of 182.163 ns. Increase
the value to 1 which corresponds to 199.794 ns. This
improves margin required to pass the test.

Change-Id: Iabc71a746ac90251eaec25597d8506df416796a5
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-24 14:56:47 -07:00
qctecmdr
a82524f12a Merge "msm: ADSPRPC: Fix buffer length for capability API" 2019-10-24 11:15:20 -07:00
Chris Lew
124913d596 net: qrtr: Fix wakeup_source_register
There was an update to add a device parameter into
wakeup_source_register().

Fixes: c8377adfa7 ("PM / wakeup: Show wakeup sources stats in sysfs")
Change-Id: I2c17f4c8c80cfb16d85da0ff268e5a75e2d0bcad
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-24 11:01:25 -07:00
Arun Kumar Neelakantam
4ff747d59b net: qrtr: Add IPC logging for qrtr
Add IPC logging support for Qrouter driver.

CRs-Fixed: 2276870
Change-Id: I464ca6443cc442c8ff7441adeccd6490123b72d9
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2019-10-24 11:01:25 -07:00
qctecmdr
2417960976 Merge "msm: ipa4: Fix to increase coaleascing common event ring size" 2019-10-24 10:45:33 -07:00
David Dai
c801b05e92 interconnect: qcom: lahaina: Remove stub functions
Switch over to functional interconnect drivers.

Change-Id: I20191b6016839fffac1bf5f4f9f1132d956daf24
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2019-10-24 10:41:22 -07:00
David Dai
f54d2cfe75 interconnect: qcom: fix up endianness for rpmh messages
Fix up le32 and le16 to int errors when converting from
le types to cpu.

Change-Id: I45b267195210a6ec4f2a4175eddcc541ec081043
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2019-10-24 10:41:17 -07:00
David Dai
342ec64e3b icc: qcom: Refactor icc rpmh support
Add bcm voter driver and add support for RPMh specific interconnect
providers so that they may be re-used for icc-next RPMh based provider
drivers.

Change-Id: I6b0db857ed0724dec0386a9961b3a0b8e676efbd
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2019-10-24 10:41:11 -07:00
Chris Goldsworthy
f60812099e iommu/arm-smmu: report BID, PID and MID of client on context fault
Aid debugging by reporting the BID, PID and MID of a transaction during a
context fault, in order to identify the master that initiated the fautling
transaction.

Change-Id: I2bed2b472a754f13bf85e3b576f0bf079d9d5541
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
2019-10-24 10:25:48 -07:00
Liam Mark
485b41f036 mm: cma: add trace events for CMA alloc perf testing
Add cma and migrate trace events to enable CMA allocation
performance to be measured via ftrace.

Change-Id: I1e471e9e21f1a14ce2ed167d8515ccb5f83eb88c
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 10:22:40 -07:00
Liam Mark
1b45604c21 mm: vmscan: support complete shrinker reclaim
Ensure that shrinkers are given the option to completely drop
their caches even when their caches are smaller than the batch size.

This change helps improve memory headroom by ensuring that under
significant memory pressure shrinkers can drop all of their caches.

This change only attempts to more aggressively call the shrinkers
during background memory reclaim, inorder to avoid hurting the
perforamnce of direct memory reclaim.

Change-Id: I8dbc29c054add639e4810e36fd2c8a063e5c52f3
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 10:22:26 -07:00
Patrick Daly
1839defde4 mm: vmscan: support equal reclaim for anon and file pages
When performing memory reclaim support treating anonymous and
file backed pages equally.

Swapping anonymous pages out to memory can be efficient enough
to justify treating anonymous and file backed pages equally.

CRs-Fixed: 648984
Change-Id: I6315b8557020d1e27a34225bb9cefbef1fb43266
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
[swatsrid@codeaurora.org: Fix trivial merge conflicts]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: Fix trivial merge conflicts]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 10:22:10 -07:00
Isaac J. Manjarres
7e0f90febe arm64: defconfig: Enable CONFIG_VM_EVENT_COUNTERS on Lahaina
Enable CONFIG_VM_EVENT_COUNTERS on Lahaina to display
VM statistics and information.

Change-Id: I4aad05fe089704026885ca01bafff5dcdbc09a87
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 10:21:50 -07:00
Prakash Gupta
8d8eacdb48 mm: run the showmem notifier in alloc failure
When the page allocation fails, it's useful to
be able to see the state of unaccounted memory in the system. Call the
showmem notifier to get other clients to dump out their state.

This is an example output with this patch.

  [  457.125478] SLUB: Unable to allocate memory on node -1, gfp=0x2008000(GFP_NOWAIT|__GFP_ZERO)
  [  457.133982]   cache: kmalloc-128, object size: 128, buffer size: 640, default order: 2, min order: 0
  [  457.143179]   node 0: slabs: 5903, objs: 132755, free: 26
  [  457.906076] BootAnimation: page allocation failure: order:0, mode:0x2204000(GFP_NOWAIT|__GFP_COMP|__GFP_NOTRACK)
  [  457.916395] CPU: 2 PID: 4752 Comm: BootAnimation Not tainted 4.9.37+ #43
  [  457.916398] Hardware name: Qualcomm Technologies, Inc. SDM845 v1 MTP (DT)
  [  457.916402] Call trace:
  [  457.916420] [<ffffff82c5c89504>] dump_backtrace+0x0/0x2c4
  [  457.916426] [<ffffff82c5c897e8>] show_stack+0x20/0x28
  [  457.916434] [<ffffff82c5fea888>] dump_stack+0xb8/0xf4
  [  457.916442] [<ffffff82c5dd136c>] warn_alloc+0x154/0x170
  [  457.916447] [<ffffff82c5dd184c>] __alloc_pages_nodemask+0x430/0xcdc
  [  457.916454] [<ffffff82c5e1c154>] new_slab+0x344/0x430
  [  457.916458] [<ffffff82c5e1e404>] ___slab_alloc.constprop.72+0x2f4/0x398
  [  457.916463] [<ffffff82c5e1e4f0>] __slab_alloc.isra.69.constprop.71+0x48/0x80
  [  457.916467] [<ffffff82c5e1ea24>] kmem_cache_alloc_trace+0x210/0x2dc
  [  457.916476] [<ffffff82c68ebf0c>] binder_transaction+0x280/0x2008
  [  457.916480] [<ffffff82c68ee68c>] binder_thread_write+0x9f8/0x136c
  [  457.916484] [<ffffff82c68f08d0>] binder_ioctl_write_read+0x14c/0x3b0
  [  457.916488] [<ffffff82c68f0df0>] binder_ioctl+0x2bc/0x868
  [  457.916494] [<ffffff82c5e451e4>] do_vfs_ioctl+0xd0/0x858
  [  457.916498] [<ffffff82c5e459fc>] SyS_ioctl+0x90/0xa4
  [  457.916503] [<ffffff82c5c83770>] el0_svc_naked+0x24/0x28
  [  457.916505] Mem-Info:
  [  457.916515] active_anon:83629 inactive_anon:212 isolated_anon:0\x0a active_file:5955 inactive_file:5745 isolated_file:0\x0a unevictable:630956 dirty:0 writeback:0 unstable:0\x0a slab_recl
  aimable:16602 slab_unreclaimable:69384\x0a mapped:3609 shmem:308 pagetables:5737 bounce:0\x0a free:4446 free_pcp:482 free_cma:112
  [  457.916524] Node 0 active_anon:334516kB inactive_anon:848kB active_file:23820kB inactive_file:22980kB unevictable:2523824kB isolated(anon):0kB isolated(file):0kB mapped:14436kB dirty:0kB
  writeback:0kB shmem:1232kB writeback_tmp:0kB unstable:0kB pages_scanned:0 all_unreclaimable? no
  [  457.916534] DMA free:12516kB min:3352kB low:4924kB high:6496kB active_anon:45336kB inactive_anon:64kB active_file:3588kB inactive_file:3404kB unevictable:1564224kB writepending:0kB presen
  t:1854120kB managed:1748064kB mlocked:1564224kB slab_reclaimable:10664kB slab_unreclaimable:24400kB kernel_stack:2608kB pagetables:6376kB bounce:0kB free_pcp:572kB local_pcp:0kB free_cma:448
  kB
  [  457.916536] lowmem_reserve[]: 0 1901 1901
  [  457.916550] Normal free:5268kB min:4148kB low:6092kB high:8036kB active_anon:289180kB inactive_anon:784kB active_file:20232kB inactive_file:19576kB unevictable:959600kB writepending:0kB p
  resent:2068224kB managed:1984196kB mlocked:959600kB slab_reclaimable:55744kB slab_unreclaimable:253136kB kernel_stack:19232kB pagetables:16572kB bounce:0kB free_pcp:1356kB local_pcp:116kB fr
  ee_cma:0kB
  [  457.916552] lowmem_reserve[]: 0 0 0
  [  457.916560] DMA: 819*4kB (UMEC) 280*8kB (UMEC) 224*16kB (UME) 98*32kB (UME) 6*64kB (UME) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 12620kB
  [  457.916594] Normal: 1118*4kB (UMEH) 38*8kB (UMH) 1*16kB (H) 2*32kB (H) 1*64kB (H) 1*128kB (H) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 5048kB
  [  457.916627] 12071 total pagecache pages
  [  457.916630] 0 pages in swap cache
  [  457.916633] Swap cache stats: add 0, delete 0, find 0/0
  [  457.916634] Free swap  = 0kB
  [  457.916636] Total swap = 0kB
  [  457.916639] 980586 pages RAM
  [  457.916641] 0 pages HighMem/MovableOnly
  [  457.916643] 47521 pages reserved
  [  457.916645] 51200 pages cma reserved
  [  457.916651] cma: cma-0 pages: => 0 used of 2048 total pages
  [  457.916660] cma: cma-1 pages: => 0 used of 23552 total pages
  [  457.916665] cma: cma-2 pages: => 1695 used of 3072 total pages
  [  457.916670] cma: cma-3 pages: => 8277 used of 9216 total pages
  [  457.916674] cma: cma-4 pages: => 186 used of 5120 total pages
  [  457.916679] cma: cma-5 pages: => 3792 used of 8192 total pages
  [  457.916685]        Heap name  Total heap size Total orphaned size
  [  457.916687] ---------------------------------
  [  457.916691]           qsecom 0x           ba000 0x               0
  [  457.916694]           system 0x         44db000 0x          500000
  [  457.916705] -------------------------------------------------
  [  457.916708] uncached pool = 31027200 cached pool = 0 secure pool = 0
  [  457.916710] pool total (uncached + cached + secure) = 31027200
  [  457.916712] -------------------------------------------------
  [  457.916715]             adsp 0x          614000 0x               0
  [  457.916720]             spss 0x               0 0x               0
  [  457.916725]   secure_display 0x               0 0x               0
  [  457.916727]      secure_heap 0x               0 0x               0.

Change-Id: Id01cce4abf331ff9c1c7ab9f0c0f9b1fc4146467
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 10:21:16 -07:00
Prakash Gupta
e270acd222 mm, oom: run the showmem notifier in oom
When the oom starts killing processes, it's useful to
be able to see the state of unaccounted memory in the system. Call the
showmem notifier to get other clients to dump out their state.

Change-Id: Id32ff6d6747fee7d0889447323ddce25282e93f6
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
[swatsrid@codeaurora.org: Fix trivial errors and merge conflicts]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: Fix trivial merge conflicts]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 10:21:12 -07:00
Vinayak Menon
54261b6432 mm: cma: retry only on EBUSY
Retry the cma alloc only when alloc_contig_range returns
-EBUSY. This avoids unnecessary retries when the heap is
full.

Change-Id: If4626f0a0bc14e4b3a500283eb5a4c33b78fb6f2
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2019-10-24 10:21:09 -07:00
Shiraz Hashim
5a883fb75e mm: cma: Increase retries if less blocks available
If a particular cma region has lesser free blocks then
increase retries to avoid allocation failure due to page
being temporarily busy.

Change-Id: I92021fd75315b266a978f7a5b0235344c800cba2
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2019-10-24 10:21:05 -07:00
Prakash Gupta
6135095109 mm: cma: Register with show_mem notification framework
Register with the show_mem notification framework
to let cma dump out data for debugging.

This is an example output with this patch.

 cma: cma-0 pages: => 0 used of 2048 total pages
 cma: cma-1 pages: => 0 used of 23552 total pages
 cma: cma-2 pages: => 1696 used of 3072 total pages
 cma: cma-3 pages: => 8277 used of 9216 total pages
 cma: cma-4 pages: => 186 used of 5120 total pages
 cma: cma-5 pages: => 3792 used of 8192 total pages.

Change-Id: I80d9291444fd9361f5586bdf60373ed8b5b41705
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
[<swatsrid@codeaurora.org: Fix trivial errors in commit text]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: Fix trivial merge conflicts]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 10:21:02 -07:00
Liam Mark
8ffd0015dd mm: cma: sleep between retries in cma_alloc
Port support from 3.10 for retrying cma allocations
to 3.18 to help resolve cma allocation failures.

It was observed that CMA pages are sometimes getting
pinned down by BG processes scheduled out in their exit
path. Since BG processes have lower priority they end up
getting less time slice by scheduler there by consuming
more time to free up CMA pages.

Also when a process is being forked copy_one_pte
may create copy-on-write mappings, when this is done
the page _count and page _mapcount are each
incremented sequentially. If the process is context
switched out after incrementing the _count but before
incrementing the _mapcount then the page will appear
temporarily pinned.

So instead of failing to allocate and directly
returning an error on the CMA allocation path we do 2
retries, with sleeps, to give the system an opportunity
to unpin any pinned pages.

Change-Id: I022a9341f8ee44f281c7cb34769695843e97d684
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
[isaacm@codeaurora.org: resolve merge conflicts]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 10:20:59 -07:00
Vinayak Menon
3a4b07aef2 mm: swap: free up swap on mm reap
With the swap slots feature, the freeing up of swap space
during the mm reap (kill or oom reap for e.g.) is delayed
till a threshold is reached. This is done mainly to reduce
the fragmentation of swap space. The caching is done per
cpu. But with zram, this causes zram space consumed not
being free up immediately on task kill or oom reap. Since
we don't use THP swap, fragmentation is not a concern. So
free up the slots without caching when the swap device is
a synchronous one. Note that this does not disable the swap
slots feature which can take into effect during swap slots
allocation.

Change-Id: I9985edfdd88723d38ae905496556e07fb8bf09af
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
[swatsrid@codeaurora.org: Fix merge conflicts]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-24 10:18:21 -07:00