Commit Graph

3645 Commits

Author SHA1 Message Date
Ganesh Mahendran
8fea032d53 mm/zsmalloc: keep comments consistent with code
Some minor commebnt changes:

 1). update zs_malloc(),zs_create_pool() function header
 2). update "Usage of struct page fields"

Link: http://lkml.kernel.org/r/1467882338-4300-5-git-send-email-opensource.ganesh@gmail.com
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:38 +05:30
Ganesh Mahendran
2e655dfbb8 mm/zsmalloc: avoid calculate max objects of zspage twice
Currently, if a class can not be merged, the max objects of zspage in
that class may be calculated twice.

This patch calculate max objects of zspage at the begin, and pass the
value to can_merge() to decide whether the class can be merged.

Also this patch remove function get_maxobj_per_zspage(), as there is no
other place to call this function.

Link: http://lkml.kernel.org/r/1467882338-4300-4-git-send-email-opensource.ganesh@gmail.com
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:38 +05:30
Ganesh Mahendran
d64998f7ee mm/zsmalloc: use class->objs_per_zspage to get num of max objects
num of max objects in zspage is stored in each size_class now.  So there
is no need to re-calculate it.

Link: http://lkml.kernel.org/r/1467882338-4300-3-git-send-email-opensource.ganesh@gmail.com
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:38 +05:30
Ganesh Mahendran
9e85eb7dbb mm/zsmalloc: take obj index back from find_alloced_obj
the obj index value should be updated after return from
find_alloced_obj() to avoid CPU burning caused by unnecessary object
scanning.

Link: http://lkml.kernel.org/r/1467882338-4300-2-git-send-email-opensource.ganesh@gmail.com
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:38 +05:30
Ganesh Mahendran
4ed44a729a mm/zsmalloc: use obj_index to keep consistent with others
This is a cleanup patch.  Change "index" to "obj_index" to keep
consistent with others in zsmalloc.

Link: http://lkml.kernel.org/r/1467882338-4300-1-git-send-email-opensource.ganesh@gmail.com
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:38 +05:30
Minchan Kim
08a344a7f6 mm: add NR_ZSMALLOC to vmstat
zram is very popular for some of the embedded world (e.g., TV, mobile
phones).  On those system, zsmalloc's consumed memory size is never
trivial (one of example from real product system, total memory: 800M,
zsmalloc consumed: 150M), so we have used this out of tree patch to
monitor system memory behavior via /proc/vmstat.

With zsmalloc in vmstat, it helps in tracking down system behavior due
to memory usage.

[minchan@kernel.org: zsmalloc: follow up zsmalloc vmstat]
  Link: http://lkml.kernel.org/r/20160607091737.GC23435@bbox
[akpm@linux-foundation.org: fix build with CONFIG_ZSMALLOC=m]
Link: http://lkml.kernel.org/r/1464919731-13255-1-git-send-email-minchan@kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Sangseok Lee <sangseok.lee@lge.com>
Cc: Chanho Min <chanho.min@lge.com>
Cc: Chan Gyun Jeong <chan.jeong@lge.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:38 +05:30
Minchan Kim
ab53a526d8 zsmalloc: use OBJ_TAG_BIT for bit shifter
Static check warns using tag as bit shifter.  It doesn't break current
working but not good for redability.  Let's use OBJ_TAG_BIT as bit
shifter instead of OBJ_ALLOCATED_TAG.

Link: http://lkml.kernel.org/r/20160607045146.GF26230@bbox
Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:38 +05:30
Dan Streetman
e5937ef5a7 update "mm/zsmalloc: don't fail if can't create debugfs info"
Some updates to commit d34f615720d1 ("mm/zsmalloc: don't fail if can't
create debugfs info"):

 - add pr_warn to all stat failure cases
 - do not prevent module loading on stat failure

Link: http://lkml.kernel.org/r/1463671123-5479-1-git-send-email-ddstreet@ieee.org
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Reviewed-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Dan Streetman <dan.streetman@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:38 +05:30
Dan Streetman
9f63e26280 mm/zsmalloc: don't fail if can't create debugfs info
Change the return type of zs_pool_stat_create() to void, and remove the
logic to abort pool creation if the stat debugfs dir/file could not be
created.

The debugfs stat file is for debugging/information only, and doesn't
affect operation of zsmalloc; there is no reason to abort creating the
pool if the stat file can't be created.  This was seen with zswap, which
used the same name for all pool creations, which caused zsmalloc to fail
to create a second pool for zswap if CONFIG_ZSMALLOC_STAT was enabled.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Dan Streetman <dan.streetman@canonical.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:38 +05:30
Nick Desaulniers
46cd0b138d UPSTREAM: mm/zsmalloc.c: fix -Wunneeded-internal-declaration warning
is_first_page() is only called from the macro VM_BUG_ON_PAGE() which is
only compiled in as a runtime check when CONFIG_DEBUG_VM is set,
otherwise is checked at compile time and not actually compiled in.

Fixes the following warning, found with Clang:

  mm/zsmalloc.c:472:12: warning: function 'is_first_page' is not needed and will not be emitted [-Wunneeded-internal-declaration]
  static int is_first_page(struct page *page)
           ^

Link: http://lkml.kernel.org/r/20170524053859.29059-1-nick.desaulniers@gmail.com
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 3457f4147675108aa83f9f33c136f06bb9f8518f)
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2020-08-19 11:34:37 +05:30
Matthias Kaehlcke
11170c1e56 UPSTREAM: mm/zsmalloc.c: change stat type parameter to int
zs_stat_inc/dec/get() uses enum zs_stat_type for the stat type, however
some callers pass an enum fullness_group value.  Change the type to int to
reflect the actual use of the functions and get rid of 'enum-conversion'
warnings

Link: http://lkml.kernel.org/r/20170731175000.56538-1-mka@chromium.org
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Doug Anderson <dianders@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 3eb95feac113d8ebad5b7b5189a65efcbd95a749)
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2020-08-19 11:34:37 +05:30
Diep Quynh
944f9ff0e8 ARM64: configs: Disable zswap, vnswap
Signed-off-by: Diep Quynh <remilia.1505@gmail.com>
2020-08-19 11:34:37 +05:30
Diep Quynh
f6b1741b19 mm, zram: Use zstd as initial compressor
Signed-off-by: Diep Quynh <remilia.1505@gmail.com>
2020-08-19 11:34:37 +05:30
Diep Quynh
a1179e073a ARM64: configs: Enable zram, zstd compressor
Signed-off-by: Diep Quynh <remilia.1505@gmail.com>
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-08-19 11:34:37 +05:30
Diep Quynh
c771c0ae02 ARM64: configs: Enable IRQ time accounting
Account for extra IRQ load from such events like display rendering, touch events, etc...
that needs bandwidth raise for optimal performance

Signed-off-by: Diep Quynh <remilia.1505@gmail.com>
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-08-19 11:34:37 +05:30
Diep Quynh
ffb975fe62 exynos-dm: Wrap exynos-ss debugging parts
Signed-off-by: Diep Quynh <remilia.1505@gmail.com>
2020-08-19 11:34:37 +05:30
Diep Quynh
e86408a967 ARM64: configs: Disable exynos-dm debugging for exynos-ss
Using debuggers on clock scaling unit causes performance degradation
on production units. Let's disable it from now

Signed-off-by: Diep Quynh <remilia.1505@gmail.com>
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-08-19 11:34:37 +05:30
kerneltoast
6595426214 ARM64: configs: Define cpumasks
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-08-19 11:34:23 +05:30
Diep Quynh
3fd62ec19b mali: Adapt missing performance-critical IRQ path
Signed-off-by: Diep Quynh <remilia.1505@gmail.com>
2020-08-19 11:33:15 +05:30
Diep Quynh
1319d9acf1 fbdev: Mark decon IRQs and kthreads as perf critical
They are responsible for frame rendering. Mark them as critical so
as to reduce jitter
2020-08-19 11:28:40 +05:30
Sultan Alsawaf
a1ede341b3 kernel: Add API to mark IRQs and kthreads as performance critical
On devices with a CPU that contains heterogeneous cores (e.g.,
big.LITTLE), it can be beneficial to place some performance-critical
IRQs and kthreads onto the performance CPU cluster in order to improve
performance.

This commit adds the following APIs:
-kthread_run_perf_critical() to create and start a perf-critical kthread
-irq_set_perf_affinity() to mark an active IRQ as perf-critical
-IRQF_PERF_CRITICAL to schedule an IRQ and any threads it may have onto
 performance CPUs
-PF_PERF_CRITICAL to mark a process (mainly a kthread) as performance
 critical (this is used by kthread_run_perf_critical())

In order to accommodate this new API, the following changes are made:
-Performance-critical IRQs are distributed evenly among online CPUs
 available in cpu_perf_mask
-Performance-critical IRQs have their affinities reaffined upon exit
 from suspend (since the affinities are broken when non-boot CPUs are
 disabled)
-Performance-critical IRQs and their threads have their affinities reset
 upon entering suspend, so that upon immediate suspend exit (when only
 the boot CPU is online), interrupts can be processed and interrupt
 threads can be scheduled onto an online CPU (otherwise we'd hit a
 kernel BUG)
-__set_cpus_allowed_ptr() is modified to enforce a performance-critical
 kthread's affinity
-Perf-critical IRQs are marked with IRQD_AFFINITY_MANAGED so userspace
 can't mess with their affinity

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2020-08-18 23:10:22 +05:30
Sultan Alsawaf
a71c1ead58 cpumask: Add cpumasks for big and LITTLE CPU clusters
Add cpu_lp_mask and cpu_perf_mask to represent the CPUs that belong to
each cluster in a dual-cluster, heterogeneous system.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-08-18 23:10:21 +05:30
Runmin Wang
4187d5ecf5 genirq: Add IRQ_AFFINITY_MANAGED flag
Add IRQ_AFFINITY_MANAGED flag and related kernel APIs so that
kernel driver can modify an irq's status in such a way that
user space affinity change will be ignored. Kernel space's
affinity setting will not be changed.

Change-Id: Ib2d5ea651263bff4317562af69079ad950c9e71e
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2020-08-18 23:10:21 +05:30
Thomas Gleixner
da1d819038 genirq: Introduce IRQD_AFFINITY_MANAGED flag
Interupts marked with this flag are excluded from user space interrupt
affinity changes. Contrary to the IRQ_NO_BALANCING flag, the kernel internal
affinity mechanism is not blocked.

This flag will be used for multi-queue device interrupts.

Change-Id: I204c49bb1c8ce87fbcd163119093163b120bfe83
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: linux-block@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: linux-nvme@lists.infradead.org
Cc: axboe@fb.com
Cc: agordeev@redhat.com
Link: http://lkml.kernel.org/r/1467621574-8277-3-git-send-email-hch@lst.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Git-commit: 9c2555835bb3d34dfac52a0be943dcc4bedd650f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[runminw@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2020-08-18 23:09:24 +05:30
Jesse Chan
5b4d3225d2 ARM64: configs: Disable FIFS 2020-08-18 22:09:25 +05:30
Daniel Micay
344be08992 add toggle for disabling newly added USB devices
Based on the public grsecurity patches.

Signed-off-by: SamarV-121 <samarv121@pixelexperience.org>
2020-08-18 22:05:38 +05:30
prashantpaddune
bbfaf01718 defconfig: Enable BOEFFLA_WL_BLOCKER 2020-08-18 22:03:08 +05:30
djb77
f2d2bb53b8 power: Remove default wakelocks from boeffla_wl_blocker.h
Signed-off-by: djb77 <dwayne.bakewell@gmail.com>
2020-08-18 22:01:01 +05:30
djb77
c1772eb074 power: Increase boeffla_wl_blocker.h LENGTH_LIST_WL limit to 2048
Signed-off-by: djb77 <dwayne.bakewell@gmail.com>
2020-08-18 22:01:00 +05:30
djb77
0d641d3cf5 power: Fix issue in wakeup.c
Signed-off-by: djb77 <dwayne.bakewell@gmail.com>
2020-08-18 22:00:58 +05:30
andip71
5c9507f44a power: Update to wakelock blocker driver v1.1.0
There are now two lists:
- the previously existing list of user defined wakelocks to block
- a new list called "wakelock_blocker_default" which comes prepopulated with the most common
  and safe wakelocks to block:

    qcom_rx_wakelock;wlan;wlan_wow_wl;wlan_extscan_wl;netmgr_wl;NETLINK

A combination of both wakelock lists will be blocked finally.

Signed-off-by: djb77 <dwayne.bakewell@gmail.com>
2020-08-18 22:00:57 +05:30
andip71
e66233ca33 power: Update to wakelock blocker driver v1.0.1
- currently active wakelocks on the list are forcefully killed

Signed-off-by: djb77 <dwayne.bakewell@gmail.com>
2020-08-18 22:00:36 +05:30
andip71
714848b183 power: Add generic wakelock blocker driver v1.0.0
Based on ideas of FranciscoFranco's non-generic driver.

Sysfs node:

	/sys/class/misc/boeffla_wakelock_blocker/wakelock_blocker

		- list of wakelocks to be blocked, separated by semicolons

	/sys/class/misc/boeffla_wakelock_blocker/debug

		- write: 0/1 to switch off and on debug logging into dmesg
		- read:  get current driver internals

	/sys/class/misc/boeffla_wakelock_blocker/version

		- show driver version

Signed-off-by: andip71 <andreasp@gmx.de>
Signed-off-by: djb77 <dwayne.bakewell@gmail.com>
2020-08-18 21:54:39 +05:30
Diep Quynh
21ca15f70d ARM64: configs: Enable DriveDroid storage support 2020-08-18 21:44:06 +05:30
prashantpaddune
7fff0e9951 ARM64: configs: Enable Power Efficient Workqueue 2020-08-18 21:34:02 +05:30
djb77
d81ef26cef defconfig: Enable USB_CONFIGFS_MASS_STORAGE 2020-08-18 21:29:50 +05:30
jimzrt
27caa8eaba usb: Modify mass_storage gadget to work with configfs 2020-08-18 21:28:03 +05:30
BlackGunZ
865bcc3e46 power: wakeup: Disable logging for pending wakeups
Thanks to @tropez08.
2020-08-18 21:22:51 +05:30
BlackGunZ
224a46cc60 arm64: kernel: Default debugging to off 2020-08-18 21:21:56 +05:30
BlackGunZ
78e7b9059a ARM64: configs: Disable some more debugging functions 2020-08-18 21:21:28 +05:30
andip71
c4580b2626 tcp_output: set initial TCP window size to 64K (speed improvement)
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-08-18 21:19:44 +05:30
prashantpaddune
48bd579a3a defconfigs: Enable wireguard 2020-08-18 21:19:07 +05:30
Jason A. Donenfeld
3b63ceea8f net/wireguard: add wireguard importer
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-08-18 21:18:10 +05:30
Varun Chitre
fc69405a3a mmc: Disable CRC check 2020-08-18 21:09:38 +05:30
SamarV-121
68da00ea53 fs: Disable fsync by default
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-08-18 21:08:39 +05:30
franciscofranco
248a47bf83 fs: Add fsync on/off support
[efremov: change permissions from 0755 to 0644]
Signed-off-by: djb77 <dwayne.bakewell@gmail.com>
Signed-off-by: Denis Efremov <efremov@linux.com>
2020-08-18 21:08:08 +05:30
Siarhei Vishniakou
2a285456a4 input: touchscreen: Require low latency
Currently, CPU can enter deep sleep while waiting for data on the i2c
bug. That means an i2c read of 8 bytes can take as long as 10 ms, which
would overrun the desired interrupt handling time.
Use pm qos to require low latency and prevent CPU from entering deep
sleep while handling touch interrupts.

Bug: 110939384
Test: look at the i2c read traces:
1) ./external/chromium-trace/systrace.py --atrace-categories=view,wm,am,app,gfx,i2c,sched,irq,video,power,input,workq,freq
2) perform a fling
3) review the i2c read duration on the touchscreen bus

Change-Id: Icf8ab09324003a85af70517769ced3bae52f705c
Signed-Off-By: Siarhei Vishniakou <svv@google.com>
2020-08-18 21:06:05 +05:30
Jesse Chan
a3103639ca input: sec_ts: bind input_open/close to display state
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-08-18 21:05:17 +05:30
prashantpaddune
671d649fa8 A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
prashantpaddune
7bf46eb137 switch to pc 2020-08-18 17:19:57 +05:30