During global reclaim, the nr_reclaimed passed to vmpressure includes the
pages reclaimed from slab. But the corresponding scanned slab pages is
not passed. There is an impact to the vmpressure values because of this.
While moving from kernel version 3.18 to 4.4, a difference is seen in the
vmpressure values for the same workload resulting in a different behaviour
of the vmpressure consumer. One such case is of a vmpressure based
lowmemorykiller. It is observed that the vmpressure events are received
late and less in number resulting in tasks not being killed at the right
time. The following numbers show the impact on reclaim activity due to
the change in behaviour of lowmemorykiller on a 4GB device. The test
launches a number of apps in sequence and repeats it multiple times.
v4.4 v3.18
pgpgin 163016456 145617236
pgpgout 4366220 4188004
workingset_refault 29857868 26781854
workingset_activate 6293946 5634625
pswpin 1327601 1133912
pswpout 3593842 3229602
pgalloc_dma 99520618 94402970
pgalloc_normal 104046854 98124798
pgfree 203772640 192600737
pgmajfault 2126962 1851836
pgsteal_kswapd_dma 19732899 18039462
pgsteal_kswapd_normal 19945336 17977706
pgsteal_direct_dma 206757 131376
pgsteal_direct_normal 236783 138247
pageoutrun 116622 108370
allocstall 7220 4684
compact_stall 931 856
This is a regression introduced by commit 6b4f7799c6 ("mm: vmscan:
invoke slab shrinkers from shrink_zone()").
So do not consider reclaimed slab pages for vmpressure calculation. The
reclaimed pages from slab can be excluded because the freeing of a page by
slab shrinking depends on each slab's object population, making the cost
model (i.e. scan:free) different from that of LRU. Also, not every
shrinker accounts the pages it reclaims. But ideally the pages reclaimed
from slab should be passed to vmpressure, otherwise higher vmpressure
levels can be triggered even when there is a reclaim progress. But
accounting only the reclaimed slab pages without the scanned, and adding
something which does not fit into the cost model just adds noise to the
vmpressure values.
Fixes: 6b4f7799c6 ("mm: vmscan: invoke slab shrinkers from shrink_zone()")
Link: http://lkml.kernel.org/r/1486641577-11685-2-git-send-email-vinmenon@codeaurora.org
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Git-commit: 97a9668a428e9651a4aa3ff5d4e7e60024be2d87
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Change-Id: If46b1cee6fd9723bebd87d76e0bb8451de05a9c1
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
At the end of a window period, if the reclaimed pages is greater than
scanned, an unsigned underflow can result in a huge pressure value and
thus a critical event. Reclaimed pages is found to go higher than scanned
because of the addition of reclaimed slab pages to reclaimed in
shrink_node without a corresponding increment to scanned pages. Minchan
Kim mentioned that this can also happen in the case of a THP page where
the scanned is 1 and reclaimed could be 512.
Link: http://lkml.kernel.org/r/1486641577-11685-1-git-send-email-vinmenon@codeaurora.org
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Rik van Riel <riel@redhat.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Shiraz Hashim <shashim@codeaurora.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Change-Id: Ic1221fa129c9b3512127537d62df7bd4a7606d24
Git-commit: 746d8d8f3ebb49a62ffcffb4b1f41cc27d020a2e
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Adapt to latest changes to IPA micro-controller(IPA uC).
For pipe SUSPEND, IPA uC will fail in case
the pipe is not empty.
IPA driver needs to insure pipe is empty
and then issue a SUSPEND command.
For pipe DISABLE, pipe is already empty on SUSPEND,
IPA driver does not need to do ensure anything before
issuing a DISABLE command.
Change-Id: Ic0e65b671fc29583203986defada31e92065adfd
Acked-by: Mohammed Javid <mjavid@qti.qualcomm.com>
Signed-off-by: Utkarsh Saxena <usaxena@codeaurora.org>
_get_svm_area can fail to find available address range
from mmap_base which was adjusted by random factor.
By logging mmap_base value will help to identify
any issue with the VA randomization.
Change-Id: Ibdc3fac975adde02c30aa253b53d6533ee558161
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
Update enable signal polarity of SMB1351 as active high to make
sure STAT pin of main charger controls SMB1351.
Change-Id: I7c3fa06d59667639899ad795537ed49cb1f59e2d
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Matt reported that we have a NULL pointer dereference
in ppp_pernet() from ppp_connect_channel(),
i.e. pch->chan_net is NULL.
This is due to that a parallel ppp_unregister_channel()
could happen while we are in ppp_connect_channel(), during
which pch->chan_net set to NULL. Since we need a reference
to net per channel, it makes sense to sync the refcnt
with the life time of the channel, therefore we should
release this reference when we destroy it.
Fixes: 1f461dcdd296 ("ppp: take reference on channels netns")
Reported-by: Matt Bennett <Matt.Bennett@alliedtelesis.co.nz>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linux-ppp@vger.kernel.org
Cc: Guillaume Nault <g.nault@alphalink.fr>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Git-repo:https://source.codeaurora.org/quic/la/kernel/msm-4.4
Git-commit: 205e1e255c479f3fd77446415706463b282f94e4
Change-Id: Ic7ce3be365ebdc1505ed8ce68df981c855638a3c
Signed-off-by: Srinivasa Rao Kuppala <srkupp@codeaurora.org>
When the GPU hardware init function fails (like say, ME_INIT timed
out) return error instead of blindly continuing on. This gives us
a small chance of saving the system before it goes boom.
Change-Id: Ic0dedbad142efbc9bd93e8531b40c391ec15f557
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Make sure to detach the MMU device before destroying the address
space.
Change-Id: Ic0dedbadff27fed017840a61ec5e0d55ce0c71e6
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
SDE and the GPU have different requirements for the SMMU backends - the
SDE generates its own iova addresses and needs special support for DMA
buffers and the GPU does its own IOMMU operations. Add a shim layer to
aspace to break out the address generation and call the appropriate
SMMU functions. There is probably consolidation that can be done, but for
now this is the best way to deal with the two use cases.
Change-Id: Ic0dedbadc6dc03504ef7dffded18ba09fb3ef291
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
We can have various combinations of 64b and 32b address space, ie. 64b
CPU but 32b display and gpu, or 64b CPU and GPU but 32b display. So
best to decouple the device iova's from mmap offset.
Change-Id: Ic0dedbad2b36b535df3e8fb2ddddc20add592cea
Signed-off-by: Rob Clark <robdclark@gmail.com>
Git-commit: 22877bcbdacd50d076f9b2f829e6a3753aa9821f
Git-repo: https://github.com/freedreno/kernel-msm.git
[jcrouse@codeaurora.org: Fix merge conflicts, remove mdp5 due to large
infrastructure changes, compile fixes]
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Currently, IPA driver asserts if IPA FW loading
fails. Some environments do not have IPA FW
integrated and we should not crash at these cases.
CRs-fixed: 2005599
Change-Id: I78b9f2cadb8c35ab455f4514c7efc9cee4cf4542
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
Update cpufreq table for sdm630 as per new cpu clock plan.
CRs-Fixed: 2008773
Change-Id: Ibaa5d3c2d1dbafd14b5e9bee382cd3980f89aa51
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
Add device tree files for headset jacktype NO, for CDP
and RCM platforms of SDM630.
Change-Id: I297e6467ed47c51950ae527077c3d20cf738e0b6
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
Fix default read vbif OT settings for mdss driver
in sdm630 and sdm660.
Change-Id: I9efbda397ffbf3552a165887d43e25a0426fd5b5
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
ICL change interrupt triggers whenever there is change in the
input ICL, in case of AICL restart(done as part of S/W base
pulsing) AICL starts from 500mA and ICL change gets triggered
for every 25mA ICL as part of AICL ramping.
ICL change handler generates a power_supply event on parallel
psys and thus causing parallel framework to re-split ICL for
every 25mA. Fix this by delaying power_supply event until AICL
settles.
Change-Id: I9270a99f536db4534e46764b2e053ff93b38cb54
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Hardware autonomous INOV does adapter's output voltage
manipulation only based on the input limited state of main
charger. This works well with MID-MID parallel configuration
but with USBIN-USBIN parallel configuration parallel charger's
input limited state also plays role for INOV manipulations.
Thus disable hardware based autonomous INOV and add support
for software based INOV for USBIN-USBIN configuration.
Note that if authentication is disabled, the hw assumes QC3.0 and
if the autonomous bit is enabled, it issues increment/decrement pulses.
This happens even when QC3.0 has not been actually authenticated.
Change-Id: I397acb558c9ba3b6fc7d7b974d64459f278697fd
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
USBIN-USBIN parallel configuration can have either an internal current
sensing via main charger's BATFET or an external current sense resistor.
The FCC split between main and parallel charger differs based on current
sensing mode, add support to differentiate internal/external sensing and
the FCC split is done as follows:
- Internal Sensing: Main charger configure to full FCC
Parallel charger configured to 50% FCC.
- External sensing: Main charger configure to 50% FCC
Parallel charger configured to 50% FCC.
Change-Id: Ia0c6234ce6f62af460edd3c4f56e34810899b3e3
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
"icl_reduction_ua" is not updated to new slave ICL value after
ICL split, update the variable.
Change-Id: I944fddfda1aa2c359785d1a3155ac22ebe91fa65
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
In PM660 "QC authentication done" IRQ is a pulse and thus it
does not require workaround to disable this IRQ after authentication
completes. Add a workaround flag to enable this only for PMI8998.
Change-Id: I766219df38fc4954f5208d6db323b680e8e5fafd
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
In some cases it has been observed that after sending STARTXFER
command with USB GSI IN endpoint, USB controller is accessing zero
address resulting into bus error. This change captures USB GSI
operation sequence in debug buffer which may help to understand
race condition in terms of USB gadget events and USB GSI endpoint
operations.
Change-Id: Ia46877bb92ea0cc1d5f3712e5c70bb44232d5cfe
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
The hardware based threshold comparison requires thermal regulation to
be active. This is a problem for layouts which connect USBIN rather than
MID to the SMB138X since the thermal regulation will throttle the ICL in
the USBIN case.
Read the connector temperature ADC and compare against the thresholds
in software instead of enabling thermal regulation.
Change-Id: I9ecda675947fc6c82a8c8b67d0c9d930365ad02e
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>