Commit graph

569633 commits

Author SHA1 Message Date
Satya Durga Srinivasu Prabhala
3bf4100be3 Revert "kernel: lib: allow larger stack frame size for KASan"
This reverts commit 8bb334401c
("kernel: lib: allow larger stack frame size for KASan").

Stack frame size set to 5600 to fix compilation error/s if
KASAN enabled by the commit 8bb334401c ("kernel: lib: allow
larger stack frame size for KASan") in 3.18 Kernel and same
commit got pulled into Kernel 4.4, which replaced stack
frame size 0 with 5600 as part of resolution of merge conflict.
But, by setting stack frame size to 0 will ignore stack frame
size warnings and so the compilation errors. So, revert commit
to fix below error while compiling Kernel 4.4 with KASAN enabled
and GCC 5.1 compiler.

kernel/net/wireless/nl80211.c: In function 'nl80211_send_wiphy':
kernel/net/wireless/nl80211.c:1745:1: warning: the frame size of \
5760 bytes is larger than 5600 bytes [-Wframe-larger-than=]
error, forbidden warning: nl80211.c:1745
make[4]: *** [net/wireless/nl80211.o] Error 1

CRs-Fixed: 1004225
Change-Id: I97e52302197c9933bec5cac3ebdc4ec73fee0816
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-04-22 11:57:43 -07:00
Andrey Markovytch
b4f695428f crypto: ice: general driver clean-up
* Removed spinlock as it was not locking against anything
* Removed conversion of interrupt status to error number
  as it is not used by API client, and in case several bits are
  set only 1 error is ever handled and the rest get lost.
  Instead pass to the client the complete status.
* Removed redundant includes, variables
* vops structure is returned after performing a lookup in the DTS.
  There's no need for that as we already know the structure
  to return.
* Other minor corrections

Change-Id: I6d2549ce04c9e4b19fdd8fe3dfee03d83bfd9d77
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2016-04-22 11:57:42 -07:00
Sudheer Papothi
61762e2339 irqchip: msm: Remove wcd codec irq domain register from irq driver
wcd codec irq domain register is done in wcd irq probe function.
So, remove wcd codec irq chip declaration from irq msm driver.

Change-Id: Ie4f8dbb39925fde3cf3fa7f55a555d80110cc639
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-04-22 11:57:41 -07:00
Sudheer Papothi
b9990820a6 drivers: mfd: Allocate and register irq domain for codec interrupts
During codec interrupt controller probe, allocate and register
irq domain for codec interrupts for mapping between hwirq and
irq numbers.

Change-Id: I3e32043499f2b1e2616cf74864969815e626a23b
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-04-22 11:57:40 -07:00
Chinmay Sawarkar
078e42ca28 ARM: dts: msm: Add Venus regulators & clocks for msmcobalt
These regulators and clocks are required for
Venus bootup and decode session.

Change-Id: I2a57b125ea8982ac8e63bbbb3c7f4d41c106edc5
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2016-04-22 11:57:40 -07:00
David Collins
187749c0d9 ARM: dts: msm: remove S3, S5, and S7 regulator pin control on msmcobalt
PMCOBALT regulators S3, S5, and S7 do not support mode pin
control requests.  Therefore, remove the pin control
configurations for these regulators.

Change-Id: I35c726ac45adc677ffe3a15c34229188efa4bc90
CRs-Fixed: 1004290
Signed-off-by: David Collins <collinsd@codeaurora.org>
2016-04-22 11:57:39 -07:00
Runmin Wang
586ef10010 tty : msm_serial: Remove the rtb logs of msm_serial write and read.
msm_write/read use write/read_relaxed function which will create
lots of RTB logging. Change the API to no_log version to remove
those RTB logs.

CRs-Fixed: 1004316
Change-Id: Ica921ffe3dfc362b70e78232ee680b82c205a477
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2016-04-20 21:06:53 -07:00
Devesh Jhunjhunwala
baa8ac7b81 clk: Update clk_get_sys to return ENOENT on failure
clk_get_sys was updated to return EPROBE_DEFER because on the
older kernel returning ENOENT was causing drivers that probed
before the clock provider to fail instead of deferring. The new
kernel version fixes this by returning EPROBE_DEFER in
__of_clk_get_from_provider. Thus, clk_get_sys failing means that
the clock provider exists, but the requested clock is not defined
in the provider, in which case ENOENT is a more appropriate error
code to return.

Change-Id: I67d60bf5c0d2dfb71a189e351bc5b4c535d280bb
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2016-04-20 21:06:53 -07:00
Deepak Katragadda
60fcb53abb clk: msm: clock-gcc-cobalt: Add support for measuring some gpu clocks
Add HW clock measurement support for the gcc_gpu_cfg_ahb_clk,
gcc_gpu_bimc_gfx_src_clk and gcc_gpu_bimc_gfx_clk clocks.

CRs-Fixed: 1003179
Change-Id: Id403238f612a277973cd06f7d1d6f656a1812bba
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
2016-04-19 19:43:59 -07:00
David Keitel
bc5bd3bf0c soc: qcom: service-notifier: update state after queuing notification
On establishing a connection with the remote service and being notified
of a service's current state for the first time, first queue the service
notification for the new state. Only then, update the current state of
the service notifier.

Also, to prevent a premature update of the service notifier state,
remove the state update from send_notif_listener_msg_req.

CRs-Fixed: 999530
Change-Id: I43288b1ae23081721a9baef5a5098891afd8ff64
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2016-04-19 19:43:59 -07:00
Pushkar Joshi
77837f8008 soc: qcom: Add infrastructure to test service notifier
Add debugfs node based mechanism to test the service notifier
driver functionality.

CRs-Fixed: 999530
Change-Id: I9dc7a6f0f51c57da7f783c7c60aae9018462079e
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
2016-04-19 19:43:58 -07:00
Pushkar Joshi
00e3b9ccb0 soc: qcom: Export Service notifier driver APIs
Export the service notifier APIs so that other kernel
clients can use them.

CRs-Fixed: 999530
Change-Id: I48fd55ae7991b64f818543dfcc963bc75135f714
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
2016-04-19 19:43:57 -07:00
Imran Khan
83842ac1d6 lib: do_strncpy_from_user: Fix return error code for get_user failures
If byte wise copy fails here, we should return EFAULT. Returning a value
other than that would cause failure of some of the user-space test cases.

CRs-Fixed: 989314
Change-Id: I38ce12d44f25dc89bdd29e8abacd8777f0a8b9a1
Signed-off-by: Imran Khan <kimran@codeaurora.org>
2016-04-19 19:43:56 -07:00
Oleg Perelet
5daf1be1ad ARM: dts: msm8998: Change GPU frequencies for new clock plan
Change GPU frequencies in dtsi tables to match clock plan.

CRs-Fixed: 973565
Change-Id: Iae431f74d533a0b4a60bb38b46bcb6a7c717ac3b
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2016-04-19 19:43:56 -07:00
Skylar Chang
7215c30af8 msm: ipa: add support for DOMAIN_ATTR_S1_BYPASS
In order to set SMMU to S1 bypass configuration
IPA driver needs to set DOMAIN_ATTR_S1_BYPASS before
attaching to SMMU. The actual SMMU setting is controlled
via device tree.

CRs-Fixed: 998074
Change-Id: I3e63d9e6c511dd692b299543881e7266799108af
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-04-19 19:43:55 -07:00
Skylar Chang
6ff62f5f51 msm: ipa3: enable smart prefetch control for GPI
Enable smart prefetch control for GPI (sys) channels.
This is done by configuring the channel scratch in GSI.

CRs-Fixed: 1000819
Change-Id: Iac1687b9b26eed715a1055cca295daa7b46f8abd
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-04-19 19:43:54 -07:00
Skylar Chang
fe52a162c9 msm: gsi: update channel scratch structures
Update channel scratch data structure according
to GSI ver 83.

CRs-Fixed: 1000819
Change-Id: I428963f9cd7885015e5185ef6c666bf26e0851bb
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-04-19 19:43:53 -07:00
Aravind Venkateswaran
811bda58c5 ARM: dts: msm: add pinctrl setting for DSI reset and TE GPIOs for msmcobalt
Add active and sleep sets for the DSI reset GPIO, panel mode
selection GPIO  and the TE (tear check) GPIO which are needed to
enable display on the DSI interface.

CRs-Fixed: 1000724
Change-Id: I290e4813d74a392aa1e715e1ae181853a711523d
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-04-19 18:10:31 -07:00
Abhijit Kulkarni
ec34ccc86d ARM: dts: msm: add QSEED3 offsets to MDSS for msmcobalt
Change adds offsets of source and destination QSEED3
and LUT to mdss device tree which is required for
QSEED3 functionality.

CRs-fixed: 1000739
Change-Id: I838a39e799736b7c0297f993c8a96d982ab31d2f
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2016-04-19 18:10:17 -07:00
Abhijit Kulkarni
c6d31e7176 ARM: dts: msm: add mdss device tree for msmcobalt
Change adds mdss device tree for msmcobalt which
provides mdss HW offsets for this chipset.

CRs-fixed: 1000739
Change-Id: Ibb12e0179a66e89ca675f4ae35fc2f77c050da2c
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2016-04-19 18:10:04 -07:00
Aravind Venkateswaran
a402fc692c msm: mdss: add missing documentation for WB device node
Commit be23185307 ("Merge branch
'mdss-final-replay' into msm-4.4") resulted in the driver changes related
to writeback sub node being merged without the documentation for the
bindings associated with that device node. Add the missing binding
documentation.

Change-Id: Id2affddf055a6bbf0038958bcdb7abd6d7930509
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-04-19 18:09:50 -07:00
Runmin Wang
b001afe7ef ARM: dts: msm: Add uartblsp node in msmcobalt cdp and mtp
Add uartblsp node in msmcobalt cdp and mtp.

CRs-Fixed: 1000637
Change-Id: I1605e68893a73f364f044c046e65b563e666bcd4
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2016-04-19 11:58:26 -07:00
Jack Pham
c230635f78 regmap: spmi: Fix regmap_spmi_ext_read in multi-byte case
Specifically for the case of reads that use the Extended Register
Read Long command, a multi-byte read operation is broken up into
8-byte chunks.  However the call to spmi_ext_register_readl() is
incorrectly passing 'val_size', which if greater than 8 will
always fail.  The argument should instead be 'len'.

CRs-Fixed: 1002440
Change-Id: I2eb9f1e11f97cf7eeee4314616bc5d06443c8920
Fixes: c9afbb05a9 ("regmap: spmi: support base and extended register spaces")
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-04-18 17:30:06 -07:00
Runmin Wang
2236a704a5 defconfig: msm: enable GIC_V3_ACL access control
Add support to enable GIC_V3_ACL.

CRs-Fixed: 996399
Change-Id: I843c9a3e56b567a3e7bada1833bbee66fff60892
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2016-04-18 17:26:50 -07:00
Runmin Wang
1479362d86 defconfig: msmcobalt: Enable gladiator error reporting v2
Enable gladiator error reporting driver v2 to detect and print the
error on the gladiator

CRs-Fixed: 1000642
Change-Id: I2c7a36f6a31e2f7caa36aa5632f8ddb4746abcc1
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2016-04-18 17:26:49 -07:00
Runmin Wang
9c302e1f2b ARM: dts: msm: Add gladitor erp v2 device definition on msmcobalt
Add a device definition for gladitor error reporting v2 on msmcobalt

CRs-Fixed: 1000642
Change-Id: I7bbbc9d2318bd5a6bd2ea051fad43898ae979381
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2016-04-18 17:26:49 -07:00
Runmin Wang
f15492d20c soc: qcom: Add support for gladiator error reporting v2
Add support for gladiator cache inter connect error detection
and reporting for msmcobalt

CRs-Fixed: 1000642
Change-Id: I68c5ce09cc77a19eb334a1d8ccce8d577f964316
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2016-04-18 17:26:48 -07:00
Vinayak Menon
5dca066217 um: define TIF_MM_RELEASED
Define TIF_MM_RELEASED to let UML compile.

CRs-Fixed: 1003624
Change-Id: I65dd431b7f1f756b33a2a0b25ab841aad5368967
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-04-18 17:06:23 -07:00
Aravind Venkateswaran
2ff913cbf0 msm: mdss: make DSI regulator settings an optional dt binding
Newer versions of the DSI phy do not require any programming of the lane
regulator settings. Make this binding an optional property for the DSI
device node.

CRs-Fixed: 1000724
Change-Id: I696aab348cdb04db4068b2b62bcd049c839cbc33
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-04-18 17:06:22 -07:00
Ashwini Rao
a302531f3e msm: jpeg: DMA V4L2 driver changes
Fixed issues in jpeg DMA v4l2 driver, related to
incorrect clock index, incorrect buffer offset,
incorrect dtsi node names for VBIF, QOS and
mmu prefetch.

CRs-Fixed: 1001324
Change-Id: Ice15afd63e006401a469376277b50a129ef177b4
Signed-off-by: Ashwini Rao <ashwinik@codeaurora.org>
2016-04-18 17:06:21 -07:00
Mitchel Humpherys
f4515051a9 ARM: dts: msm: Don't set the iommus property on IOMMUs
Since the IOMMU debug and test framework relies on parsing `iommus'
properties from the device tree, we've relied on setting an `iommus'
property directly on a few of our IOMMUs, just to ensure that the
debugfs directory gets populated even when client drivers haven't been
enabled.  However, in newer kernels, any device node with an `iommus'
property gets auto-attached to the given IOMMU, which isn't actually
what we want to have happen.  The end result is that we try to map our
own page table memory into an IOMMU, resulting in a recursive mapping
loop, which is unequivocally bad.

Fix this by removing the recursive `iommus' property.  The method for
testing these things in isolation from clients will need to be
re-worked.

CRs-Fixed: 1000848
Change-Id: I394bfc1c72492415d6f7fbb0b10df309b86d6faa
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-04-18 17:06:20 -07:00
Mitchel Humpherys
bc509c6867 ARM: dts: msm: Add bus vote for MMSS SMMU
The MMSS SMMU needs a bus vote in order to light the path to DDR.  Add
it.

CRs-Fixed: 1000848
Change-Id: I6b0ffa35d73e7d5e4ed506779444ebc2902a7d28
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-04-18 17:06:20 -07:00
Mitchel Humpherys
8abfec06f4 ARM: dts: msm: Add some more clocks for the GPU SMMU
There are a few more clocks needed for correct operation of the GPU
SMMU.  Add them.

CRs-Fixed: 1000848
Change-Id: Id52d17f034a8d5403448fd09b78003e5ab23639c
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-04-18 17:06:19 -07:00
Jack Pham
87f4a1b62e defconfig: msmcortex: Enable CONFIG_UIO and CONFIG_UIO_MSM_SHAREDMEM
Enable Userspace I/O and MSM shared memory driver on msmcortex.

CRs-Fixed: 1003245
Change-Id: I84fd0170a3a0ea41070c1368a5f6efdae5288f2d
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-04-18 17:06:18 -07:00
Deepak Katragadda
35bee08718 clk: msm: clock: Add support for the mdss byte_intf_div clocks
There is a configurable divider between the byte_clk_src RCGs
and the mmss_mdss_byte_intf_clk clocks. Add support to program
it.

CRs-Fixed: 1003173
Change-Id: I976c2b9e9739b603f6cfb10d11c7b1d64cb577c5
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
2016-04-18 17:06:17 -07:00
Mayank Rana
96fc91d166 usb: gadget: f_diag: Fix list corruption due to diag_context freed
While performing USB composition switch or adb is being killed,
list_add corruption related crash is seen when SLUB_DEBUG is
enabled. diag_function_unbind() API decrements kref count and when
it becomes zero, it is calling diag_context_release() which frees
diag_context. This list corruption is seen from purge_configfs_funcs()
API which is trying to move function list as part of func->list. Fix
this issue by releasing diag_context with free_func() instead of
diag_function_unbind().

CRs-Fixed: 1002041
Change-Id: Ie49e47f2a0f26144e0107759fedc67c3af80032c
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-04-18 17:06:17 -07:00
Karthikeyan Ramasubramanian
8266c2d117 soc: qcom: glink: Fix channel migration logic
Channel migration logic assumes that the remote & local channel contexts
are always different and exist in different transports. If the remote
& local channel contexts exist in the same transport, then it leads to
a use-after-free scenario.

Fix the channel migration logic by not freeing the channel context if
the local & remote side opens in the same initial transport.

Change-Id: I319a93c49022b08e5c33b561d982a751d5223a58
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
2016-04-18 17:06:16 -07:00
Trilok Soni
a63df78642 arm64: errata: Enable #845719 Errataum for Kryo2xx Silver
Errata#845719 is also applicable for Kryo2xx Silver. Enable
the appropriate entry for it with rAp4 revision.

Please note that default midr_range logic depends on the
less or greather than logic with "min" and "max" range,
assuming that rX where X will be zero only. This is not
true for all the processors and since it is 4-bit field
it can be greater than the the "max" or pY bits.

We are specifying the direct match values like
0xA00004 instead here to keep the logic consistent.

CRs-Fixed: 969563
Change-Id: I16b0c2106ae649b8a23b7ebb534c967aebd72774
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
2016-04-18 17:06:15 -07:00
Maya Erez
c42e1feb92 msm_11ad: enable SMMU S1 bypass
Set DOMAIN_ATTR_S1_BYPASS SMMU attribute to put
stage 1 context bank in bypass, as an initial
configuration.
Stage-1 will be enabled in a later stage.

CRs-Fixed: 1001858
Change-Id: I5a320a605622fab85373d02fdbc6c206ddc514aa
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-04-18 17:06:14 -07:00
Maya Erez
cb51ccf1a3 defconfig: msm8996: enable bonding and TC drivers
bonding and TC drivers (sch_multiq) are required in
8996 for fast session transfer feature.

CRs-Fixed: 1001827
Change-Id: I93facd07e46e2e2ce9e302c5a6d48ae2fb2ca9c3
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-04-18 17:06:14 -07:00
Mayank Rana
217cb4db86 ARM: dts:msm: Disable USB QMP PHY on msmcobalt
This change disables USB QMP PHY on msmcobalt until SSUSB
functionality is validated. With this only USB high speed
functionality is supported now.

CRs-Fixed: 1001222
Change-Id: I74a00cc76ab86ee96905d270b1f6e09fb3fb9db7
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-04-13 11:12:29 -07:00
Siddartha Mohanadoss
96b933ebbf uapi: Add MHI device
Export MHI device header for user space clients.

Change-Id: I0f68975dfcad9483182e5af5477153f39a98ac1f
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2016-04-13 11:12:20 -07:00
Siddartha Mohanadoss
4cb670d8db msm: mhi_dev: Add MHI device driver
The Modem Host Interface (MHI) device driver supports
clients to send control and data packets such as
IP data packets, control messages and Diagnostic
data between the Host and the device. It follows the
MHI specification to transfer data.
The driver interfaces with the IPA driver for Hardware
accelerated channels and PCIe End point driver
to communicate between the Host and the device.
The driver exposes to both userspace and kernel space
generic IO read/write/open/close system calls and
kernel APIs to communicate and transfer data between
Host and the device.

Change-Id: I64990a972cbf7c2022d638c35f7517071de67f19
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2016-04-13 11:12:11 -07:00
Shashank Mittal
00eb45fc95 coresight: replace bitmap_scnprintf with scnprintf
bitmap_scnprintf has been deprecated, so replace it with
scnprintf.

Change-Id: I8563fafc56515fde764046f882814c1c6e4c4299
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
2016-04-13 11:12:00 -07:00
Laura Abbott
41728295e3 mm: Increase number of GFP masks
The __GFP_CMA mask is now placed after all available GFP masks.
With this we need to increase the total number of GFP flags.
Do so accordingly.

CRs-Fixed: 648978
Change-Id: I53f5f064ac16a50ee10c84ff2bb50fdb7e085bd0
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[lmark@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Liam Mark <lmark@codeaurora.org>
2016-04-13 11:11:51 -07:00
Liam Mark
50050f2a1d mm: add cma pcp list
Add a cma pcp list in order to increase cma memory utilization.

Increased cma memory utilization will improve overall memory
utilization because free cma pages are ignored when memory reclaim
is done with gfp mask GFP_KERNEL.

Since most memory reclaim is done by kswapd, which uses a gfp mask
of GFP_KERNEL, by increasing cma memory utilization we are therefore
ensuring that less aggressive memory reclaim takes place.

Increased cma memory utilization will improve performance,
for example it will increase app concurrency.

Change-Id: I809589a25c6abca51f1c963f118adfc78e955cf9
Signed-off-by: Liam Mark <lmark@codeaurora.org>
2016-04-13 11:11:40 -07:00
Heesub Shin
d491cf59f0 cma: redirect page allocation to CMA
CMA pages are designed to be used as fallback for movable allocations
and cannot be used for non-movable allocations. If CMA pages are
utilized poorly, non-movable allocations may end up getting starved if
all regular movable pages are allocated and the only pages left are
CMA. Always using CMA pages first creates unacceptable performance
problems. As a midway alternative, use CMA pages for certain
userspace allocations. The userspace pages can be migrated or dropped
quickly which giving decent utilization.

Change-Id: I6165dda01b705309eebabc6dfa67146b7a95c174
CRs-Fixed: 452508
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Heesub Shin <heesub.shin@samsung.com
[lauraa@codeaurora.org: Missing CONFIG_CMA guards, add commit text]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[lmark@codeaurora.org: resolve conflicts relating to
 MIGRATE_HIGHATOMIC and some other trivial merge conflicts]
Signed-off-by: Liam Mark <lmark@codeaurora.org>
2016-04-13 11:11:30 -07:00
Vinayak Menon
59a8d2507c lowmemorykiller: avoid false adaptive LMK triggers
In vmpressure notifier of LMK, shift_adj would have been set
by a previous invocation of notifier, which is not followed by
a lowmem_shrink yet. If this is follwed by a lower vmpressure,
and then by a lowmem_shrink, ALMK still triggers because of the
previous higher vmpressure notification. This is wrong.
Since vmpressure has improved, reset shift_adj to avoid false
adaptive LMK trigger.

CRs-fixed: 893699
Change-Id: I2d77103d7c8f4d8a66e4652cba78e619a7bcef9a
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-04-13 11:11:20 -07:00
Vinayak Menon
ef5918f680 lowmemorykiller: use for_each_thread instead of buggy while_each_thread
Couple of cases were reported few months ago, where the cpu was blocked
on the following call stack for /seconds/ after which the watchdog fires.

test_task_flag(p = 0xE14ABF00, ?)
lowmem_shrink(?, sc = 0xD7A03C04)
shrink_slab(shrink = 0xD7A03C04, nr_pages_scanned = 0, lru_pages = 120)
try_to_free_pages(zonelist = 0xC1116440, ?, ?, ?)
__alloc_pages_nodemask(?, order = 0, ?, nodemask = 0x0)
__do_page_cache_readahead(mapping = 0xEB819364, filp = 0xCC16DC00, offset =
ra_submit(?, ?, ?)
filemap_fault(vma = 0xC105D240, vmf = 0xD7A03DC8)

There weren't any dumps to analyse the case, but this can be a possible
reason. while_each_thread is known to be buggy and can result in the
function looping forever if the task exits, even when protected with
rcu_read_lock. Use for_each_thread instead.

More details on the problems with while_each_thread can be found
at https://lkml.org/lkml/2013/12/2/320

Change-Id: I5eb6e4b463f81142a2a7824db389201357432ec7
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-04-13 11:11:11 -07:00
Liam Mark
1426d1f8d9 lowmemorykiller: Don't count swap cache pages twice
The lowmem_shrink function discounts all the swap cache pages from
the file cache count. The zone aware code also discounts all file
cache pages from a certain zone.  This results in some swap cache
pages being discounted twice, which can result in the low memory
killer being unnecessarily aggressive.

Fix the low memory killer to only discount the swap cache pages
once.

Change-Id: I650bbfbf0fbbabd01d82bdb3502b57ff59c3e14f
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-04-13 11:11:01 -07:00