Commit Graph

29106 Commits

Author SHA1 Message Date
80b2e67cf3 Merge "sched: trace : Print current sched domain overutilization status" 2019-05-25 04:52:32 -07:00
3b95a25ba1 Merge "sched/fair: Allow prev cpu in find best target" 2019-05-25 02:05:11 -07:00
301162722f Merge "sched/walt: Improve the scheduler" 2019-05-24 23:05:46 -07:00
f556970145 Merge "sched/walt: Improve the scheduler" 2019-05-23 01:06:37 -07:00
74ccfe0334 sched/fair: Allow prev cpu in find best target
Change 10f7dc075b87361d42d0145b74bfd75f28cc4545 ("sched/fair: dont run
energy calculation unless necessary") then assumed that the cpus
returned from find_best_target() would be used for energy evaluation.

Later, code was added to use the target cpu returned by fbt() in certain
latency sensitive situations. This lead to skipping prev_cpu, since it
could have been the target cpu had the above mentioned change not
dropped it.

So revert 10f7dc075b87361d42d0145b74bfd75f28cc4545 ("sched/fair: dont run
energy calculation unless necessary")

Change-Id: I06827ce9339f698dd3927a103b4c1a1ddbe123e2
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2019-05-22 18:30:44 -07:00
89162be622 sched: improve the scheduler
This change is for general scheduler improvement.

Change-Id: Idb019614ff31b3cfcde023cd92f8d791f2650dee
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2019-05-22 18:30:43 -07:00
62433a083a sched/fair: Refactor packing eligible test
The purpose of is_packing_eligible() test is to check if
we should throwaway the active cpu and use the idle CPU.
Refactor this function such a way that, the throw away
CPU (i.e active_cpu) is marked -1. The follow up patch
use this refactoring to add more checks in this function.

Change-Id: I0ae829dcc9b62da3ae69796b28abebd950b34462
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
[adharmap: made adjust cpus for packing inline]
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2019-05-22 18:30:43 -07:00
110ade372f sched: trace : Print current sched domain overutilization status
Extend sched_load_balance trace event to print overutilization
status of the current balancing sched domain.

Change-Id: Iae14e580294a0ab38394b4e8d660d0c5dd14327d
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-05-21 00:54:28 -07:00
08853b1a78 sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I50d41aa3338803cbd45ff6314b2bb3978c59282b
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2019-05-21 10:06:45 +05:30
2bd529acdd Merge "Merge android-4.19.33 (0b065cd) into msm-4.19" 2019-05-16 01:39:13 -07:00
f2a0765ea9 Merge "Merge android-4.19.32 (6f994bf) into msm-4.19" 2019-05-15 19:29:58 -07:00
dfda97185e ANDROID: sched/fair: Reduce balance interval to 1 jiffy if we have a misfit task
It is quite a common occurrence that we have a misfit task (a task
running on a CPU which is close to the capacity limit of that CPU)
in the system AND we have recently done a load balance operation.
Normal load-balance rate limiting means we can leave those tasks on
the restrictive CPU for a few hundred ms before we move them.

Inspired by the work Leo Yan did on balancing misfits.

This patch reduces the balance interval to one jiffy when there are such
tasks running.

There appears to be no impact on interactive performance from this
patch.

Change-Id: I71d74734d3bd6bca80476c0f466ba48914b7ac02
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Git-commit: 84c88fc37932db51b87af8df3cedc621cb5c6e97
Git-repo: https://android.googlesource.com/kernel/common
[clingutla@codeaurora.org: Took only partial part from commit
  '84c88fc37932("ANDROID: Combined EAS Load Balance Tweaks")',
  and skip using 1 jiffy for busy balancing]
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-05-13 02:16:17 -07:00
42e3800865 Merge android-4.19.33 (0b065cd) into msm-4.19
* refs/heads/tmp-0b065cd:
  Linux 4.19.33
  platform: x86: intel_cht_int33fe: Remove the old connections for the muxes
  usb: typec: class: Don't use port parent for getting mux handles
  platform: x86: intel_cht_int33fe: Add connections for the USB Type-C port
  platform: x86: intel_cht_int33fe: Add connection for the DP alt mode
  platform: x86: intel_cht_int33fe: Register all connections at once
  drivers: base: Helpers for adding device connection descriptions
  bpf: do not restore dst_reg when cur_state is freed
  staging: erofs: keep corrupted fs from crashing kernel in erofs_readdir()
  staging: erofs: fix error handling when failed to read compresssed data
  KVM: x86: Emulate MSR_IA32_ARCH_CAPABILITIES on AMD hosts
  KVM: x86: update %rip after emulating IO
  KVM: Reject device ioctls from processes other than the VM's creator
  x86/smp: Enforce CONFIG_HOTPLUG_CPU when SMP=y
  cpu/hotplug: Prevent crash when CPU bringup fails on CONFIG_HOTPLUG_CPU=n
  watchdog: Respect watchdog cpumask on CPU hotplug
  powerpc/64: Fix memcmp reading past the end of src/dest
  powerpc/pseries/energy: Use OF accessor functions to read ibm,drc-indexes
  objtool: Query pkg-config for libelf location
  perf intel-pt: Fix TSC slip
  perf pmu: Fix parser error for uncore event alias
  mm/migrate.c: add missing flush_dcache_page for non-mapped page migrate
  mm: mempolicy: make mbind() return -EIO when MPOL_MF_STRICT is specified
  iommu/io-pgtable-arm-v7s: request DMA32 memory, and improve debugging
  mm: add support for kmem caches in DMA32 zone
  usb: cdc-acm: fix race during wakeup blocking TX traffic
  xhci: Don't let USB3 ports stuck in polling state prevent suspend
  usb: xhci: dbc: Don't free all memory with spinlock held
  xhci: Fix port resume done detection for SS ports with LPM enabled
  usb: host: xhci-rcar: Add XHCI_TRUST_TX_LENGTH quirk
  usb: common: Consider only available nodes for dr_mode
  USB: gadget: f_hid: fix deadlock in f_hidg_write()
  usb: mtu3: fix EXTCON dependency
  phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs
  gpio: adnp: Fix testing wrong value in adnp_gpio_direction_input
  gpio: exar: add a check for the return value of ida_simple_get fails
  drm/i915/gvt: Fix MI_FLUSH_DW parsing with correct index check
  drm/vkms: fix use-after-free when drm_gem_handle_create() fails
  drm/vgem: fix use-after-free when drm_gem_handle_create() fails
  fs/proc/proc_sysctl.c: fix NULL pointer dereference in put_links
  Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc
  USB: serial: option: add Olicard 600
  USB: serial: option: add support for Quectel EM12
  USB: serial: option: set driver_info for SIM5218 and compatibles
  USB: serial: mos7720: fix mos_parport refcount imbalance on error path
  USB: serial: ftdi_sio: add additional NovaTech products
  USB: serial: cp210x: add new device id
  serial: sh-sci: Fix setting SCSCR_TIE while transferring data
  serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference
  serial: max310x: Fix to avoid potential NULL pointer dereference
  staging: erofs: fix to handle error path of erofs_vmap()
  staging: vt6655: Fix interrupt race condition on device start up.
  staging: vt6655: Remove vif check from vnt_interrupt
  staging: speakup_soft: Fix alternate speech with other synths
  staging: comedi: ni_mio_common: Fix divide-by-zero for DIO cmdtest
  tty: serial: qcom_geni_serial: Initialize baud in qcom_geni_console_setup
  tty: atmel_serial: fix a potential NULL pointer dereference
  tty: mxs-auart: fix a potential NULL pointer dereference
  drm/rockchip: vop: reset scale mode when win is disabled
  scsi: zfcp: fix scsi_eh host reset with port_forced ERP for non-NPIV FCP devices
  scsi: zfcp: fix rport unblock if deleted SCSI devices on Scsi_Host
  scsi: sd: Quiesce warning if device does not report optimal I/O size
  scsi: sd: Fix a race between closing an sd device and sd I/O
  ocfs2: fix inode bh swapping mixup in ocfs2_reflink_inodes_lock
  fs/open.c: allow opening only regular files during execve()
  kbuild: modversions: Fix relative CRC byte order interpretation
  ALSA: hda/realtek - Fix speakers on Acer Predator Helios 500 Ryzen laptops
  ALSA: hda/realtek: Enable headset MIC of ASUS X430UN and X512DK with ALC256
  ALSA: hda/realtek: Enable headset mic of ASUS P5440FF with ALC256
  ALSA: hda/realtek: Enable ASUS X441MB and X705FD headset MIC with ALC256
  ALSA: hda/realtek - Add support for Acer Aspire E5-523G/ES1-432 headset mic
  ALSA: hda/realtek: Enable headset MIC of Acer Aspire Z24-890 with ALC286
  ALSA: hda/realtek: Enable headset MIC of Acer AIO with ALC286
  ALSA: hda/realtek - Add support headset mode for New DELL WYSE NB
  ALSA: hda/realtek - Add support headset mode for DELL WYSE AIO
  ALSA: pcm: Don't suspend stream in unrecoverable PCM state
  ALSA: pcm: Fix possible OOB access in PCM oss plugins
  ALSA: seq: oss: Fix Spectre v1 vulnerability
  ALSA: rawmidi: Fix potential Spectre v1 vulnerability
  net: dsa: qca8k: remove leftover phy accessors
  NFSv4.1 don't free interrupted slot on open
  NFS: fix mount/umount race in nlmclnt.
  vfio: ccw: only free cp on final interrupt
  powerpc: bpf: Fix generation of load/store DW instructions
  ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time
  Btrfs: fix assertion failure on fsync with NO_HOLES enabled
  btrfs: Avoid possible qgroup_rsv_size overflow in btrfs_calculate_inode_block_rsv_size
  btrfs: raid56: properly unmap parity page in finish_parity_scrub()
  btrfs: don't report readahead errors and don't update statistics
  btrfs: remove WARN_ON in log_dir_items
  Btrfs: fix incorrect file size after shrinking truncate and fsync
  powerpc/security: Fix spectre_v2 reporting
  powerpc/fsl: Fix the flush of branch predictor.
  powerpc/fsl: Fixed warning: orphan section `__btb_flush_fixup'
  powerpc/fsl: Update Spectre v2 reporting
  powerpc/fsl: Enable runtime patching if nospectre_v2 boot arg is used
  powerpc/fsl: Flush branch predictor when entering KVM
  powerpc/fsl: Flush the branch predictor at each kernel entry (32 bit)
  powerpc/fsl: Flush the branch predictor at each kernel entry (64bit)
  powerpc/fsl: Add nospectre_v2 command line argument
  powerpc/fsl: Emulate SPRN_BUCSR register
  powerpc/fsl: Add macro to flush the branch predictor
  powerpc/fsl: Add infrastructure to fixup branch predictor flush
  tun: add a missing rcu_read_unlock() in error path
  thunderx: eliminate extra calls to put_page() for pages held for recycling
  thunderx: enable page recycling for non-XDP case
  net: sched: fix cleanup NULL pointer exception in act_mirr
  ila: Fix rhashtable walker list corruption
  vxlan: Don't call gro_cells_destroy() before device is unregistered
  vrf: prevent adding upper devices
  tun: properly test for IFF_UP
  tipc: fix cancellation of topology subscriptions
  tipc: change to check tipc_own_id to return in tipc_net_stop
  tipc: allow service ranges to be connect()'ed on RDM/DGRAM
  tcp: do not use ipv6 header for ipv4 flow
  sctp: use memdup_user instead of vmemdup_user
  sctp: get sctphdr by offset in sctp_compute_cksum
  rhashtable: Still do rehash when we get EEXIST
  packets: Always register packet sk in the same order
  net-sysfs: call dev_hold if kobject_init_and_add success
  net: stmmac: fix memory corruption with large MTUs
  net: rose: fix a possible stack overflow
  net: phy: meson-gxl: fix interrupt support
  net/packet: Set __GFP_NOWARN upon allocation in alloc_pg_vec
  net: datagram: fix unbounded loop in __skb_try_recv_datagram()
  net: aquantia: fix rx checksum offload for UDP/TCP over IPv6
  mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S
  mac8390: Fix mmio access size probe
  ipv6: make ip6_create_rt_rcu return ip6_null_entry instead of NULL
  gtp: change NET_UDP_TUNNEL dependency to select
  genetlink: Fix a memory leak on error path
  dccp: do not use ipv6 header for ipv4 flow
  ipmi_si: Fix crash when using hard-coded device
  Bluetooth: Verify that l2cap_get_conf_opt provides large enough buffer
  Bluetooth: Check L2CAP option sizes returned from l2cap_get_conf_opt
  UPSTREAM: virt_wifi: Remove REGULATORY_WIPHY_SELF_MANAGED

Change-Id: I681a654a3079e9b243bdc46d1e11d5abd6e9d774
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
2019-05-13 01:50:40 -07:00
2902f4cc51 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: Ib963aef88d85e15fcd19cda3d3f0944b530239ab
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2019-05-13 10:24:47 +05:30
9e5cc0c813 sched/walt: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I556b873cc46911953204792d60c60bf151345b1e
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2019-05-13 09:52:58 +05:30
9551c1e703 Merge "cpuset: Restore tasks affinity while moving across cpusets" 2019-05-12 16:39:47 -07:00
93df147ce3 Merge "defconfig: Enable CONFIG_PSI_FTRACE for kona" 2019-05-10 07:01:36 -07:00
1ce9c18dcb Merge "ANDROID: trace/sched: Add tracepoint for sched_overutilized events" 2019-05-10 07:01:34 -07:00
f2aba290b2 sched/walt: Use __GFP_NOFAIL flag for curr/prev window CPU arrays
The system is killed when the memory allocation is failed for
the curr/prev window CPU arrays. Since these are small allocations
and they never fail except in scenarios like

(1) Testing with random memory failures induced
(2) When a fatal signal is pending for the task which is doing
allocations.

Instead of killing the system, use __GFP_NOFAIL flag.

Change-Id: If284814db5a6504b2f039053856ff30c2842808b
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2019-05-09 19:53:46 -07:00
4925b05687 Merge android-4.19.32 (6f994bf) into msm-4.19
* refs/heads/tmp-6f994bf:
  Revert "ANDROID: sched: Disable find_best_target() by default"
  ANDROID: cpufreq: times: don't copy invalid freqs from freq table
  UPSTREAM: filemap: add a comment about FAULT_FLAG_RETRY_NOWAIT behavior
  BACKPORT: filemap: drop the mmap_sem for all blocking operations
  BACKPORT: filemap: kill page_cache_read usage in filemap_fault
  UPSTREAM: filemap: pass vm_fault to the mmap ra helpers
  ANDROID: binder: remove extra declaration left after backport
  FROMGIT: binder: fix BUG_ON found by selinux-testsuite
  ANDROID: sched: Disable find_best_target() by default
  ANDROID: sched/fair: Make the EAS wake-up prefer-idle aware
  Linux 4.19.32
  power: supply: charger-manager: Fix incorrect return value
  ALSA: hda - Enforces runtime_resume after S3 and S4 for each codec
  ALSA: hda - Record the current power state before suspend/resume calls
  locking/lockdep: Add debug_locks check in __lock_downgrade()
  x86/unwind: Add hardcoded ORC entry for NULL
  x86/unwind: Handle NULL pointer calls better in frame unwinder
  loop: access lo_backing_file only when the loop device is Lo_bound
  netfilter: ebtables: remove BUGPRINT messages
  f2fs: fix to avoid deadlock of atomic file operations
  RDMA/cma: Rollback source IP address if failing to acquire device
  drm: Reorder set_property_atomic to avoid returning with an active ww_ctx
  Bluetooth: hci_ldisc: Postpone HCI_UART_PROTO_READY bit set in hci_uart_set_proto()
  Bluetooth: hci_ldisc: Initialize hci_dev before open()
  Bluetooth: Fix decrementing reference count twice in releasing socket
  Bluetooth: hci_uart: Check if socket buffer is ERR_PTR in h4_recv_buf()
  media: v4l2-ctrls.c/uvc: zero v4l2_event
  ext4: brelse all indirect buffer in ext4_ind_remove_space()
  ext4: fix data corruption caused by unaligned direct AIO
  ext4: fix NULL pointer dereference while journal is aborted
  ALSA: ac97: Fix of-node refcount unbalance
  ALSA: hda/ca0132 - make pci_iounmap() call conditional
  ALSA: x86: Fix runtime PM for hdmi-lpe-audio
  SMB3: Fix SMB3.1.1 guest mounts to Samba
  irqchip/gic-v3-its: Fix comparison logic in lpi_range_cmp
  objtool: Move objtool_file struct off the stack
  perf probe: Fix getting the kernel map
  cifs: allow guest mounts to work for smb3.11
  futex: Ensure that futex address is aligned in handle_futex_death()
  scsi: ibmvscsi: Fix empty event pool access during host removal
  scsi: ibmvscsi: Protect ibmvscsi_head from concurrent modificaiton
  powerpc/vdso64: Fix CLOCK_MONOTONIC inconsistencies across Y2038
  MIPS: Fix kernel crash for R6 in jump label branch function
  MIPS: Ensure ELF appended dtb is relocated
  mips: loongson64: lemote-2f: Add IRQF_NO_SUSPEND to "cascade" irqaction.
  udf: Fix crash on IO error during truncate
  libceph: wait for latest osdmap in ceph_monc_blacklist_add()
  iommu/amd: fix sg->dma_address for sg->offset bigger than PAGE_SIZE
  drm/vmwgfx: Return 0 when gmrid::get_node runs out of ID's
  drm/vmwgfx: Don't double-free the mode stored in par->set_mode
  mmc: renesas_sdhi: limit block count to 16 bit for old revisions
  mmc: mxcmmc: "Revert mmc: mxcmmc: handle highmem pages"
  mmc: pxamci: fix enum type confusion
  ALSA: firewire-motu: use 'version' field of unit directory to identify model
  ALSA: hda - add Lenovo IdeaCentre B550 to the power_save_blacklist
  ANDROID: dm-bow: Fix 32 bit compile errors
  UPSTREAM: sched/pelt: Skip updating util_est when utilization is higher than CPU's capacity
  UPSTREAM: sched/fair: Update scale invariance of PELT
  UPSTREAM: sched/fair: Move the rq_of() helper function
  UPSTREAM: sched/fair: Remove setting task's se->runnable_weight during PELT update
  ANDROID: Add dm-bow to cuttlefish configuration
  UPSTREAM: binder: fix handling of misaligned binder object
  UPSTREAM: binder: fix sparse issue in binder_alloc_selftest.c
  BACKPORT: binder: use userspace pointer as base of buffer space
  UPSTREAM: binder: fix kerneldoc header for struct binder_buffer
  BACKPORT: binder: remove user_buffer_offset
  UPSTREAM: binder: remove kernel vm_area for buffer space
  UPSTREAM: binder: avoid kernel vm_area for buffer fixups
  BACKPORT: binder: add function to copy binder object from buffer
  BACKPORT: binder: add functions to copy to/from binder buffers
  UPSTREAM: binder: create userspace-to-binder-buffer copy function
  ANDROID: dm-bow: Add dm-bow feature
  f2fs: set pin_file under CAP_SYS_ADMIN
  f2fs: fix to avoid deadlock in f2fs_read_inline_dir()
  f2fs: fix to adapt small inline xattr space in __find_inline_xattr()
  f2fs: fix to do sanity check with inode.i_inline_xattr_size
  f2fs: give some messages for inline_xattr_size
  f2fs: don't trigger read IO for beyond EOF page
  f2fs: fix to add refcount once page is tagged PG_private
  f2fs: remove wrong comment in f2fs_invalidate_page()
  f2fs: fix to use kvfree instead of kzfree
  f2fs: print more parameters in trace_f2fs_map_blocks
  f2fs: trace f2fs_ioc_shutdown
  f2fs: fix to avoid deadlock of atomic file operations
  f2fs: fix to dirty inode for i_mode recovery
  f2fs: give random value to i_generation
  f2fs: no need to take page lock in readdir
  f2fs: fix to update iostat correctly in IPU path
  f2fs: fix encrypted page memory leak
  f2fs: make fault injection covering __submit_flush_wait()
  f2fs: fix to retry fill_super only if recovery failed
  f2fs: silence VM_WARN_ON_ONCE in mempool_alloc
  f2fs: correct spelling mistake
  f2fs: fix wrong #endif
  f2fs: don't clear CP_QUOTA_NEED_FSCK_FLAG
  f2fs: don't allow negative ->write_io_size_bits
  f2fs: fix to check inline_xattr_size boundary correctly
  Revert "f2fs: fix to avoid deadlock of atomic file operations"
  Revert "f2fs: fix to check inline_xattr_size boundary correctly"
  f2fs: do not use mutex lock in atomic context
  f2fs: fix potential data inconsistence of checkpoint
  f2fs: fix to avoid deadlock of atomic file operations
  f2fs: fix to check inline_xattr_size boundary correctly
  f2fs: jump to label 'free_node_inode' when failing from d_make_root()
  f2fs: fix to document inline_xattr_size option
  f2fs: fix to data block override node segment by mistake
  f2fs: fix typos in code comments
  f2fs: use xattr_prefix to wrap up
  f2fs: sync filesystem after roll-forward recovery
  f2fs: flush quota blocks after turnning it off
  f2fs: avoid null pointer exception in dcc_info
  f2fs: don't wake up too frequently, if there is lots of IOs
  f2fs: try to keep CP_TRIMMED_FLAG after successful umount
  f2fs: add quick mode of checkpoint=disable for QA
  f2fs: run discard jobs when put_super
  f2fs: fix to set sbi dirty correctly
  f2fs: fix to initialize variable to avoid UBSAN/smatch warning
  f2fs: UBSAN: set boolean value iostat_enable correctly
  f2fs: add brackets for macros
  f2fs: check if file namelen exceeds max value
  f2fs: fix to trigger fsck if dirent.name_len is zero
  f2fs: no need to check return value of debugfs_create functions
  f2fs: export FS_NOCOW_FL flag to user
  f2fs: check inject_rate validity during configuring
  f2fs: remove set but not used variable 'err'
  f2fs: fix compile warnings: 'struct *' declared inside parameter list
  f2fs: change error code to -ENOMEM from -EINVAL

Conflicts:
	drivers/md/Kconfig
	kernel/sched/fair.c

Change-Id: I2c6ba055f1160864446c87507a7fd7c8249ad885
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
2019-05-09 00:12:14 -07:00
c811337988 Revert "ANDROID: sched: Disable find_best_target() by default"
This reverts commit 549020c814.

This is a preparation change for merging android-4.19.32 into
msm-4.19 branch.

This change affects scheduler behavior that can lead to boot time
regression.

Change-Id: Iedc341fb5d07e7ba1dd37e4b9b4474a84a3afe11
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
2019-05-09 00:00:28 -07:00
2620eb5a6c ANDROID: trace/sched: Add tracepoint for sched_overutilized events
Change-Id: Ieb46736cb21fe58024c434cd678af0abb8b0d249
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Git-commit: 7022c871dfc7215d32df21936876a4d9bafeaf50
Git-repo: https://android.googlesource.com/kernel/common/
[clingutla@codeaurora.org: Resolved trivial merge conflicts]
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-05-07 10:34:47 +05:30
f6ee05f9fd ANDROID: sched: Per-Sched-domain over utilization
The current implementation of overutilization, aborts energy aware
scheduling if any cpu in the system is over-utilized. This patch introduces
over utilization flag per sched domain level instead of a single flag
system wide. Load balancing is done at the sched domain where any
of the cpu is over utilized. If energy aware scheduling is
enabled and no cpu in a sched domain is overuttilized,
load balancing is skipped for that sched domain and energy aware
scheduling continues at that level.

The implementation takes advantage of the shared sched_domain structure
that is common across all the sched domains at a level. The new flag
introduced is placed in this structure so that all the sched domains the
same level share the flag. In case of an overutilized cpu, the flag gets
set at level1 sched_domain. The flag at the parent sched_domain level gets
set in either of the two following scenarios.
 1. There is a misfit task in one of the cpu's in this sched_domain.
 2. The total utilization of the domain is greater than the domain capacity

The flag is cleared if no cpu in a sched domain is overutilized.

This implementation still can have corner scenarios with respect to
misfit tasks. For example consider a sched group with n cpus and
n+1 70%utilized tasks. Ideally this is a case for load balance to happen
in a parent sched domain. But neither the total group utilization is
high enough for the load balance to be triggered in the parent domain nor
there is a cpu with a single overutilized task so that aload balance is
triggered in a parent domain. But again this could be a purely academic
sceanrio, as during task wake up these tasks will be placed
more appropriately.

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Change-Id: I3f327cff4080096a3e58208dd72c9b7f7913cdb2
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Git-commit: addef37808728c719d8c095a75bcf81befdacdaf
Git-repo: https://android.googlesource.com/kernel/common/
[clingutla@codeaurora.org: Resolved trivial merge conflicts]
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-05-07 10:32:11 +05:30
b4fee475f8 cpuset: Restore tasks affinity while moving across cpusets
When tasks move across cpusets, the current affinity settings
are lost. Cache the task affinity and restore it during cpuset
migration. The restoring happens only when the cached affinity
is subset of the current cpuset settings.

Change-Id: I6c2ec1d5e3d994e176926d94b9e0cc92418020cc
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2019-05-07 08:31:31 +05:30
89a92d8b64 Merge "sched/core: Ensure cpu number is valid" 2019-05-06 15:54:13 -07:00
6228645c2d sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I102a9d2a7a12a3ffe08795825eecf73cdb3ef3e8
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-05-06 11:36:32 +05:30
5c81c0c3bc sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: Ie37ab752a4d69569bce506b0a12715bb45ece79e
Co-developed-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-05-06 11:34:41 +05:30
5e5288787c Merge "sched: Improve the scheduler" 2019-05-05 19:24:56 -07:00
21c4539562 Merge "sched/fair: correctly handle cpus with same energy costs" 2019-05-04 23:05:14 -07:00
70494e6b0d sched/fair: correctly handle cpus with same energy costs
When energy delta is same as the chosen cpu, the energy model simply
rejects the new cpu.

This is incorrect behaviour, because it ends up selecting the cpu it
visits first. It should break ties intelligently - fix it such that
it prefers cpu in a shallower idle state.

Implement this.

Change-Id: I82f39163e71037eca05ea52c69800a71b1fdcc27
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2019-05-03 16:47:56 -07:00
c208338efc power: em: correct increasing freq/power ratio
As freq increases freq/power should decrease, indicating nonlinearly
higher power is required for running at higher frequencies.

If freq/power increases, the cost associated with that
freq will be lower than its previous one, causing the energy
calculations to choose a cpu with that frequency over a cpu with
the previous lesser freq.

For some frequencies, if their voltage increment from the
previous ones is very small (or is the same), we could end up with
higher freq/power ratio. This is primarily because
of_dev_pm_opp_get_cpu_power() returns power in mW and looses precision.

But instead of addressing it, enforce the same cost as the previous
frequency.

The energy evaluation code prefers the previous cpu when the energy costs
are same as other candidates. By keeping the energy costs same in these
situations we are increasing the likely hood of selecting prev cpu even
if it results in a slight freq bump. In general, selecting prev cpu is
beneficial because it avoids warming up the caches at a different cpu.

Change-Id: Ic66ab18ba65f2917b73d9fbe92a39b743b9839a0
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2019-05-03 16:47:38 -07:00
760bc8ba85 Merge "cpufreq: schedutil: Add fast switch to sugov_limits path" 2019-05-03 15:36:13 -07:00
344e3f9eb5 psi: Introduce ftrace events
Add ftrace events to capture per-zone memory stats when a
trigger threshold is hit.

Change-Id: Ic52a27713acd34090c8f99543408b277877015c7
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2019-05-02 12:16:12 -07:00
4aff5ce464 Merge "sched/fair: Remove a duplicate trace print" 2019-05-02 05:13:35 -07:00
e4e592b959 Merge "sched/fair: Fix previous CPU util calculation in cpu_util_next_walt()" 2019-05-01 10:57:21 -07:00
1e525b68fe Merge "Merge android-4.19.31 (bb418a1) into msm-4.19" 2019-05-01 10:57:19 -07:00
4693ecc8a5 Merge "sched: move up-down migration handler out of CGROUP_SCHED" 2019-04-30 14:03:43 -07:00
f24f4114bb sched/core: Ensure cpu number is valid
Sched_cpu_isolate takes cpu number as input. The input is not
being checked against the NR_CPUS which could potentially
overflow the buffer cpu_isolation_vote. Fix it by checking the
boundary.

Change-Id: If5e07b2481454b539ccdca15a302722478d22df4
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2019-04-30 14:02:55 -07:00
05cbcfccfb sched/fair: Remove a duplicate trace print
If the FBT takes the fast path for prev_cpu, a duplicate trace_print
would occur and shares no additional information. Clean this addtional
trace_print.

Change-Id: I3257ffab03b6ba27bec226609b553ff25297e513
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2019-04-30 11:49:10 -07:00
7ede1bd9ad Merge "sched: Cleanup unused variables in walt" 2019-04-28 00:32:53 -07:00
e309c5e8d0 Merge "sched/fair: Add sched_compute_energy trace point" 2019-04-27 23:38:20 -07:00
64067611d1 sched: move up-down migration handler out of CGROUP_SCHED
Below compilation issues are observed when CGROUP_SCHED is
disabled.

kernel/sysctl.o:(.data+0x3e0): \
		undefined reference to `sched_updown_migrate_handler'
kernel/sysctl.o:(.data+0x420): \
		undefined reference to `sched_updown_migrate_handler'

Change-Id: Ia746482b4a48708530788d0ccc187aa9cf03b771
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2019-04-27 23:25:20 -07:00
4044207ca5 sched/fair: Fix previous CPU util calculation in cpu_util_next_walt()
When a task is waking and both evaluation CPU and the destination
CPU are the task's previous CPU, the task utilization must be
added to the evaluation CPU's utilization. But it is not done.
Due to this the task may get placed on the previous CPU incorrectly
and results in suboptimal power and performance.

Change-Id: I62b5eec3046b7fef31321125dd76f67afe8f567d
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2019-04-23 08:51:21 +05:30
88aaac7a4b sched/fair: Add sched_compute_energy trace point
Add sched_compute_energy trace point to aid the task placement
issues debugging. It prints the energy of all the evaluated
CPUs and the best_energy for each iteration.

Change-Id: I965a950de5006bdc601a9fcc146d8d619409dd8f
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2019-04-23 08:46:28 +05:30
bee33a548a sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I4c56a1111d983b2a690cbce03787ff1d82f6f506
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-04-20 19:17:08 +05:30
12644d0eea sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I8a65125f4f5a123f5a9551a6a4876e81d1b77dcf
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-04-20 19:17:08 +05:30
c9a7c3f48d sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I090ed8f91592646f11dd65bc83357945f02702cd
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-04-20 19:17:08 +05:30
72e5218644 sched: fair: Utilize more higher capacity cpus in asymmetric systems
The current fbt starts the CPU search from the suitable
sched_group/cluster. If an eligible CPU (either busy or idle) is found
in this primary cluster, we break and use this eligible CPU. The search
is expanded to the other cluster only when either an eligible CPU is
not found or boost is enabled. This works for the existing topologies
like 6 + 2 or 4 + 3 + 1 systems. However with a topology like 6 + 1 + 1
where the mid capacity cluster has only 1 CPU, this policy results in
excessive packing on that single CPU. So expand the search to the higher
capacity CPU as well when the start cluster is mid capacity cluster.
The exception is when the mid capacity CPU is idle. This is a power
optimization to not to use the higher capacity CPU more.

Change-Id: I15c591dc2f61fbef203545c86e038a0ff918806c
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-04-20 19:17:08 +05:30
be305c4745 sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I7b080f2acc4ae978a0086b08ddc81a0ef98f24e6
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2019-04-20 19:17:08 +05:30
394b89e4b2 cpufreq: schedutil: Add fast switch to sugov_limits path
When new cpufreq min/max limits are set, the expectation is that the CPU
frequency will be updated appropriately.  This happens for targets which do
not utilize the cpufreq fast switch APIs, but the code to do this is not
present by default for the fast switch path.  Add the necessary code to
update frequency to reflect the new cpufreq limits for targets with fast
switch enabled.

Change-Id: I211b6117005df9d340dfe0d825032cd7600cbffa
Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
2019-04-18 12:09:20 -07:00