Skip to content
  1. Dec 07, 2016
    • Kra1o5's avatar
      namek: Enable core_ctl · e1f149ac
      Kra1o5 authored
      e1f149ac
    • Pavankumar Kondeti's avatar
      core_ctl: Manage number of online cores based on system load · fba06f0c
      Pavankumar Kondeti authored
      
      
      The core_ctl module takes input from userspace and CPU load information to
      decide how many CPUs to keep online. User space has the following tunables:
      
      - min_cpus: Minimum number of CPUs to keep online. This overrides other
        heuristics.
      - max_cpus: Maximum number of CPUs to keep online. This overrides other
        heuristics.
      - additional_cpus: Additional idle CPUs to keep ready for use.
      - busy_up_thres: The normalized load% threshold that the CPU load should
        exceeded for the CPU to be go from not busy to busy.
        It could be a single threshold for all CPUs in a group, or num_cpus
        thresholds separated by spaces to specify different thresholds based on
        the current number of online CPUs.
      - busy_down_thres: The normalized load% threshold that the CPU load should
        be lower than for the CPU to go from busy to not busy.
        It could be a single threshold for all CPUs in a group, or num_cpus
        thresholds separated by spaces to specify different thresholds based on
        the current number of online CPUs.
      - offline_delay_ms: The time to wait for before offline cores when the
        number of needed CPUs goes down.
      
      Mot-CRs-fixed: (CR)
      
      Change-Id: Ied1d5bcbb8da5bbd5f3d1a3f042599babace6b65
      Signed-off-by: default avatarSaravana Kannan <skannan@codeaurora.org>
      Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
      Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
      Signed-off-by: default avatarRavi Chebolu <arc095@motorola.com>
      Reviewed-on: http://gerrit.mot.com/866560
      
      
      SME-Granted: SME Approvals Granted
      SLTApproved: Slta Waiver <sltawvr@motorola.com>
      Tested-by: default avatarJira Key <jirakey@motorola.com>
      Reviewed-by: default avatarLian-Wei Wang <lian-wei.wang@motorola.com>
      Reviewed-by: default avatarChristopher Fries <cfries@motorola.com>
      Submit-Approved: Jira Key <jirakey@motorola.com>
      fba06f0c
    • Srivatsa Vaddagiri's avatar
      sched: Keep track of average nr_big_tasks · b6b92bad
      Srivatsa Vaddagiri authored
      
      
      Extend sched_get_nr_running_avg() API to return average nr_big_tasks,
      in addition to average nr_running and average nr_io_wait tasks. Also
      add a new trace point to record values returned by
      sched_get_nr_running_avg() API.
      
      Change-Id: Id3591e6d04da8db484b4d1cb9d95dba075f5ab9a
      Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@codeaurora.org>
      [rameezmustafa@codeaurora.org: Resolve trivial merge conflicts]
      Signed-off-by: default avatarSyed Rameez Mustafa <rameezmustafa@codeaurora.org>
      b6b92bad
    • Srivatsa Vaddagiri's avatar
      sched: Fix bug in average nr_running and nr_iowait calculation · 87321203
      Srivatsa Vaddagiri authored
      
      
      sched_get_nr_running_avg() returns average nr_running and nr_iowait
      task count since it was last invoked. Fix several bugs in their
      calculation.
      
      * sched_update_nr_prod() needs to consider that nr_running count can
        change by more than 1 when CFS_BANDWIDTH feature is used
      
      * sched_get_nr_running_avg() needs to sum up nr_iowait count across
        all cpus, rather than just one
      
      * sched_get_nr_running_avg() could race with sched_update_nr_prod(),
        as a result of which it could use curr_time which is behind a cpu's
        'last_time' value. That would lead to erroneous calculation of
        average nr_running or nr_iowait.
      
      While at it, fix also a bug in BUG_ON() check in
      sched_update_nr_prod() function and remove unnecessary nr_running
      argument to sched_update_nr_prod() function.
      
      Change-Id: I46737614737292fae0d7204c4648fb9b862f65b2
      Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@codeaurora.org>
      87321203
    • Kra1o5's avatar
  2. Dec 06, 2016
  3. Nov 27, 2016
  4. Nov 26, 2016
  5. Nov 23, 2016
  6. Nov 21, 2016
  7. Nov 20, 2016
  8. Nov 18, 2016
    • Swetha Chikkaboraiah's avatar
      qcom: scm: remove printing input arguments · dab8fd3f
      Swetha Chikkaboraiah authored
      
      
      scm_call2 is printing the input arguments if TZ ret value is  < 0
      leading to information leak. Remove printing input arguments.
      
      Change-Id: I21dd6d83fa979aed2c79ebb2c9c8de63a247dded
      CRs-Fixed: 1076407
      Signed-off-by: default avatarSwetha Chikkaboraiah <schikk@codeaurora.org>
      dab8fd3f
    • Omar Sandoval's avatar
      block: fix use-after-free in sys_ioprio_get() · 3d9b1efe
      Omar Sandoval authored
      
      
      get_task_ioprio() accesses the task->io_context without holding the task
      lock and thus can race with exit_io_context(), leading to a
      use-after-free. The reproducer below hits this within a few seconds on
      my 4-core QEMU VM:
      
      int main(int argc, char **argv)
      {
      	pid_t pid, child;
      	long nproc, i;
      
      	/* ioprio_set(IOPRIO_WHO_PROCESS, 0, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0)); */
      	syscall(SYS_ioprio_set, 1, 0, 0x6000);
      
      	nproc = sysconf(_SC_NPROCESSORS_ONLN);
      
      	for (i = 0; i < nproc; i++) {
      		pid = fork();
      		assert(pid != -1);
      		if (pid == 0) {
      			for (;;) {
      				pid = fork();
      				assert(pid != -1);
      				if (pid == 0) {
      					_exit(0);
      				} else {
      					child = wait(NULL);
      					assert(child == pid);
      				}
      			}
      		}
      
      		pid = fork();
      		assert(pid != -1);
      		if (pid == 0) {
      			for (;;) {
      				/* ioprio_get(IOPRIO_WHO_PGRP, 0); */
      				syscall(SYS_ioprio_get, 2, 0);
      			}
      		}
      	}
      
      	for (;;) {
      		/* ioprio_get(IOPRIO_WHO_PGRP, 0); */
      		syscall(SYS_ioprio_get, 2, 0);
      	}
      
      	return 0;
      }
      
      This gets us KASAN dumps like this:
      
      [   35.526914] ==================================================================
      [   35.530009] BUG: KASAN: out-of-bounds in get_task_ioprio+0x7b/0x90 at addr ffff880066f34e6c
      [   35.530009] Read of size 2 by task ioprio-gpf/363
      [   35.530009] =============================================================================
      [   35.530009] BUG blkdev_ioc (Not tainted): kasan: bad access detected
      [   35.530009] -----------------------------------------------------------------------------
      
      [   35.530009] Disabling lock debugging due to kernel taint
      [   35.530009] INFO: Allocated in create_task_io_context+0x2b/0x370 age=0 cpu=0 pid=360
      [   35.530009] 	___slab_alloc+0x55d/0x5a0
      [   35.530009] 	__slab_alloc.isra.20+0x2b/0x40
      [   35.530009] 	kmem_cache_alloc_node+0x84/0x200
      [   35.530009] 	create_task_io_context+0x2b/0x370
      [   35.530009] 	get_task_io_context+0x92/0xb0
      [   35.530009] 	copy_process.part.8+0x5029/0x5660
      [   35.530009] 	_do_fork+0x155/0x7e0
      [   35.530009] 	SyS_clone+0x19/0x20
      [   35.530009] 	do_syscall_64+0x195/0x3a0
      [   35.530009] 	return_from_SYSCALL_64+0x0/0x6a
      [   35.530009] INFO: Freed in put_io_context+0xe7/0x120 age=0 cpu=0 pid=1060
      [   35.530009] 	__slab_free+0x27b/0x3d0
      [   35.530009] 	kmem_cache_free+0x1fb/0x220
      [   35.530009] 	put_io_context+0xe7/0x120
      [   35.530009] 	put_io_context_active+0x238/0x380
      [   35.530009] 	exit_io_context+0x66/0x80
      [   35.530009] 	do_exit+0x158e/0x2b90
      [   35.530009] 	do_group_exit+0xe5/0x2b0
      [   35.530009] 	SyS_exit_group+0x1d/0x20
      [   35.530009] 	entry_SYSCALL_64_fastpath+0x1a/0xa4
      [   35.530009] INFO: Slab 0xffffea00019bcd00 objects=20 used=4 fp=0xffff880066f34ff0 flags=0x1fffe0000004080
      [   35.530009] INFO: Object 0xffff880066f34e58 @offset=3672 fp=0x0000000000000001
      [   35.530009] ==================================================================
      
      Fix it by grabbing the task lock while we poke at the io_context.
      
      Change-Id: Icacf9fc31e35e8914d0724dbdf0c76954bd5291e
      Cc: stable@vger.kernel.org
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      Git-repo: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git
      
      
      Git-commit: 8ba8682107ee2ca3347354e018865d8e1967c5f4
      Signed-off-by: default avatarRavi Kumar Siddojigari <rsiddoji@codeaurora.org>
      3d9b1efe
    • Arve Hjønnevåg's avatar
      ANDROID: binder: Add strong ref checks · a130ab61
      Arve Hjønnevåg authored
      
      
      Prevent using a binder_ref with only weak references where a strong
      reference is required..
      
      BUG: 30445380
      Change-Id: I66c15b066808f28bd27bfe50fd0e03ff45a09fca
      Signed-off-by: default avatarArve Hjønnevåg <arve@android.com>
      Git-repo: https://android.googlesource.com/kernel/msm.git
      
      
      Git-commit: 5e2a2bc89956ae1c739854403408059144b23c28
      [d-cagle@codeaurora.org: Resolve trivial merge conflicts]
      Signed-off-by: default avatarDennis Cagle <d-cagle@codeaurora.org>
      a130ab61
    • Sudheer Papothi's avatar
      drivers: qcom: ultrasound: Lock async driver calls · e4609838
      Sudheer Papothi authored
      
      
      Adds lock to ioctl and other external calls to driver.
      Adds missing null check in __usf_set_stream_param.
      
      Change-Id: I142f31c6bb46d6a394ad012077e1703875a120ad
      Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
      e4609838
Loading