Commit Graph

179 Commits

Author SHA1 Message Date
Liujie Xie
69c931581f ANDROID: vendor_hooks: export hooks of mem_cgroup subsystem
Forgot export hooks for driver, fix it.

Fixes: 1cdcf76b15 ("ANDROID: vendor_hooks: add hooks in mem_cgroup subsystem")
Bug: 192052083

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I79779406b4dab52ceca02bd5de909d3a0c127cb9
2021-10-18 19:01:26 +00:00
Guangming Cao
dccb021dc4 ANDROID: iommu: Add vendor hook to tracing iova alloc & free in iova_domain
Add struct (iova_domain *) in iova alloc & free vendor hook by create a new vendor hook.
Thus we can know the iova we are operating belongs to which iova domain.

Bug: 201255968

Change-Id: I7df419650af2e85a3b2b8c3d6995247694bdc953
Signed-off-by: Chao Hao <chao.hao@mediatek.com>
Signed-off-by: Guangming Cao <Guangming.Cao@mediatek.com>
2021-10-09 10:07:26 +08:00
Konstantin Vyshetsky
e774e4eca6 ANDROID: scsi: ufs: add complete init vendor hook
Currently the core UFS driver does not have a vops to notify when the
device is operational. This commit introduces a hook, which serves to
notify device completing initialization and is ready to accept I/O.

This is required by the FIPS140-2 [1] self integrity test of inline
encryption engine, which must run whenever the host controller is reset.
The code requires sleeping while waiting for I/O to complete and allocating
some memory dynamically, which requires the vendor hook to be restricted.

[1] https://csrc.nist.gov/publications/detail/fips/140/2/final

Bug: 185809932
Signed-off-by: Konstantin Vyshetsky <vkon@google.com>
Change-Id: I6f476f9c2e2b50574d2898c3f1ef6b648d92df24
2021-10-04 18:26:03 +00:00
Jiewen Wang
955f917251 ANDROID: vendor_hooks: Add hook in try_to_unmap_one()
Add hook in try_to_unmap_one() to trace this function for debug memory
swap bugs.

Bug: 198385827
Change-Id: I1fdbe60e09bb491b949e06a07133710453ecca03
Signed-off-by: Jiewen Wang <jiewen.wang@vivo.com>
2021-09-06 17:00:04 +08:00
Jiewen Wang
878e0caa77 ANDROID: vendor_hooks: Add hook in mmap_region()
Add hook in mmap_region() to record the vma and address information
of monitored processes.

Bug: 198385827
Change-Id: I0bde29113b47ca7f4a9f5d42a54188e791ca3b7e
Signed-off-by: Jiewen Wang <jiewen.wang@vivo.com>
2021-09-06 16:51:38 +08:00
Liujie Xie
b0778aaff4 ANDROID: vendor_hooks: export android_vh_kmalloc_slab
export android_vh_kmalloc_slab for driver

Fixes: commit 94fbab9d6c ("ANDROID: vendor_hooks: Add hook in
kmalloc_slab()")
Bug: 197614797

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I0ad5f090d78b4c0b6c456bc2fe47716c6ba46791
2021-09-05 15:55:41 +00:00
Sajid Dalvi
bce9e7942a ANDROID: PCI/PM: Use usleep_range for d3hot_delay
This patch implements a vendor hook that changes d3hot_delay to use
usleep_range() instead of msleep() to reduce the resume time from 20ms to 10ms.

The call sequence is as follows:
pci_pm_resume_noirq()
pci_pm_default_resume_early()
pci_power_up()
pci_raw_set_power_state() --> msleep(10)

The default d3hot_delay is 10ms. Using msleep for delays less than 20ms could
result in delays up to 20ms.
Reference: Documentation/timers/timers-howto.rst

Using usleep_range() results in the delay being closer to 10ms and this reduces
the resume time.

Bug: 194231641
Change-Id: If3e4dcfb99edad302371273933fa6784854cf892
Signed-off-by: Sajid Dalvi <sdalvi@google.com>
2021-08-04 19:48:57 -05:00
Eric Biggers
e2e063f507 ANDROID: scsi: ufs: add vendor hook to override key reprogramming
Some hardware has a way to restore all keyslots at once that is
significantly faster than restoring each keyslot individually, as is
done by blk_ksm_reprogram_all_keys().  Add a hook
"android_rvh_ufs_reprogram_all_keys" that allows overriding the
restoration of all keyslots after UFS reset.  This may sleep, so this
must be a "restricted" Android vendor hook rather than a regular one.

Note that currently this functionality can't be upstreamed, as support
for the hardware that needs it would need to be upstreamed first.

Bug: 162257402
Bug: 181905172
Change-Id: I0b25393a5131941f085892560e08a64e63cd1369
Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-07-28 15:32:51 +00:00
Liangliang Li
81c8161bed ANDROID: vendor_hooks: Add hooks to tcp/udp send/recv msg functions.
Add hook to tcp/udp to collect network info and do performance tuning.

Bug: 190523684

Change-Id: Id790a381d5ce6c35a747697510f14678ccf3ff2f
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
2021-07-28 09:53:04 +08:00
Shaleen Agrawal
f3e3a45d2b ANDROID: sched: add restricted hook to override show_cpufinfo_max_freq
Need restricted hook so that it can sleep.

The old non-restricted versions need to stay in place as a consequence
of KMI freeze.

Bug: 194431527
Change-Id: I7093b66f95c3b9c473386ade60d8897426ddbb13
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-07-26 20:51:32 +00:00
Louis Kuo
e6a59da61e ANDROID: media: v4l2-core: Fix deadlock in vendor hook
The vendor hook functions we implemented will invoke callback functions which have do some sleep or spinlock
operations and have risk of deadlock due to preemption disabled of normal vendor hook function.
So we have to use restricted vendor hook function instead.
Due to KMI freeze we could not change the existing hooks.

trace_android_rvh_media_device_setup_link	=>invoke setup_link, link_notify callback
trace_android_rvh_v4l2subdev_set_xxx		=>invoke set_xxx callback

Bug: 193870284

Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
Change-Id: I94fe2e112b6c3d9ac5177abb30a99b7007068f7e
2021-07-21 13:05:27 +00:00
xieliujie
4322bb07e8 ANDROID: vendor_hooks: Modify the function name
Vendor hook is add in the commit:
https://android-review.googlesource.com/c/kernel/common/+/1687592
When we register the vendor hook and build, there is build error:
too long symbol "__tracepoint_android_vh_binder_transaction_priority_skip"
So, I shorten the function name
android_vh_binder_transaction_priority_skip -->
android_vh_binder_priority_skip

Bug: 186482511

Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I27f39dd32436b09257bcf6e746f4ccdfbd6d6cfe
2021-07-15 16:50:42 +00:00
Vignesh Saravanaperumal
0ed7424fa0 ANDROID: GKI: net: add vendor hooks for 'struct sock' lifecycle
Some vendors want to add a field when a 'sruct sock' is added so give a
hook to handle this.  Any memory allocated when
trace_android_rvh_sk_alloc() is called needs to be freed when
trace_android_rvh_sk_free() is called.

Note, if trace_android_rvh_sk_alloc() fails, be sure to be able to
handle this in trace_android_rvh_sk_free(), but that should not be an
issue as that needs to be addressed in vendor code that runs for 'struct
sock' objects that have been created before the vendor code is loaded no
matter what.

Bug: 171013716
Signed-off-by: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Change-Id: I108a2f31d2dcc228f46159816deee6235afafbbd
2021-07-14 20:52:04 -07:00
Vignesh Saravanaperumal
4d30956478 ANDROID: GKI: net: add vendor hooks for 'struct nf_conn' lifecycle
Some vendors want to add a field when a 'sruct nf_conn' is added so give a
hook to handle this.  Any memory allocated when
trace_android_rvh_nf_conn_alloc() is called needs to be freed when
trace_android_rvh_nf_conn_free() is called.

Note, if trace_android_rvh_nf_conn_alloc() fails, be sure to be able to
handle this in trace_android_rvh_nf_conn_free(), but that should not be
an issue as that needs to be addressed in vendor code that runs for
'struct nf_conn' objects that have been created before the vendor code
is loaded no matter what.

Bug: 171013716
Signed-off-by: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Change-Id: I4d2b025196a3df7ba4adec313c90483811cac728
2021-07-14 20:52:03 -07:00
Robert Lee
13bc06efd9 ANDROID: ALSA: compress: add vendor hook to support pause in draining
Add a hook to query from vendor's compress driver if it is support pause
in draining and if the platform need to keep in draining state.

Bug: 184020292
Bug: 178992384

Change-Id: Id2e2ff72d7ee66fc633473ec109ed3d8a2baaeff
Signed-off-by: Robert Lee <lerobert@google.com>
2021-07-14 17:10:01 +00:00
Yang Yang
2faed77792 ANDROID: vendor_hooks: add vendor hook in blk_mq_rq_ctx_init()
This vendor hook let us initialize payload of the request.

Bug: 188749221
Change-Id: I51d6a3010ac0ab36066dbe1368158592832112b7
Signed-off-by: Yang Yang <yang.yang@vivo.com>
2021-07-14 14:17:35 +00:00
Yang Yang
eecc725a8e ANDROID: vendor_hooks: add vendor hook in blk_mq_alloc_rqs()
This vendor hook let us attach oem data as payload to the request.
The payload is used by oem driver for debugging purpose.

Bug: 188749221
Change-Id: Iac598bd9cce836dac0efe9198a3e7752928f351a
Signed-off-by: Yang Yang <yang.yang@vivo.com>
2021-07-14 12:27:45 +00:00
JJ Lee
e8516fd3af ANDROID: sound: usb: add vendor hook for cpu suspend support
Add vendor hook android_vh_sound_check_support_cpu_suspend
to allow ACPU to suspend during USB playback/capture,
if this is supported.

Bug: 192206510
Change-Id: Ia8d4c335db27de5fcefab13cab653fd1ae34f691
Signed-off-by: JJ Lee <leejj@google.com>
2021-07-14 04:05:24 +00:00
Rocco Yue
dcf509fea7 ANDROID: ipv6: add vendor hook for gen ipv6 link-local addr
This patch provides an ipv6 vendor hook which can be used to
disable kernel auto generate the ipv6 link-local address.

The reasons why the kernel does not need to automatically
generate the ipv6 link-local address are as follows:

(1) In the 3GPP TS 29.061, here is a description as follows:
"in order to avoid any conflict between the link-local address
of the MS and that of the GGSN, the Interface-Identifier used
by the MS to build its link-local address shall be assigned by
the GGSN. The GGSN ensures the uniqueness of this Interface-
Identifier. The MT shall then enforce the use of this
Interface-Identifier by the TE"

In other words, in the cellular network, GGSN determines whether
to reply a solicited RA message by identifying the low 64 bits
of the source address of the received RS message. Therefore,
cellular network device's ipv6 link-local address should be set
as the format of fe80::(GGSN assigned IID).

For example: When using a new kernel and ARPHRD_RAWIP, kernel
will generate an EUI64 format ipv6 link-local address, and the
Linux kernel will uses this link-local address to send RS message.
The result is that the GGSN will not reply to the RS message with
a solicited RA message.

For mobile operators that don't need to support RFC7217, setting
addr_gen_mode == 1 is sufficient, it can avoid the above issue,
but when the addr_gen_mode is changed to the
IN6_ADDR_GEN_MODE_STABLE_PRIVACY, the above problem still exist.
The detail as follows:

(2) For some other mobile operators that need to support RFC7217,
the mobile device's addr_gen_mode will be switched to the
IN6_ADDR_GEN_MODE_STABLE_PRIVACY, instead of using
IN6_ADDR_GEN_MODE_NONE.
The purpose is: in the IN6_ADDR_GEN_MODE_STABLE_PRIVACY mode,
kernel can gererate a stable privacy global ipv6 address after
receiveing RA, and network processes can use this global address
to communicate with the outside network.

Of course, mobile operators that need to support RFC7217 should
also meet the requirement of 3GPP TS 29.061, that is, MT should
use IID assigned by the GGSN to build its ipv6 link-local address
and use this address to send RS. We don't want the kernel to
automatically generate an ipv6 link-local address when
addr_gen_mode == 2. Otherwise, using the stable privacy ipv6
link-local address automatically generated by the kernel to send
RS message, GGSN will not be able to respond to the RS and reply
a RA message.

Therefore, after this patch, the kernel can determine whether to
disable the automatic ipv6 link-local address generation by judging
the net device name.

Bug: 190685002
Change-Id: I93420cacd96789769edc7214fb8a2dd1455ce374
Signed-off-by: Rocco Yue <rocco.yue@mediatek.com>
2021-07-13 18:13:57 +00:00
Puma Hsu
98085b5dd8 ANDROID: usb: Add vendor hook for usb suspend and resume
Add the hook that vendor can design and bypass the suspend/resume.
When the bypass is set, skip the orignal suspend/resume methods.

In mobile, a co-processor can be used with USB audio, and ACPU may
be able to sleep in such condition to improve power consumption.
We will need vendor hook to support this.

Bug: 192774581
Signed-off-by: Puma Hsu <pumahsu@google.com>
Change-Id: Ic62a8a1e662bbe3fb0aa17af7491daace0b9f18a
2021-07-12 09:06:49 +00:00
Kuan-Ying Lee
38abaebab7 ANDROID: syscall_check: add vendor hook for bpf syscall
Through this vendor hook, we can get the timing to check
current running task for the validation of its credential
and bpf operations.

Bug: 191291287

Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Ie4ed8df7ad66df2486fc7e52a26d9191fc0c176e
2021-07-09 13:48:53 +00:00
Kuan-Ying Lee
a7a3b31d58 ANDROID: syscall_check: add vendor hook for open syscall
Through this vendor hook, we can get the timing to check
current running task for the validation of its credential
and open operation.

Bug: 191291287

Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Ia644ceb02dbc230ee1d25cad3630c2c3f908e41a
2021-07-09 13:48:44 +00:00
Kuan-Ying Lee
a5543c9cd7 ANDROID: syscall_check: add vendor hook for mmap syscall
Through this vendor hook, we can get the timing to check
current running task for the validation of its credential
and related operations.

Bug: 191291287

Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: If20bd8bb8311ad10a374033734fbdc7ef61a7704
2021-07-09 13:48:33 +00:00
Bae Soukjin
2cff74e08c ANDROID: vendor_hooks: Add vendor hook to the net
android_vh_ptype_head:
    To add a debugging chain to ptype list

  android_vh_kfree_skb
    To sniff the dropped packet at kernel network

Bug: 163716381

Signed-off-by: Bae Soukjin <soukjin.bae@samsung.com>
Change-Id: Ide80bf0a129da31a1824d4a33026ac42be327361
(cherry picked from commit d88b2969cf)
(cherry picked from commit a8021ba684c584b8a4361d1680f6e466748ab012)
2021-07-09 05:02:33 +00:00
Charan Teja Reddy
964220d080 ANDROID: shmem: vendor hook in shmem_alloc_page
Some drivers can maintain its own pool of shmem pages that can reduce
the latencies in allocation of them by avoiding in getting a page from
buddy. To support this, add a vendor hook which first tries to get the
page from the driver maintained shmem pool when shmem_alloc_page is
called. If failed, it will simply fall back to the original path.

Bug: 187798288
Change-Id: I5deaf995b2e2ac40c2192096435954ee3f4a4fa8
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
2021-07-08 22:06:18 +00:00
Liangliang Li
444a0b7752 ANDROID: mm: add vendor hook for vmpressure
Add vendor hook for bypass vmpressure accounting when doing oem's
custom memory reclaim.

Bug: 191534577

Change-Id: I0c2263e03943596312aa6b01cf8506f2ae87213e
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
2021-07-07 23:23:10 +00:00
xieliujie
0a24affb86 ANDROID: vendor_hooks: modify the function name
int the commit: https://android-review.googlesource.com/c/kernel/common/+/1699406/
When we build  our vendor driver, report two errors:
1) Symbol too long "trace_android_vh_get_unmapped_area_from_anti_fragment_pool"
2) Symbol too long "trace_android_vh_get_unmapped_area_include_reserved_zone"

So, I shorten the function names:
android_vh_get_unmapped_area_from_anti_fragment_pool  -->  android_vh_get_from_fragment_pool
android_vh_get_unmapped_area_include_reserved_zone    -->  android_vh_include_reserved_zone

Bug: 191439466
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: Icee4faa24df4fe1fc29434cd205c4dea82b4fba5
2021-07-02 20:42:14 +00:00
Nitin Rawat
14dd90ab37 ANDROID: scsi: ufs: Add hook to influence the UFS clock scaling policy
Add a vendor hook in ufshcd_devfreq_target() to allow vendor modules to
influence the UFS clock scaling policy.

Bug: 192050146
Change-Id: Ice3e629e132460d240e07c2eba01307317d5aeca
Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2021-07-02 19:33:14 +00:00
Siddharth Gupta
019990276b ANDROID: rproc: Add vendor hook for recovery
Add vendor hook for rproc recovery to allow vendor enhancements.

Bug: 188764827
Change-Id: If6f0846c141a4ad40748d552002f65b94d9c52d5
Signed-off-by: Siddharth Gupta <quic_sidgup@quicinc.com>
2021-07-01 22:32:04 -07:00
Shaleen Agrawal
f9fcdaeab7 ANDROID: sched: remove regular vendor hooks for 32bit execve
As restricted hooks have been introduced, regular vendor hooks are no
longer necessary.

Bug: 187917024
Change-Id: Ia70e9dd1bd7373e19bdc82e90a2384201076bc0b
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-07-01 22:32:03 -07:00
Rick Yiu
22a57c542b ANDROID: sched: Add trace for __setscheduler_uclamp
To know per-task uclamp request.

Bug: 191973176
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: Ibd40391f2228db5daa410198339237879e67a078
2021-07-01 12:31:33 +00:00
Louis Kuo
e0a9556041 ANDROID: media: v4l2-core: extend the v4l2 subdev ioctl to support request
This patch is based on 1699785. It uses to extend the related interface
to support the request-based operations. We use extension fields in the
parameters of VIDIOC_SUBDEV_S_SELECTION, VIDIOC_SUBDEV_S_FMT and
VIDIOC_SUBDEV_S_FRAME_INTERVAL as request fd.
The driver uses media_request_get_by_fd() to retrieve the media request and
save the pending change in it, so that we can apply the pending change in
req_queue() callback then.

Bug: 191903073

CR-Id:
Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
Change-Id: Idb7921724cf8febc44b01880a4ad8b7c9272ba6a
2021-06-30 15:56:19 +00:00
Mukesh Ojha
01f2392e13 ANDROID: logbuf: Add new logbuf vendor hook to support pr_cont()
Add new logbuf vendor hook android_vh_logbuf_pr_cont()
to capture pr_cont logs.

Bug: 185182649
Change-Id: I76b310fc9caac71b344b6cc25ea36f7f81cb7148
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2021-06-29 17:25:52 +00:00
zhang chuang
eabe9707f2 ANDROID: Add hook to show vendor info for transactions
When watchdog or anr occur, we need to read
dev/binderfs/binder_logs/proc/pid or dev/binderfs/binder_logs/state
node to know the time-consuming information of the binder call.
We need to add the time-consuming information of binder transaction.

Bug: 190413570

Signed-off-by: zhang chuang <zhangchuang3@xiaomi.com>
Change-Id: I0423d4e821d5cd725a848584133dc7245cbc233a
2021-06-24 17:40:34 -07:00
Shaleen Agrawal
c7c351ab3f ANDROID: sched: add restricted tracehooks for 32bit execve
Pre and post tracepoints in force_compatible_cpus_allowed_ptr() need
to be restricted hooks so that they can sleep.

The old non-restricted versions need to stay in place temporarily for
KMI stability. They will be removed by aosp/1742588.

Bug: 187917024
Change-Id: If630554b1c8fa2e8ccb79c89945c55e17756e6a8
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-06-23 17:05:12 -07:00
heshuai1
728626cb04 ANDROID: power: Add vendor hook to qos for GKI purpose.
Add the vendor hook to qos.c, because of some special cases related to
our feature. we add the hook at freq_qos_add_request and remove_request
to make sure we can go to our own qos process logic.

Bug: 187458531

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: I1fb8fd6134432ecfb44ad242c66ccd8280ab9b43
2021-06-23 14:36:23 +00:00
Liangliang Li
da33f6fa6c ANDROID: mm: Add hooks to filemap_fault for oem's optimization
Add vendor_hooks to filemap_fault to cache page for oem's optimization.
Save the page for next time retry when VM_FAULT_RETRY returned.

Add ANDROID_OEM_DATA to vm_fault to save the page.

Bug: 188891314
Change-Id: Ibfc9ec950c3360e6f6ccb9546cab0acd89e5d316
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
2021-06-17 14:16:47 -07:00
Ard Biesheuvel
9c556792b7 ANDROID: crypto: lib/aes - add vendor hooks for AES library routines
Add vendor hooks that will allow the FIPS140 kernel module to override
the implementations of the AES library routines. The FIPS 140 versions
are identical to the normal ones, but their code and rodata will have been
integrity checked at module load time.

Bug: 153614920
Bug: 188620248
Change-Id: I5711fc42eced903565fd3c8d41ca7cdd82641148
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:57 +00:00
Ard Biesheuvel
7a689ebc67 ANDROID: crypto: lib/sha256 - add vendor hook for sha256() routine
Add a vendor hook that will allow the FIPS140 kernel module to override
the implementation of the sha256() library routine. The FIPS 140 version
is identical to the normal one, but its code and rodata will have been
integrity checked at module load time.

Bug: 153614920
Bug: 188620248
Change-Id: I8ccc4f0cc8206af39fa922134b438dacac2a614a
Signed-off-by: Ard Biesheuvel <ardb@google.com>
2021-06-11 07:49:57 +00:00
Maulik Shah
fb49b843af ANDROID: cpuidle-psci: Add vendor hook for cpuidle psci enter and exit
Add vendor hook for cpuidle to allow vendor modules for s2idle
enhancements.

Bug: 190353898
Change-Id: I02b1393e6119e32eae96010ba5951405dbdada2b
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
2021-06-10 22:06:51 +00:00
heshuai1
c9b8fa644f ANDROID: user: Add vendor hook to user for GKI purpose
Add the vendor hook to user.c, because of some speical cases related to
our feature, we need to initialize the variables defined by ourselves in
user_struct, so we add the hook at alloc_uid to make sure we can go to
our own logic when the user_struct is about to initialize.

Bug: 187458531

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: I078484aac2c3d396aba5971d6d0f491652f3781c
2021-06-10 01:35:22 +00:00
Sudarshan Rajagopalan
2699fa478d ANDROID: mm: vmscan: support equal reclaim for anon and file pages
When performing memory reclaim, support treating anonymous and
file backed pages equally. Swapping anonymous pages out to memory
can be efficient enough to justify treating anonymous and file backed
pages equally.
Create a vendor hook inside of get_scan_count so that equal reclaim of
anon and file pages can be enabled inside of the trace hook based on
certain conditions.

Bug: 175415908
Change-Id: Idac2f1468371549d20dd3e5652c7382dc3d7d9cf
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
2021-06-09 02:02:44 +00:00
Abhijeet Dharmapurikar
3f5e8b830c ANDROID: sched: create trace points for 32bit execve
Module code would like to hold some locks when affinity is being updated
for 32 bit task exec.

Create pre and post tracepoints in force_compatible_cpus_allowed_ptr()

Bug: 187917024
Change-Id: I95bff9f4d5b5d37c1d5440acbd6857d2855c2b43
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-06-07 21:59:40 +00:00
heshuai1
a1580311c3 ANDROID: freezer: Add vendor hook to freezer for GKI purpose.
Add the vendor hook to freezer.c, because of some special cases related to our feature, we do not want the process to be frozen immediately, so we add the hook at __refrigerator to make sure we can go to our own freeze logic when the process is about to be frozen.

Bug: 187458531

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: Iea42fd9604d6b33ccd6502425416f0dd28eecebb
2021-06-07 16:07:44 +00:00
Choonghoon Park
27c285003d ANDROID: sched: Add vendor hook to select ilb cpu
Add android_rvh_find_new_ilb to select a next ilb cpu for vendors.

Bug: 190228983

Change-Id: Iba1a0cd9cdc22dcf628dd33f8d838fe513a4818f
Signed-off-by: Choonghoon Park <choong.park@samsung.com>
2021-06-07 11:00:05 +00:00
Jiachiam Liu
5cf77864a3 ANDROID: arm scmi: add vendor hook to adjust the rx timeout.
Add a vendor hook in scmi transfer, to adjust the rx timeout
for performance tuning.

Bug: 189610155
Change-Id: Ic1687b3cf8568ca205f640fd97a7ce3bbfc61a36
Signed-off-by: Jiachiam Liu <jiachiam.liu@mediatek.com>
2021-06-04 21:59:37 +00:00
Louis Kuo
f1a161b019 ANDROID: media: v4l2-core: extend the v4l2 format to support request
This patch is to extend the related interface to support the request-based operations. We use extension fields in the parameters of MEDIA_IOC_SETUP_LINK, VIDIOC_S_FMT, VIDIOC_SUBDEV_S_SELECTION, VIDIOC_SUBDEV_S_FMT as request fd.
The driver uses media_request_get_by_fd() to retrieve the media request and save the pending change in it, so that we can apply the pending change in req_queue() callback then.
Besides, We also add three vendor hook functions to handle related changes in v4l2-framework.

Bug: 187480619

Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
Change-Id: I22762136f980afaec29be70c32cca8b04e0805a0
2021-06-04 11:15:20 -07:00
rongqianfeng
bf769b7216 ANDROID: vendor_hooks: add hook and OEM data for slab shrink
Some shrinker add lock in count_objects() may cause lock contention
issues and lead all task stall on slab shrink. Add vendor hook in
do_shrink_slab() for shrinker->count_objects() latency measuring.

Add 3 oem data in shrink_control struct. Two is for
shrinker->count_objects() and shrinker->scan_objects() latency
measuring, other one to store priority, some shrinker know the reclaimer
priority can control the memory reclaim more better.

Bug: 188684131

Change-Id: I80e9d90179bb52a99c54d9a067c6fcee835bb2ad
Signed-off-by: rongqianfeng <rongqianfeng@vivo.com>
2021-06-04 11:15:20 -07:00
Charan Teja Reddy
3bcdb496f4 ANDROID: signal: Add vendor hook for memory reaping
Add vendor hook to determine if the memory of a process that received
the SIGKILL can be reaped.

Bug: 189803002
Change-Id: Ie6802b9bf93ddffb0ceef615d7cca40c23219e57
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
2021-06-03 20:59:15 +00:00
Badhri Jagan Sridharan
bcfe28b62f ANDROID: vendor_hooks: Add vendor hook for tcpm logs
Logs in /sys/kernel/debug/usb/tcpm* are key to debug issues related to
USB charging or data. Given that debugfs is disabled in user builds,
adding vendor hooks to enable dumping the same.

bypass_log is set to true by the handler if logging into logbuffer is
not needed.

Bug: 189792358
Change-Id: Icacfed2264b6c49b8e803c62f8bd820a146c169a
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
2021-06-02 18:21:32 +00:00