OSDN Git Service

Merge android-4.4@9f764bb (v4.4.80) into msm-4.4
authorBlagovest Kolenichev <bkolenichev@codeaurora.org>
Tue, 15 Aug 2017 14:26:34 +0000 (07:26 -0700)
committerBlagovest Kolenichev <bkolenichev@codeaurora.org>
Tue, 15 Aug 2017 16:32:23 +0000 (09:32 -0700)
* refs/heads/tmp-9f764bb
  Linux 4.4.80
  ASoC: dpcm: Avoid putting stream state to STOP when FE stream is paused
  scsi: snic: Return error code on memory allocation failure
  scsi: fnic: Avoid sending reset to firmware when another reset is in progress
  HID: ignore Petzl USB headlamp
  ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion
  sh_eth: enable RX descriptor word 0 shift on SH7734
  nvmem: imx-ocotp: Fix wrong register size
  arm64: mm: fix show_pte KERN_CONT fallout
  vfio-pci: Handle error from pci_iomap
  video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap
  perf symbols: Robustify reading of build-id from sysfs
  perf tools: Install tools/lib/traceevent plugins with install-bin
  xfrm: Don't use sk_family for socket policy lookups
  tools lib traceevent: Fix prev/next_prio for deadline tasks
  Btrfs: adjust outstanding_extents counter properly when dio write is split
  usb: gadget: Fix copy/pasted error message
  ACPI / scan: Prefer devices without _HID/_CID for _ADR matching
  ARM: s3c2410_defconfig: Fix invalid values for NF_CT_PROTO_*
  ARM64: zynqmp: Fix i2c node's compatible string
  ARM64: zynqmp: Fix W=1 dtc 1.4 warnings
  dmaengine: ti-dma-crossbar: Add some 'of_node_put()' in error path.
  dmaengine: ioatdma: workaround SKX ioatdma version
  dmaengine: ioatdma: Add Skylake PCI Dev ID
  openrisc: Add _text symbol to fix ksym build error
  irqchip/mxs: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND
  ASoC: nau8825: fix invalid configuration in Pre-Scalar of FLL
  spi: dw: Make debugfs name unique between instances
  ASoC: tlv320aic3x: Mark the RESET register as volatile
  irqchip/keystone: Fix "scheduling while atomic" on rt
  vfio-pci: use 32-bit comparisons for register address for gcc-4.5
  drm/msm: Verify that MSM_SUBMIT_BO_FLAGS are set
  drm/msm: Ensure that the hardware write pointer is valid
  net/mlx4: Remove BUG_ON from ICM allocation routine
  ipv6: Should use consistent conditional judgement for ip6 fragment between __ip6_append_data and ip6_finish_output
  ARM: dts: n900: Mark eMMC slot with no-sdio and no-sd flags
  r8169: add support for RTL8168 series add-on card.
  x86/mce/AMD: Make the init code more robust
  tpm: Replace device number bitmap with IDR
  tpm: fix a kernel memory leak in tpm-sysfs.c
  xen/blkback: don't use xen_blkif_get() in xen-blkback kthread
  xen/blkback: don't free be structure too early
  sched/cputime: Fix prev steal time accouting during CPU hotplug
  net: skb_needs_check() accepts CHECKSUM_NONE for tx
  pstore: Use dynamic spinlock initializer
  pstore: Correctly initialize spinlock and flags
  pstore: Allow prz to control need for locking
  vlan: Propagate MAC address to VLANs
  /proc/iomem: only expose physical resource addresses to privileged users
  Make file credentials available to the seqfile interfaces
  v4l: s5c73m3: fix negation operator
  dentry name snapshots
  ipmi/watchdog: fix watchdog timeout set on reboot
  libnvdimm, btt: fix btt_rw_page not returning errors
  RDMA/uverbs: Fix the check for port number
  PM / Domains: defer dev_pm_domain_set() until genpd->attach_dev succeeds if present
  sched/cgroup: Move sched_online_group() back into css_online() to fix crash
  kaweth: fix oops upon failed memory allocation
  kaweth: fix firmware download
  mpt3sas: Don't overreach ioc->reply_post[] during initialization
  mailbox: handle empty message in tx_tick
  mailbox: skip complete wait event if timer expired
  mailbox: always wait in mbox_send_message for blocking Tx mode
  wil6210: fix deadlock when using fw_no_recovery option
  ath10k: fix null deref on wmi-tlv when trying spectral scan
  isdn/i4l: fix buffer overflow
  isdn: Fix a sleep-in-atomic bug
  net: phy: Do not perform software reset for Generic PHY
  nfc: fdp: fix NULL pointer dereference
  xfs: don't BUG() on mixed direct and mapped I/O
  perf intel-pt: Ensure never to set 'last_ip' when packet 'count' is zero
  perf intel-pt: Use FUP always when scanning for an IP
  perf intel-pt: Fix last_ip usage
  perf intel-pt: Fix ip compression
  drm: rcar-du: Simplify and fix probe error handling
  drm: rcar-du: Perform initialization/cleanup at probe/remove time
  drm/rcar: Nuke preclose hook
  Staging: comedi: comedi_fops: Avoid orphaned proc entry
  Revert "powerpc/numa: Fix percpu allocations to be NUMA aware"
  KVM: PPC: Book3S HV: Save/restore host values of debug registers
  KVM: PPC: Book3S HV: Reload HTM registers explicitly
  KVM: PPC: Book3S HV: Restore critical SPRs to host values on guest exit
  KVM: PPC: Book3S HV: Context-switch EBB registers properly
  drm/nouveau/bar/gf100: fix access to upper half of BAR2
  drm/vmwgfx: Fix gcc-7.1.1 warning
  md/raid5: add thread_group worker async_tx_issue_pending_all
  crypto: authencesn - Fix digest_null crash
  powerpc/pseries: Fix of_node_put() underflow during reconfig remove
  net: reduce skb_warn_bad_offload() noise
  pstore: Make spinlock per zone instead of global
  af_key: Add lock to key dump
  ANDROID: binder: Don't BUG_ON(!spin_is_locked()).
  Linux 4.4.79
  alarmtimer: don't rate limit one-shot timers
  tracing: Fix kmemleak in instance_rmdir
  spmi: Include OF based modalias in device uevent
  of: device: Export of_device_{get_modalias, uvent_modalias} to modules
  drm/mst: Avoid processing partially received up/down message transactions
  drm/mst: Avoid dereferencing a NULL mstb in drm_dp_mst_handle_up_req()
  drm/mst: Fix error handling during MST sideband message reception
  RDMA/core: Initialize port_num in qp_attr
  ceph: fix race in concurrent readdir
  staging: rtl8188eu: add TL-WN722N v2 support
  Revert "perf/core: Drop kernel samples even though :u is specified"
  perf annotate: Fix broken arrow at row 0 connecting jmp instruction to its target
  target: Fix COMPARE_AND_WRITE caw_sem leak during se_cmd quiesce
  udf: Fix deadlock between writeback and udf_setsize()
  NFS: only invalidate dentrys that are clearly invalid.
  Input: i8042 - fix crash at boot time
  MIPS: Fix a typo: s/preset/present/ in r2-to-r6 emulation error message
  MIPS: Send SIGILL for linked branches in `__compute_return_epc_for_insn'
  MIPS: Rename `sigill_r6' to `sigill_r2r6' in `__compute_return_epc_for_insn'
  MIPS: Send SIGILL for BPOSGE32 in `__compute_return_epc_for_insn'
  MIPS: math-emu: Prevent wrong ISA mode instruction emulation
  MIPS: Fix unaligned PC interpretation in `compute_return_epc'
  MIPS: Actually decode JALX in `__compute_return_epc_for_insn'
  MIPS: Save static registers before sysmips
  MIPS: Fix MIPS I ISA /proc/cpuinfo reporting
  x86/ioapic: Pass the correct data to unmask_ioapic_irq()
  x86/acpi: Prevent out of bound access caused by broken ACPI tables
  MIPS: Negate error syscall return in trace
  MIPS: Fix mips_atomic_set() with EVA
  MIPS: Fix mips_atomic_set() retry condition
  ftrace: Fix uninitialized variable in match_records()
  vfio: New external user group/file match
  vfio: Fix group release deadlock
  f2fs: Don't clear SGID when inheriting ACLs
  ipmi:ssif: Add missing unlock in error branch
  ipmi: use rcu lock around call to intf->handlers->sender()
  drm/radeon: Fix eDP for single-display iMac10,1 (v2)
  drm/radeon/ci: disable mclk switching for high refresh rates (v2)
  drm/amd/amdgpu: Return error if initiating read out of range on vram
  s390/syscalls: Fix out of bounds arguments access
  Raid5 should update rdev->sectors after reshape
  cx88: Fix regression in initial video standard setting
  x86/xen: allow userspace access during hypercalls
  md: don't use flush_signals in userspace processes
  usb: renesas_usbhs: gadget: disable all eps when the driver stops
  usb: renesas_usbhs: fix usbhsc_resume() for !USBHSF_RUNTIME_PWCTRL
  USB: cdc-acm: add device-id for quirky printer
  usb: storage: return on error to avoid a null pointer dereference
  xhci: Fix NULL pointer dereference when cleaning up streams for removed host
  xhci: fix 20000ms port resume timeout
  ipvs: SNAT packet replies only for NATed connections
  PCI/PM: Restore the status of PCI devices across hibernation
  af_key: Fix sadb_x_ipsecrequest parsing
  powerpc/asm: Mark cr0 as clobbered in mftb()
  powerpc: Fix emulation of mfocrf in emulate_step()
  powerpc: Fix emulation of mcrf in emulate_step()
  powerpc/64: Fix atomic64_inc_not_zero() to return an int
  iscsi-target: Add login_keys_workaround attribute for non RFC initiators
  scsi: ses: do not add a device to an enclosure if enclosure_add_links() fails.
  PM / Domains: Fix unsafe iteration over modified list of domain providers
  PM / Domains: Fix unsafe iteration over modified list of device links
  ASoC: compress: Derive substream from stream based on direction
  wlcore: fix 64K page support
  Bluetooth: use constant time memory comparison for secret values
  perf intel-pt: Clear FUP flag on error
  perf intel-pt: Ensure IP is zero when state is INTEL_PT_STATE_NO_IP
  perf intel-pt: Fix missing stack clear
  perf intel-pt: Improve sample timestamp
  perf intel-pt: Move decoder error setting into one condition
  NFC: Add sockaddr length checks before accessing sa_family in bind handlers
  nfc: Fix the sockaddr length sanitization in llcp_sock_connect
  nfc: Ensure presence of required attributes in the activate_target handler
  NFC: nfcmrvl: fix firmware-management initialisation
  NFC: nfcmrvl: use nfc-device for firmware download
  NFC: nfcmrvl: do not use device-managed resources
  NFC: nfcmrvl_uart: add missing tty-device sanity check
  NFC: fix broken device allocation
  ath9k: fix tx99 bus error
  ath9k: fix tx99 use after free
  thermal: cpu_cooling: Avoid accessing potentially freed structures
  s5p-jpeg: don't return a random width/height
  ir-core: fix gcc-7 warning on bool arithmetic
  disable new gcc-7.1.1 warnings for now
  sched/fair: Add a backup_cpu to find_best_target
  sched/fair: Try to estimate possible idle states.
  sched/fair: Sync task util before EAS wakeup
  Revert "sched/fair: ensure utilization signals are synchronized before use"
  sched/fair: kick nohz idle balance for misfit task
  sched/fair: Update signals of nohz cpus if we are going idle
  events: add tracepoint for find_best_target
  sched/fair: streamline find_best_target heuristics
  UPSTREAM: af_key: Fix sadb_x_ipsecrequest parsing
  ANDROID: lowmemorykiller: Add tgid to kill message
  Revert "proc: smaps: Allow smaps access for CAP_SYS_RESOURCE"

Conflicts:
drivers/gpu/drm/msm/adreno/adreno_gpu.c
drivers/gpu/drm/msm/msm_ringbuffer.c
drivers/staging/android/lowmemorykiller.c
kernel/sched/fair.c

Change-Id: Ic3b3a522b79b1deb178e513b56b9c39eea48e079
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
26 files changed:
1  2 
Makefile
arch/arm64/mm/fault.c
drivers/android/binder.c
drivers/hid/hid-core.c
drivers/net/wireless/ath/ath10k/wmi-ops.h
drivers/spmi/spmi.c
drivers/staging/android/lowmemorykiller.c
drivers/thermal/cpu_cooling.c
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-ring.c
fs/dcache.c
fs/namei.c
include/trace/events/sched.h
kernel/events/core.c
kernel/fork.c
kernel/resource.c
kernel/sched/core.c
kernel/sched/fair.c
kernel/time/alarmtimer.c
kernel/trace/trace.c
net/bluetooth/smp.c
net/core/dev.c
net/ipv6/ip6_output.c
net/xfrm/xfrm_policy.c
sound/usb/endpoint.c
tools/perf/Makefile.perf

diff --cc Makefile
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -533,21 -176,12 +533,21 @@@ static unsigned long lowmem_scan(struc
                if (selected->mm)
                        mark_oom_victim(selected);
                task_unlock(selected);
 +              cache_size = other_file * (long)(PAGE_SIZE / 1024);
 +              cache_limit = minfree * (long)(PAGE_SIZE / 1024);
 +              free = other_free * (long)(PAGE_SIZE / 1024);
                trace_lowmemory_kill(selected, cache_size, cache_limit, free);
-               lowmem_print(1, "Killing '%s' (%d), adj %hd,\n" \
+               lowmem_print(1, "Killing '%s' (%d) (tgid %d), adj %hd,\n" \
                                "   to free %ldkB on behalf of '%s' (%d) because\n" \
                                "   cache %ldkB is below limit %ldkB for oom_score_adj %hd\n" \
 -                              "   Free memory is %ldkB above reserved\n",
 +                              "   Free memory is %ldkB above reserved.\n" \
 +                              "   Free CMA is %ldkB\n" \
 +                              "   Total reserve is %ldkB\n" \
 +                              "   Total free pages is %ldkB\n" \
 +                              "   Total file cache is %ldkB\n" \
 +                              "   Total zcache is %ldkB\n" \
 +                              "   GFP mask is 0x%x\n",
-                            selected->comm, selected->pid,
+                            selected->comm, selected->pid, selected->tgid,
                             selected_oom_score_adj,
                             selected_tasksize * (long)(PAGE_SIZE / 1024),
                             current->comm, current->pid,
Simple merge
Simple merge
Simple merge
diff --cc fs/dcache.c
Simple merge
diff --cc fs/namei.c
Simple merge
Simple merge
Simple merge
diff --cc kernel/fork.c
Simple merge
Simple merge
Simple merge
  #include <linux/task_work.h>
  #include <linux/module.h>
  
 -#include <trace/events/sched.h>
 -
  #include "sched.h"
 +#include <trace/events/sched.h>
  #include "tune.h"
+ #include "walt.h"
  /*
   * Targeted preemption latency for CPU-bound tasks:
   * (default: 6ms * (1 + ilog(ncpus)), units: nanoseconds)
@@@ -7580,20 -6638,9 +7790,13 @@@ select_task_rq_fair(struct task_struct 
        int want_affine = 0;
        int sync = wake_flags & WF_SYNC;
  
-       if (sd_flag & SD_BALANCE_WAKE) {
-               /*
-                * do wake_cap unconditionally as it causes task and cpu
-                * utilization to be synced, and we need that for energy
-                * aware wakeups
-                */
-               int _wake_cap = wake_cap(p, cpu, prev_cpu);
-               want_affine = !wake_wide(p) && !_wake_cap
 +#ifdef CONFIG_SCHED_HMP
 +      return select_best_cpu(p, prev_cpu, 0, sync);
 +#endif
 +
+       if (sd_flag & SD_BALANCE_WAKE)
+               want_affine = !wake_wide(p) && !wake_cap(p, cpu, prev_cpu)
                              && cpumask_test_cpu(cpu, tsk_cpus_allowed(p));
-       }
  
        if (energy_aware() && !(cpu_rq(prev_cpu)->rd->overutilized))
                return select_energy_cpu_brute(p, prev_cpu, sync);
@@@ -9212,14 -8164,12 +9447,20 @@@ static inline void update_sg_lb_stats(s
        for_each_cpu_and(i, sched_group_cpus(group), env->cpus) {
                struct rq *rq = cpu_rq(i);
  
 +              trace_sched_cpu_load_lb(cpu_rq(i), idle_cpu(i),
 +                                   sched_irqload(i),
 +                                   power_cost(i, 0),
 +                                   cpu_temp(i));
 +
 +              if (cpu_isolated(i))
 +                      continue;
 +
+               /* if we are entering idle and there are CPUs with
+                * their tick stopped, do an update for them
+                */
+               if (env->idle == CPU_NEWLY_IDLE)
+                       update_cpu_stats_if_tickless(rq);
                /* Bias balancing toward cpus of our domain */
                if (local_group)
                        load = target_load(i, load_idx);
@@@ -10680,54 -9410,9 +10921,49 @@@ static inline int on_null_domain(struc
   *   needed, they will kick the idle load balancer, which then does idle
   *   load balancing for all the idle CPUs.
   */
- static struct {
-       cpumask_var_t idle_cpus_mask;
-       atomic_t nr_cpus;
-       unsigned long next_balance;     /* in jiffy units */
- } nohz ____cacheline_aligned;
 -static inline int find_new_ilb(void)
 +
 +#ifdef CONFIG_SCHED_HMP
 +static inline int find_new_hmp_ilb(int type)
 +{
 +      int call_cpu = raw_smp_processor_id();
 +      struct sched_domain *sd;
 +      int ilb;
 +
 +      rcu_read_lock();
 +
 +      /* Pick an idle cpu "closest" to call_cpu */
 +      for_each_domain(call_cpu, sd) {
 +              for_each_cpu_and(ilb, nohz.idle_cpus_mask,
 +                                              sched_domain_span(sd)) {
 +                      if (idle_cpu(ilb) && (type != NOHZ_KICK_RESTRICT ||
 +                                      cpu_max_power_cost(ilb) <=
 +                                      cpu_max_power_cost(call_cpu))) {
 +                              rcu_read_unlock();
 +                              reset_balance_interval(ilb);
 +                              return ilb;
 +                      }
 +              }
 +      }
 +
 +      rcu_read_unlock();
 +      return nr_cpu_ids;
 +}
 +#else /* CONFIG_SCHED_HMP */
 +static inline int find_new_hmp_ilb(int type)
 +{
 +      return 0;
 +}
 +#endif        /* CONFIG_SCHED_HMP */
 +
 +static inline int find_new_ilb(int type)
  {
 -      int ilb = cpumask_first(nohz.idle_cpus_mask);
 +      int ilb;
 +
 +#ifdef CONFIG_SCHED_HMP
 +      return find_new_hmp_ilb(type);
 +#endif
 +
 +      ilb = cpumask_first(nohz.idle_cpus_mask);
  
        if (ilb < nr_cpu_ids && idle_cpu(ilb))
                return ilb;
        clear_bit(NOHZ_BALANCE_KICK, nohz_flags(this_cpu));
  }
  
 +#ifdef CONFIG_SCHED_HMP
 +static inline int _nohz_kick_needed_hmp(struct rq *rq, int cpu, int *type)
 +{
 +      struct sched_domain *sd;
 +      int i;
 +
 +      if (rq->nr_running < 2)
 +              return 0;
 +
 +      if (!sysctl_sched_restrict_cluster_spill ||
 +                      sched_boost_policy() == SCHED_BOOST_ON_ALL)
 +              return 1;
 +
 +      if (cpu_max_power_cost(cpu) == max_power_cost)
 +              return 1;
 +
 +      rcu_read_lock();
 +      sd = rcu_dereference_check_sched_domain(rq->sd);
 +      if (!sd) {
 +              rcu_read_unlock();
 +              return 0;
 +      }
 +
 +      for_each_cpu(i, sched_domain_span(sd)) {
 +              if (cpu_load(i) < sched_spill_load &&
 +                              cpu_rq(i)->nr_running <
 +                              sysctl_sched_spill_nr_run) {
 +                      /* Change the kick type to limit to CPUs that
 +                       * are of equal or lower capacity.
 +                       */
 +                      *type = NOHZ_KICK_RESTRICT;
 +                      break;
 +              }
 +      }
 +      rcu_read_unlock();
 +      return 1;
 +}
 +#else
 +static inline int _nohz_kick_needed_hmp(struct rq *rq, int cpu, int *type)
 +{
 +      return 0;
 +}
 +#endif
 +
 +static inline int _nohz_kick_needed(struct rq *rq, int cpu, int *type)
 +{
 +      unsigned long now = jiffies;
 +
 +      /*
 +       * None are in tickless mode and hence no need for NOHZ idle load
 +       * balancing.
 +       */
 +      if (likely(!atomic_read(&nohz.nr_cpus)))
 +              return 0;
 +
 +#ifdef CONFIG_SCHED_HMP
 +      return _nohz_kick_needed_hmp(rq, cpu, type);
 +#endif
 +
 +      if (time_before(now, nohz.next_balance))
 +              return 0;
 +
 +      if (rq->nr_running >= 2 &&
 +          (!energy_aware() || cpu_overutilized(cpu)))
 +              return true;
 +
++      /* Do idle load balance if there have misfit task */
++      if (energy_aware() && rq->misfit_task)
++              return 1;
++
 +      return (rq->nr_running >= 2);
 +}
 +
  /*
   * Current heuristic for kicking the idle load balancer in the presence
   * of an idle cpu in the system.
Simple merge
Simple merge
Simple merge
diff --cc net/core/dev.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge