ANDROID: scheduler: add vendor-specific wake flag

It comes with the commit efbb82d3b0db ("ANDROID: Add a vendor hook
that allow a module to modify the wake flag"). A vendor who want to
hook sock_def_readable can set this vendor-specific wake flag.

sock_def_readable ->
(vendor hook will call __wake_up_sync_key with a custom mode) ->
__wake_up_sync_key ->
(vendor hook changes wake_flags per the custom mode) ->
__wake_up_common -> default_wake_function

It is an Android-specific since it works with a vendor hook.

Bug: 189858948
Bug: 226256614
Bug: 263838089
Bug: 349225664
Bug: 401953920
Signed-off-by: Namkyu Kim <namkyu78.kim@samsung.com>
Change-Id: Idc23c1c47f7d83b298c0b2560859f1ce2761fd85
(cherry picked from commit 4c1097df5d9bca84a1922adc752794db9b615a3e)
(cherry picked from commit 87b89ce83b2c0228b5a8300dbf5a63027eabc036)
(cherry picked from commit ffb7f4adfcc79afbecba8633160219d23a610647)
Signed-off-by: Dongseok Yi <dseok.yi@samsung.com>
(cherry picked from commit ba91ea859eabfceeba1a17757b196604f3c34229)
This commit is contained in:
Namkyu Kim
2021-06-02 14:56:16 +09:00
committed by Treehugger Robot
parent 1dc69ebe20
commit 8df96342a6
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -8067,7 +8067,8 @@ asmlinkage __visible void __sched preempt_schedule_irq(void)
int default_wake_function(wait_queue_entry_t *curr, unsigned mode, int wake_flags,
void *key)
{
WARN_ON_ONCE(IS_ENABLED(CONFIG_SCHED_DEBUG) && wake_flags & ~(WF_SYNC|WF_CURRENT_CPU));
WARN_ON_ONCE(IS_ENABLED(CONFIG_SCHED_DEBUG) && wake_flags &
~(WF_SYNC|WF_CURRENT_CPU|WF_ANDROID_VENDOR));
return try_to_wake_up(curr->private, mode, wake_flags);
}
EXPORT_SYMBOL(default_wake_function);
+2
View File
@@ -2348,6 +2348,8 @@ static inline int task_on_rq_migrating(struct task_struct *p)
#define WF_CURRENT_CPU 0x40 /* Prefer to move the wakee to the current CPU. */
#define WF_RQ_SELECTED 0x80 /* ->select_task_rq() was called */
#define WF_ANDROID_VENDOR 0x1000 /* Vendor specific for Android */
#ifdef CONFIG_SMP
static_assert(WF_EXEC == SD_BALANCE_EXEC);
static_assert(WF_FORK == SD_BALANCE_FORK);