ksm: check and skip page, if it is already scanned

From: Pradeep Sawlani <sawlani@amazon.com>

On system like Android where most of the process are forked
from parent w/o execve, KSM can scan same page multiple times
in one scan cycle. There is no advantage in scanning same page
multiple times for merging. During testing with Android, it was
observed around 60% pages are skipped for each scan cycle.

Change-Id: I0cf01802f0b4d61fcab92558beb9e1c660dc9a77
Link: http://lkml.kernel.org/r/CAMrOTPgBtANS_ryRjan0-dTL97U7eRvtf3dCsss=Kn+Uk89fuA@mail.gmail.com
Signed-off-by: Pradeep Sawlani <sawlani@amazon.com>

Signed-off-by: Paul Reioux <reioux@gmail.com>
af_unix: speedup /proc/net/unix

/proc/net/unix has quadratic behavior,
and can hold unix_table_lock for a while
if high number of unix sockets are alive. (90 ms for 200k sockets...)

We already have a hash table, so its quite easy to use it.

Problem is unbound sockets are still hashed in a single hash slot
(unix_socket_table[UNIX_HASH_TABLE])

This patch also spreads unbound sockets to 256 hash slots, to speedup
both /proc/net/unix and unix_diag.

Time to read /proc/net/unix with 200k unix sockets :
(time dd if=/proc/net/unix of=/dev/null bs=4k)

before : 520 secs
after : 2 secs

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: flar2 <asegaert@gmail.com>
cpufreq: Avoid using global variable total_cpus

The change is to compile on kernels where cpufreq stats are compiled as
a module (CONFIG_CPU_FREQ_STAT=m), because total_cpus is not exported for
module use.

Reported-By: Emilio López <elopez93@gmail.com>
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Change-Id: I4f3c74f0fac5e8d9449655b26bf3b407b0fe4290
Kernel Version: AK.011.OPO.CM12
msm: msm_limiter: added new drivers for limit cpu frequencies
msm: msm_limiter: set min, max and suspend frequencies default values
msm: msm_limiter: Improve routines

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: only pass display state to lcd notifier call_chain

* We can pass 'NULL' directly to blocking_notifier_call_chain
* Remove unused struct 'lcd_event'
Kernel Version: AK.012.OPO.CM12
msm: vidc: fix failure to set LTR with index value

When MARKLTR/USELTR was set with a index value the value never
propagated to firmware resulting in failure to set the property.

Change-Id: I37536e1662c2d1092477fddde6838d4239805ac5
Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
msm: vidc: Advertise extradata size in queue_setup()

If extradata is enabled, the correct size must be advertised as part of
queue_setup().  Prior to this commit, the output buffer size was taken
to be the extradata size.

In order to make sure that we aren't advertising stale buffer sizes,
query the core for both CAPTURE and OUTPUT planes.

Change-Id: I300e0e1d852caab208fd4cfc6df7cf3152f52431
Signed-off-by: Pushkaraj Patil <ppatil@codeaurora.org>
msm: vidc: disable Hier-P when LTR is enabled

Hier-P and LTR are mutually exclusive in firmware. Disable Hier-P
using HFI_PROPERTY_PARAM_VENC_HIER_P_MAX_NUM_ENH_LAYER
instead of HFI_PROPERTY_CONFIG_VENC_HIER_P_ENH_LAYER.

Change-Id: Ib4eb053a0ccef94c1996392eba19c5b83f7c9971
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: vidc: Add NULL pointer check before deiniting controls

Add NULL pointer check in deinit function, and return -EINVAL
when NULL pointer is found.
Without this change, accidentally, msm_venc_ctrl_deinit() will be called
with a null pointer parameter, which will cause kernel panic.

Change-Id: I80bb6c271dcd3277ddce5332c5f42328ca376128
CRs-Fixed: 652365
Signed-off-by: huiy <huiyQuic@codeaurora.org>
msm: vidc: Bug fix in instance clean-up

When close is called directly without proper state operations,
then driver tries to clean all V4L2 framework memory. When driver
calls queue_release, it tries to call stream_off again. This
causes driver to re-enter the state operations. This change
prevents driver to re-enter the state diagram.

Change-Id: I6df248792fca78fe743bead311fa1cec61a6bb79
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
msm: vidc: do not check for session supported in executing state

The v4l2 video driver should check if the video session is supported
only prior to entering the executing state. Once video session is
in executing state, the session should be always honored.

Change-Id: Iaa59089ef05f03bbc821af8c7fd4fbc342067b3a
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm-vidc: Modify HFI not to alter VP8 max supported width

Modify HFI not to alter firmware returned max supported width
and height and make generic both for Venus and Q6. Remove
creation of debugfs file for VP8 mode.

Change-Id: I77d9077a79214d90f59eb7314bb66e310b5a418f
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>
msm: vidc: avoid setting smoothstreaming for Q6

Smoothstreaming is not a tested functionality on Q6.
This change will return error to all clients trying
to configure Q6 in smoothstreaming mode.

Change-Id: If520d136cd29b3b37759d0fb179538e31b9b71d9
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
bacon: Update defconfig

 * Enable required options

Change-Id: I1f48da54bd89e6bff46752b576d098ad08b38910
Revert "wcnss: handle CBC complete event from firmware"

This reverts commit 7db9a1a9f70a62adf2437484034a7d112c23be1f.
Above commit depends on firmware code changes, As new code
changes that would be introduced removes this dependency,
hence reverting this commit.

Change-Id: I86479d05f98e48949a140e30efae4e311e1cbf00
CRs-Fixed: 744296
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
nl80211: add scan width to bss and scan request structs

To allow scanning and working with 5 MHz and 10 MHz BSS, extend the
inform bss commands and add wrappers to take 5 and 10 MHz bss into
account.

CRs-Fixed: 659678
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Git-commit: dcd6eac1f3b5fa1df11dfa99da0cf75b76cfef97
Git-repo : http://git.kernel.org/cgit/linux/kernel/git/linville/wireless-next.git
[clanctot@codeaurora.org: Only picked up the add of NL80211_BSS_CHAN_WIDTH]
Signed-off-by: Chet Lanctot <clanctot@codeaurora.org>
Change-Id: I06312c396919e9203cc7eaa1e14873191070e6a2
Signed-off-by: Amarnath Hullur Subramanyam <amarnath@codeaurora.org>