Initial support for GPU overclocking

A few changes compared to other implementations:
 - Uses an expanded frequency table.  Frequency can be changed
   on-the-fly, and the 400 MHz entry is preserved.
 - Doesn't increase bus bandwidth.  The default seems sufficient, and
   increasing it seems to cause problems elsewhere.
 - Uses pll3 instead of pll2.  For whatever reason, pll3 handles higher
   frequencies better than pll2.

(cherry picked from commit 56692958c4e2ec9f15a238679973903c327c5376)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
kgsl: several tiny optimizations

(cherry picked from commit 19109555749884ef0708f6c29ea3acca996bc510)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
gpu, fb: tiny modifications

 - Clear CP_DEBUG register after writing firmware
 - Disable WAIT_FOR_IDLE workaround (seems unnecessary)
 - Replace a kzalloc with kmalloc
 - Use mod_timer instead of del_, add_timer

(cherry picked from commit 97f4e7795b23cd15603c0ace813eb15f5b9c6f18)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
This is a combination of 8 commits.

=== The first commit's message is:
uksm-0.1.1 port step1:

add support for uksm in files other than ksm.c and ksm.h

=== This is the 2nd commit message:

uksm-0.1.1 port step2: add uksm.c and uksm.h

=== This is the 3rd commit message:

Adding Kbuild support for UKSM, rename KSM to KSM_LEGACY

=== This is the 4th commit message:

uksm-0.1.1 port step4: make ksm and uksm coexist

=== This is the 5th commit message:

zero page patch bug fix:

1. account zero page number when it get unmapped in several places
2. in cmp_and_merge_page() update the inter-duplication table to
make it cooperate with the basic ladder algorithm.

=== This is the 6th commit message:

make uksm.h more comfortable with ksm.h

=== This is the 7th commit message:

Clear NR_KSM_PAGES_SHARING related code

The couting of NR_KSM_PAGES_SHARING is not perfect, racing make
it very inaccurate. So remove it.

=== This is the 8th commit message:

Massive renaming ksm_* in uksm.c to uksm_*

And also clean up many CONFIG_UKSMs

Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:

	fs/exec.c

Conflicts: introduced in v3.3

	include/linux/mmzone.h

Conflicts: introduced in v3.4, trival noop line

	fs/exec.c

(cherry picked from commit 275c8010b04bba76fba41c4abe75776ed9130df1)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
fix build error: drop_anon_vma() -> put_anon_vma()

(cherry picked from commit df28d6e5656bd9ea4f79ed951d9455b09af42d2b)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: add user support program and its interface

(cherry picked from commit d02a220785f8f0cb4d4cdb617fe1013d5ef81a1f)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: user support program enhancement

Now users can control usr_spt_msg and usr_spt_flags

(cherry picked from commit 96b14290050d465a3fbb0ae2f67f819c53e621ff)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: Fix possible usr_spt timer overflow bug

(cherry picked from commit 59bd15b5610babd07eb5dc053d27a06e5074bb68)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: usr_spt timer fix, reset when jiffies wraps

(cherry picked from commit acb0f7cb7cbdaf2836ff457acbe8ad99e25d8d26)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: remove inline modifier for uksm_vma_add_new

Which can trigger rare compiling failures.

(cherry picked from commit 0d74e4c9ebf146d2cadfee386e3d2e31855ae83b)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: let the default uksm_sleep_jiffies 10 msecs

(cherry picked from commit 2617443f05e740b4f65ebaffdb5a951ab4d1e5cf)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: missing *ptep in try_merge_rmap_item()

(cherry picked from commit 6ff668a51e860f2f4cddb36f656621cdb00a9efe)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: Documentation and some comment fix.

(cherry picked from commit e762a1124b96868c73d53fb54a9e501ccf79d140)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: Fix compiling error when porting to v3.4

(cherry picked from commit 36708183886c4ab03aa63ce54f408e5cf5f609fa)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: update anon_page counter when a anon_page remap to uksm_zero_page

(cherry picked from commit da6aef4a5ddb5e4a6e8169247d522635973a8166)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: add VM_MERGEABLE to vm_flags before vma_merge()

(cherry picked from commit 3a2231b92fc24e5099d924f74c90ac5786f414e1)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM: add parameter max_cpu_percentage

parameter max_cpu_percentage which range from 0 99. Value 100 can
be set, but will be changed to 99. uksm_scan_batch_pages is
calculateddynamically if max_cpu_percentage isn't zero.

delete cal_ladder_pages_to_scan  in func scan_batch_pages_store.

(cherry picked from commit 24c0defc18c5f982c4b8cc553837b2477fa6e8b7)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
Some new designs:

* More precise per-page time estimation. Gather at least 10 virutal page
  scan time for average once a time.
* Better page scan pattern, for each rung a round is finished in a
  predictable and controlable time. Introduced advance_current_scan()
  and uksm_calc_rung_step()
* Performance cpu_governor with a group of preset values:
  uksm_cpu_preset.
* Major scan loop clean up and some other related refactoring.
* Sometimes printk can hurt time estimation badly.

(cherry picked from commit 40d54cd2342e04880ec927060f55408b335d75f3)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
UKSM 0.1.2-alpha1

(cherry picked from commit 072470560adb4c3f91e2b85913a5f8fe49d7299c)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
Fix a bug of data struct crashing

(cherry picked from commit 68bd51b75caebc20c7af76281c8c0e484378a75a)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>