Commit Graph

637484 Commits

Author SHA1 Message Date
Jin Qian
012f200e4a ANDROID: uid_cputime: add per-uid IO usage accounting
IO usages are accounted in foreground and background buckets.
For each uid, io usage is calculated in two steps.

delta = current total of all uid tasks - previus total
current bucket += delta

Bucket is determined by current uid stat. Userspace writes to
/proc/uid_procstat/set <uid> <stat> when uid stat is updated.

/proc/uid_io/stats shows IO usage in this format.
<uid> <foreground IO> <background IO>

Signed-off-by: Jin Qian <jinqian@google.com>
Bug: 34198239
Change-Id: Ib8bebda53e7a56f45ea3eb0ec9a3153d44188102
2017-03-14 13:13:04 -07:00
Andres Oportus
b2eb4311ad ANDROID: sched/walt: Fix missing locking in WALT port
commit 26c2154816 ("ANDROID: sched: Introduce Window Assisted Load
Tracking (WALT)") which was a forward port of WALT from android 4.4
missed locking for 2 set_task_cpu() calls, re-added here.

Signed-off-by: Andres Oportus <andresoportus@google.com>
2017-03-13 17:10:35 -07:00
Pratyush Anand
d32793b6be UPSTREAM: arm64: Allow hw watchpoint of length 3,5,6 and 7
(cherry picked from commit 0ddb8e0b78)

Since, arm64 can support all offset within a double word limit. Therefore,
now support other lengths within that range as well.

Signed-off-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Pavel Labath <labath@google.com>
Change-Id: Ibcb263a3903572336ccbf96e0180d3990326545a
Bug: 30919905
2017-03-13 15:33:33 -07:00
Pavel Labath
32649b0a39 UPSTREAM: arm64: hw_breakpoint: Handle inexact watchpoint addresses
(cherry picked from commit fdfeff0f9e)

Arm64 hardware does not always report a watchpoint hit address that
matches one of the watchpoints set. It can also report an address
"near" the watchpoint if a single instruction access both watched and
unwatched addresses. There is no straight-forward way, short of
disassembling the offending instruction, to map that address back to
the watchpoint.

Previously, when the hardware reported a watchpoint hit on an address
that did not match our watchpoint (this happens in case of instructions
which access large chunks of memory such as "stp") the process would
enter a loop where we would be continually resuming it (because we did
not recognise that watchpoint hit) and it would keep hitting the
watchpoint again and again. The tracing process would never get
notified of the watchpoint hit.

This commit fixes the problem by looking at the watchpoints near the
address reported by the hardware. If the address does not exactly match
one of the watchpoints we have set, it attributes the hit to the
nearest watchpoint we have.  This heuristic is a bit dodgy, but I don't
think we can do much more, given the hardware limitations.

Signed-off-by: Pavel Labath <labath@google.com>
[panand: reworked to rebase on his patches]
Signed-off-by: Pratyush Anand <panand@redhat.com>
[will: use __ffs instead of ffs - 1]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Pavel Labath <labath@google.com>
Change-Id: I714dfaa3947d89d89a9e9a1ea84914d44ba0faa3
Bug: 30919905
2017-03-13 15:33:33 -07:00
Pratyush Anand
67de4de562 UPSTREAM: arm64: Allow hw watchpoint at varied offset from base address
ARM64 hardware supports watchpoint at any double word aligned address.
However, it can select any consecutive bytes from offset 0 to 7 from that
base address. For example, if base address is programmed as 0x420030 and
byte select is 0x1C, then access of 0x420032,0x420033 and 0x420034 will
generate a watchpoint exception.

Currently, we do not have such modularity. We can only program byte,
halfword, word and double word access exception from any base address.

This patch adds support to overcome above limitations.

Signed-off-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Pavel Labath <labath@google.com>
Change-Id: I28b1ca63f63182c10c3d6b6b3bacf6c56887ddbe
Bug: 30919905
2017-03-13 15:31:19 -07:00
Pratyush Anand
85c450ac7a UPSTREAM: hw_breakpoint: Allow watchpoint of length 3,5,6 and 7
(cherry picked from commit 651be3cb08)

We only support breakpoint/watchpoint of length 1, 2, 4 and 8. If we can
support other length as well, then user may watch more data with less
number of watchpoints (provided hardware supports it). For example: if we
have to watch only 4th, 5th and 6th byte from a 64 bit aligned address, we
will have to use two slots to implement it currently. One slot will watch a
half word at offset 4 and other a byte at offset 6. If we can have a
watchpoint of length 3 then we can watch it with single slot as well.

ARM64 hardware does support such functionality, therefore adding these new
definitions in generic layer.

Signed-off-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Pavel Labath <labath@google.com>
Change-Id: Ie17ed89ca526e4fddf591bb4e556fdfb55fc2eac
Bug: 30919905
2017-03-13 15:31:05 -07:00
Anson Jacob
72ec46f51d ANDROID: usb: gadget: f_accessory: Fix for UsbAccessory clean unbind.
Reapplying fix by Darren Whobrey (Change 69674)

Fixes issues: 20545, 59667 and 61390.
With prior version of f_accessory.c, UsbAccessories would not
unbind cleanly when application is closed or i/o stopped
while the usb cable is still connected. The accessory gadget
driver would be left in an invalid state which was not reset
on subsequent binding or opening. A reboot was necessary to clear.

In some phones this issues causes the phone to reboot upon
unplugging the USB cable.

Main problem was that acc_disconnect was being called on I/O error
which reset disconnected and online.

Minor fix required to properly track setting and unsetting of
disconnected and online flags. Also added urb Q wakeup's on unbind
to help unblock waiting threads.

Tested on Nexus 7 grouper. Expected behaviour now observed:
closing accessory causes blocked i/o to interrupt with IOException.
Accessory can be restarted following closing of file handle
and re-opening.

This is a generic fix that applies to all devices.

Change-Id: I4e08b326730dd3a2820c863124cee10f7cb5501e
Signed-off-by: Darren Whobrey <d.whobrey@mildai.org>
Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com>
2017-03-13 15:27:22 -07:00
Subash Abhinov Kasiviswanathan
a711fa7fb5 ANDROID: nf: IDLETIMER: Use fullsock when querying uid
sock_i_uid() acquires the sk_callback_lock which does not exist for
sockets in TCP_NEW_SYN_RECV state. This results in errors showing up
as spinlock bad magic. Fix this by looking for the full sock as
suggested by Eric.

Callstack for reference -

-003|rwlock_bug
-004|arch_read_lock
-004|do_raw_read_lock
-005|raw_read_lock_bh
-006|sock_i_uid
-007|from_kuid_munged(inline)
-007|reset_timer
-008|idletimer_tg_target
-009|ipt_do_table
-010|iptable_mangle_hook
-011|nf_iterate
-012|nf_hook_slow
-013|NF_HOOK_COND(inline)
-013|ip_output
-014|ip_local_out
-015|ip_build_and_send_pkt
-016|tcp_v4_send_synack
-017|atomic_sub_return(inline)
-017|reqsk_put(inline)
-017|tcp_conn_request
-018|tcp_v4_conn_request
-019|tcp_rcv_state_process
-020|tcp_v4_do_rcv
-021|tcp_v4_rcv
-022|ip_local_deliver_finish
-023|NF_HOOK_THRESH(inline)
-023|NF_HOOK(inline)
-023|ip_local_deliver
-024|ip_rcv_finish
-025|NF_HOOK_THRESH(inline)
-025|NF_HOOK(inline)
-025|ip_rcv
-026|deliver_skb(inline)
-026|deliver_ptype_list_skb(inline)
-026|__netif_receive_skb_core
-027|__netif_receive_skb
-028|netif_receive_skb_internal
-029|netif_receive_skb

Change-Id: Ic8f3a3d2d7af31434d1163b03971994e2125d552
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: Eric Dumazet <edumazet@google.com>
2017-03-13 15:27:22 -07:00
Mohan Srinivasan
a5c4dbb05a ANDROID: Replace spaces by '_' for some android filesystem tracepoints.
Andoid files frequently have spaces in them, as do cmdline strings.
Replace these spaces with '_', so tools that parse these tracepoints
don't get terribly confused.

Change-Id: I1cbbedf5c803aa6a58d9b8b7836e9125683c49d1
Signed-off-by: Mohan Srinivasan <srmohan@google.com>
(cherry picked from commit 5035d5f0933758dd515327d038e5bef7e40dbaa7)
(cherry picked from commit 6f4a2453a1)
2017-03-13 21:12:37 +00:00
Greg Kroah-Hartman
053b6541d0 Linux 4.9.14
am: d379ab2707

Change-Id: I5b02b023e4399647a81c369d5efafcee0c42a539
2017-03-12 08:35:04 +00:00
Florian Westphal
0f8abf5d89 netfilter: conntrack: refine gc worker heuristics, redux
am: 371d0342a3

Change-Id: I4c4c2c9e5ff4d36b76f7a28332ac6f47014d5b6f
2017-03-12 08:34:55 +00:00
Florian Westphal
615124cf3a netfilter: conntrack: remove GC_MAX_EVICTS break
am: 5f7ff59d06

Change-Id: Ic92c26177c87b9a522f390284a0ecdf66e59cfce
2017-03-12 08:34:45 +00:00
Yan, Zheng
2b9a54398d ceph: update readpages osd request according to size of pages
am: dc8470f3c8

Change-Id: Ifa9037bd32ce3e4a92bc0cb4219b9235dff3289d
2017-03-12 08:34:34 +00:00
James Smart
2976604f18 scsi: lpfc: Correct WQ creation for pagesize
am: 27ab5414b9

Change-Id: Ic25594875ecb0a1c1b38245a700cd8c7c0582b1b
2017-03-12 08:34:25 +00:00
Ralf Baechle
0d4bafcf25 MIPS: IP22: Fix build error due to binutils 2.25 uselessnes.
am: aae02d1aaf

Change-Id: Ibd15ccfc1475e52020da5c12380390a531f9515d
2017-03-12 08:34:14 +00:00
Ralf Baechle
36f955bf09 MIPS: IP22: Reformat inline assembler code to modern standards.
am: 8a2307c7c0

Change-Id: Iff5330498a7f5f73a6c9b2dcf554f4aadd3cce9a
2017-03-12 08:34:01 +00:00
Aneesh Kumar K.V
4cd1a89408 powerpc/mm/hash: Always clear UPRT and Host Radix bits when setting up CPU
am: 075be78c83

Change-Id: I389e80c5f4171c352f273593a97f74c9f126cd92
2017-03-12 08:33:50 +00:00
Aneesh Kumar K.V
2aa3d2271f powerpc/mm: Add MMU_FTR_KERNEL_RO to possible feature mask
am: 3552f91715

Change-Id: I7e9a7849199cc4bcd9319ac3c8d0495d987b6818
2017-03-12 08:33:41 +00:00
Ravi Bangoria
21328d27c1 powerpc/xmon: Fix data-breakpoint
am: fccb22e7d5

Change-Id: I620aa92e95857e84cdb7b27a5b2fd0ca01205203
2017-03-12 08:33:32 +00:00
Chuck Lever
de63d00e86 xprtrdma: Reduce required number of send SGEs
am: 86840a6305

Change-Id: Icb11686ae87cb1912f5db529305b832588071de6
2017-03-12 08:33:22 +00:00
Chuck Lever
467ece7ec1 xprtrdma: Disable pad optimization by default
am: 73eea1c400

Change-Id: I91577b4917461dd201ab7bdd707a11abc668c68e
2017-03-12 08:33:12 +00:00
Chuck Lever
dde41165b1 xprtrdma: Per-connection pad optimization
am: fab6c2caa4

Change-Id: I41bd05e5d64f5fd3167d60cd07f974499e530e5e
2017-03-12 08:33:03 +00:00
Chuck Lever
8f5e4128a7 xprtrdma: Fix Read chunk padding
am: ec3bc2c5ed

Change-Id: I1c5f24db518a105a64f3026238576aa171edce25
2017-03-12 08:32:54 +00:00
Magnus Lilja
ab9bdc3caf dmaengine: ipu: Make sure the interrupt routine checks all interrupts.
am: 788d81d4e5

Change-Id: Icb3f21057240affdddd2803bd09f34c8da79d00b
2017-03-12 08:32:45 +00:00
Mark Marshall
091a56345b mtd: nand: ifc: Fix location of eccstat registers for IFC V1.0
am: 9d82393e65

Change-Id: Id1db86cc0b2de5704c926ab533da148c2bc07924
2017-03-12 08:32:35 +00:00
Rafa Miecki
37a11dfff6 bcma: use (get|put)_device when probing/removing device driver
am: 178d07a0b8

Change-Id: I25ff9516d04bb29456f7de48e004e48668ff89ff
2017-03-12 08:32:26 +00:00
colyli@suse.de
42e5c23d67 md linear: fix a race between linear_add() and linear_congested()
am: 6f9c02ab9d

Change-Id: I1f96e0d5a2b66b2dd84747d13244abaa4d3a19c3
2017-03-12 08:32:16 +00:00
Maxime Ripard
8641dfaed4 rtc: sun6i: Switch to the external oscillator
am: de2aa5b3ee

Change-Id: Idb992e6e94e495e3a9d45a5e74c4fc6473f6d270
2017-03-12 08:32:07 +00:00
Maxime Ripard
fba612f944 rtc: sun6i: Add some locking
am: 6aae7ffa33

Change-Id: I39aef8bf994cba0f3d030451b1e49b87479fa42c
2017-03-12 08:31:57 +00:00
Maxime Ripard
b9b36e3f50 rtc: sun6i: Disable the build as a module
am: 616f5ef613

Change-Id: I7f17fb49e3d082d70e517ac5fab7cef891c0a08f
2017-03-12 08:31:48 +00:00
Jaegeuk Kim
23a9724aa6 f2fs: avoid to issue redundant discard commands
am: 8c53efc399

Change-Id: I2ff3778b632e3e168b63026f548e3ca5d4834f03
2017-03-12 08:31:39 +00:00
Hou Pengyang
227b67a783 f2fs: add ovp valid_blocks check for bg gc victim to fg_gc
am: 4992ba2840

Change-Id: Ic422df57bed6c2b3a6176c45585f3e382a8aaa2b
2017-03-12 08:31:30 +00:00
Jaegeuk Kim
bc2d4e25d8 f2fs: fix multiple f2fs_add_link() calls having same name
am: d00d1b71d9

Change-Id: I2a53ea79d79f68575a8024b4d2e7ae6caa3f574d
2017-03-12 08:31:21 +00:00
Yunlei He
7ba5bdbbdd f2fs: fix a problem of using memory after free
am: ec160ad2ac

Change-Id: I03c5ca770485a1e4acb077e9ef0a1ef4fd44ed64
2017-03-12 08:31:11 +00:00
Weston Andros Adamson
42a0b6ac90 NFSv4: fix getacl ERANGE for some ACL buffer sizes
am: d78f93384d

Change-Id: I63575e489c36885745b9200255b8cfed043840a2
2017-03-12 08:31:02 +00:00
J. Bruce Fields
1ac0d2a627 NFSv4: fix getacl head length estimation
am: 3f22cc6f5c

Change-Id: I0bac115b6350d346f98ab25e3abf5f51e7928218
2017-03-12 08:30:53 +00:00
Trond Myklebust
8ce583b2c5 pNFS/flexfiles: If the layout is invalid, it must be updated before retrying
am: c65db336d6

Change-Id: I4aad914ea6742982d1cb0999bce88bbf5a44d9a1
2017-03-12 08:30:43 +00:00
Trond Myklebust
7c462ea8db NFSv4: Fix reboot recovery in copy offload
am: 77bbc0c771

Change-Id: I6b434655435355d1e4abd9be8136c39dcea6c5b2
2017-03-12 08:30:33 +00:00
Trond Myklebust
1daccb897f NFSv4: Fix memory and state leak in _nfs4_open_and_get_state
am: 0465339eb5

Change-Id: Ifc384df217eaed9afca750d0f6af515c5ef66458
2017-03-12 08:30:23 +00:00
Christoph Hellwig
9ac2421460 nfsd: special case truncates some more
am: a3c6cbc4ea

Change-Id: Iac8449fa5d6abf4b195fd0a7287b2c0416115515
2017-03-12 08:30:15 +00:00
Christoph Hellwig
0c81383905 nfsd: minor nfsd_setattr cleanup
am: 9bdd39c146

Change-Id: Iaf7319f8ea215cdf608b2039672cfe26f8f21d9c
2017-03-12 08:30:05 +00:00
Stefano Babic
6ef9327a54 VME: restore bus_remove function causing incomplete module unload
am: 5af94e637f

Change-Id: Ic2f29fb2813f5e2ad384acdf6b4fc4a6e5f69302
2017-03-12 08:29:56 +00:00
Larry Finger
999538acbd rtlwifi: rtl8192c-common: Fix "BUG: KASAN:
am: 5ea52fac0d

Change-Id: I06623a77184f722a31da0afc892ddc715d648764
2017-03-12 08:29:46 +00:00
Ping-Ke Shih
7be8b85830 rtlwifi: Fix alignment issues
am: d56dd01bc2

Change-Id: Ib252cb2f3b026261c20ac90d3407f8590882c284
2017-03-12 08:29:36 +00:00
Bjorn Andersson
35c24ca76d remoteproc: qcom: mdt_loader: Don't overwrite firmware object
am: 24d77f99a7

Change-Id: I85e3d64a01521e9a8710a0938aa33aa109530303
2017-03-12 08:29:27 +00:00
Andrew Price
0af27202eb gfs2: Add missing rcu locking for glock lookup
am: 4cf918c804

Change-Id: I9848a18606bc0200c0bc72c7e6fc80c4495c1132
2017-03-12 08:29:18 +00:00
Steve Wise
fa7886f10d rdma_cm: fail iwarp accepts w/o connection params
am: c8cdd9234c

Change-Id: I7f99eabd31c543c24c11af76de1a57ff6ded7e98
2017-03-12 08:29:08 +00:00
Jason Gunthorpe
5f93c09fd2 RDMA/core: Fix incorrect structure packing for booleans
am: 50fc62d5ee

Change-Id: I8e73d933afe16322ff18709d200d3d4ea6abbeb4
2017-03-12 08:28:59 +00:00
K. Y. Srinivasan
6fa10d0293 Drivers: hv: util: Backup: Fix a rescind processing issue
am: fbff994b8a

Change-Id: Ibacd971fc554c22d4f234ab55ba6dfe78985d4b2
2017-03-12 08:28:50 +00:00
K. Y. Srinivasan
04ab9774e8 Drivers: hv: util: Fcopy: Fix a rescind processing issue
am: 4db47d9bf9

Change-Id: I1115daefd2966ee228e9982677a342c0b3556ea1
2017-03-12 08:28:42 +00:00