From 1f8f6d59a298c4fbd10603e681852c1670ab1b1c Mon Sep 17 00:00:00 2001 From: Peifeng Li Date: Sun, 24 Jul 2022 13:47:14 +0800 Subject: [PATCH 01/52] ANDROID: vendor_hook: Add hook to not be stuck ro rmap lock in kswapd or direct_reclaim Add hooks to support trylock in rmaplock when reclaiming in kswapd or direct_reclaim, in order to avoid wait lock for a long time. - android_vh_handle_failed_page_trylock - android_vh_page_trylock_set - android_vh_page_trylock_clear - android_vh_page_trylock_get_result - android_vh_do_page_trylock Bug: 240003372 Signed-off-by: Peifeng Li Change-Id: I0f605b35ae41f15b3ca7bc72cd5f003175c318a5 --- drivers/android/vendor_hooks.c | 5 +++++ include/trace/hooks/mm.h | 5 +++++ include/trace/hooks/vmscan.h | 12 ++++++++++++ mm/rmap.c | 20 +++++++++++++++++--- mm/vmscan.c | 18 ++++++++++++++---- 5 files changed, 53 insertions(+), 7 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index d7fab5cb876d..128f63a76938 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -304,6 +304,11 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_logbuf_pr_cont); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_scan_type); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_swappiness); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_slab_bypass); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_failed_page_trylock); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_trylock_set); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_trylock_clear); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_trylock_get_result); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_page_trylock); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_referenced_check_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_drain_all_pages_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_drain_all_pages_bypass); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 495f66d0f926..8b0225ce7ced 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -22,6 +22,7 @@ #include #include #include +#include #ifdef __GENKSYMS__ struct slabinfo; @@ -148,6 +149,10 @@ DECLARE_HOOK(android_vh_mmap_region, DECLARE_HOOK(android_vh_try_to_unmap_one, TP_PROTO(struct vm_area_struct *vma, struct page *page, unsigned long addr, bool ret), TP_ARGS(vma, page, addr, ret)); +DECLARE_HOOK(android_vh_do_page_trylock, + TP_PROTO(struct page *page, struct rw_semaphore *sem, + bool *got_lock, bool *success), + TP_ARGS(page, sem, got_lock, success)); DECLARE_HOOK(android_vh_drain_all_pages_bypass, TP_PROTO(gfp_t gfp_mask, unsigned int order, unsigned long alloc_flags, int migratetype, unsigned long did_some_progress, diff --git a/include/trace/hooks/vmscan.h b/include/trace/hooks/vmscan.h index 4f1d6ab9f498..a175232c89f6 100644 --- a/include/trace/hooks/vmscan.h +++ b/include/trace/hooks/vmscan.h @@ -28,6 +28,18 @@ DECLARE_RESTRICTED_HOOK(android_rvh_set_balance_anon_file_reclaim, DECLARE_HOOK(android_vh_page_referenced_check_bypass, TP_PROTO(struct page *page, unsigned long nr_to_scan, int lru, bool *bypass), TP_ARGS(page, nr_to_scan, lru, bypass)); +DECLARE_HOOK(android_vh_page_trylock_get_result, + TP_PROTO(struct page *page, bool *trylock_fail), + TP_ARGS(page, trylock_fail)); +DECLARE_HOOK(android_vh_handle_failed_page_trylock, + TP_PROTO(struct list_head *page_list), + TP_ARGS(page_list)); +DECLARE_HOOK(android_vh_page_trylock_set, + TP_PROTO(struct page *page), + TP_ARGS(page)); +DECLARE_HOOK(android_vh_page_trylock_clear, + TP_PROTO(struct page *page), + TP_ARGS(page)); DECLARE_HOOK(android_vh_shrink_node_memcgs, TP_PROTO(struct mem_cgroup *memcg, bool *skip), TP_ARGS(memcg, skip)); diff --git a/mm/rmap.c b/mm/rmap.c index ea1fd71b03df..2e62c1aa5139 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -525,6 +525,7 @@ struct anon_vma *page_lock_anon_vma_read(struct page *page) struct anon_vma *anon_vma = NULL; struct anon_vma *root_anon_vma; unsigned long anon_mapping; + bool success = false; rcu_read_lock(); anon_mapping = (unsigned long)READ_ONCE(page->mapping); @@ -547,7 +548,11 @@ struct anon_vma *page_lock_anon_vma_read(struct page *page) } goto out; } - + trace_android_vh_do_page_trylock(page, NULL, NULL, &success); + if (success) { + anon_vma = NULL; + goto out; + } /* trylock failed, we got to sleep */ if (!atomic_inc_not_zero(&anon_vma->refcount)) { anon_vma = NULL; @@ -1981,6 +1986,7 @@ static void rmap_walk_file(struct page *page, struct rmap_walk_control *rwc, struct address_space *mapping = page_mapping(page); pgoff_t pgoff_start, pgoff_end; struct vm_area_struct *vma; + bool got_lock = false, success = false; /* * The page lock not only makes sure that page->mapping cannot @@ -1995,8 +2001,16 @@ static void rmap_walk_file(struct page *page, struct rmap_walk_control *rwc, pgoff_start = page_to_pgoff(page); pgoff_end = pgoff_start + thp_nr_pages(page) - 1; - if (!locked) - i_mmap_lock_read(mapping); + if (!locked) { + trace_android_vh_do_page_trylock(page, + &mapping->i_mmap_rwsem, &got_lock, &success); + if (success) { + if (!got_lock) + return; + } else { + i_mmap_lock_read(mapping); + } + } vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff_start, pgoff_end) { unsigned long address = vma_address(page, vma); diff --git a/mm/vmscan.c b/mm/vmscan.c index 22ab1afed87f..7899d6905b6e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1021,15 +1021,19 @@ static enum page_references page_check_references(struct page *page, int referenced_ptes, referenced_page; unsigned long vm_flags; bool should_protect = false; + bool trylock_fail = false; trace_android_vh_page_should_be_protected(page, &should_protect); if (unlikely(should_protect)) return PAGEREF_ACTIVATE; + trace_android_vh_page_trylock_set(page); referenced_ptes = page_referenced(page, 1, sc->target_mem_cgroup, &vm_flags); referenced_page = TestClearPageReferenced(page); - + trace_android_vh_page_trylock_get_result(page, &trylock_fail); + if (trylock_fail) + return PAGEREF_KEEP; /* * Mlock lost the isolation race with us. Let try_to_unmap() * move the page to the unevictable list. @@ -1341,6 +1345,7 @@ static unsigned int shrink_page_list(struct list_head *page_list, if (unlikely(PageTransHuge(page))) flags |= TTU_SPLIT_HUGE_PMD; + trace_android_vh_page_trylock_set(page); if (!try_to_unmap(page, flags)) { stat->nr_unmap_fail += nr_pages; if (!was_swapbacked && PageSwapBacked(page)) @@ -1451,6 +1456,7 @@ static unsigned int shrink_page_list(struct list_head *page_list, * increment nr_reclaimed here (and * leave it off the LRU). */ + trace_android_vh_page_trylock_clear(page); nr_reclaimed++; continue; } @@ -1486,8 +1492,10 @@ static unsigned int shrink_page_list(struct list_head *page_list, */ if (unlikely(PageTransHuge(page))) destroy_compound_page(page); - else + else { + trace_android_vh_page_trylock_clear(page); list_add(&page->lru, &free_pages); + } continue; activate_locked_split: @@ -1999,6 +2007,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec, return 0; nr_reclaimed = shrink_page_list(&page_list, pgdat, sc, &stat, false); + trace_android_vh_handle_failed_page_trylock(&page_list); spin_lock_irq(&pgdat->lru_lock); @@ -2011,7 +2020,6 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec, __count_vm_events(item, nr_reclaimed); __count_memcg_events(lruvec_memcg(lruvec), item, nr_reclaimed); __count_vm_events(PGSTEAL_ANON + file, nr_reclaimed); - spin_unlock_irq(&pgdat->lru_lock); mem_cgroup_uncharge_list(&page_list); @@ -2107,7 +2115,7 @@ static void shrink_active_list(unsigned long nr_to_scan, trace_android_vh_page_referenced_check_bypass(page, nr_to_scan, lru, &bypass); if (bypass) goto skip_page_referenced; - + trace_android_vh_page_trylock_set(page); if (page_referenced(page, 0, sc->target_mem_cgroup, &vm_flags)) { /* @@ -2120,11 +2128,13 @@ static void shrink_active_list(unsigned long nr_to_scan, * so we ignore them here. */ if ((vm_flags & VM_EXEC) && page_is_file_lru(page)) { + trace_android_vh_page_trylock_clear(page); nr_rotated += thp_nr_pages(page); list_add(&page->lru, &l_active); continue; } } + trace_android_vh_page_trylock_clear(page); skip_page_referenced: ClearPageActive(page); /* we are de-activating */ SetPageWorkingset(page); From fb39cdb9eac1fc2a202cefe6a10500dcddfa37bd Mon Sep 17 00:00:00 2001 From: Peifeng Li Date: Sun, 24 Jul 2022 14:04:52 +0800 Subject: [PATCH 02/52] ANDROID: export reclaim_pages export reclaim_pages to support to reclaim pages in drivers-page-list. Bug: 240003372 Signed-off-by: Peifeng Li Change-Id: If92ed66ec9ce9dd66565497e6774d89911652429 --- mm/vmscan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 7899d6905b6e..0f82957c4de7 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2216,6 +2216,7 @@ unsigned long reclaim_pages(struct list_head *page_list) return nr_reclaimed; } +EXPORT_SYMBOL_GPL(reclaim_pages); static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan, struct lruvec *lruvec, struct scan_control *sc) From eed2741ae61dd88e93fe96f6f9a99afa08cff2c4 Mon Sep 17 00:00:00 2001 From: Peifeng Li Date: Wed, 3 Aug 2022 19:42:27 +0800 Subject: [PATCH 03/52] ANDROID: vendor_hook: add hooks to protect locking-tsk in cpu scheduler Providing vendor hooks to record the start time of holding the lock, which protects rwsem/mutex locking-process from being preemptedfor a short time in some cases. - android_vh_record_mutex_lock_starttime - android_vh_record_rtmutex_lock_starttime - android_vh_record_rwsem_lock_starttime - android_vh_record_percpu_rwsem_lock_starttime Bug: 241191475 Signed-off-by: Peifeng Li Change-Id: I0e967a1e8b77c32a1ad588acd54028fae2f90c4e --- drivers/android/vendor_hooks.c | 4 ++++ include/linux/percpu-rwsem.h | 9 ++++++++- include/trace/hooks/dtask.h | 13 ++++++++++++- kernel/locking/mutex.c | 11 +++++++++-- kernel/locking/percpu-rwsem.c | 17 +++++++++++++++++ kernel/locking/rtmutex.c | 8 ++++++++ kernel/locking/rwsem.c | 21 ++++++++++++++++++--- 7 files changed, 76 insertions(+), 7 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 128f63a76938..d62f48f3f00f 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -259,6 +259,10 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_commit_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_override_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_revert_creds); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_mutex_lock_starttime); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rtmutex_lock_starttime); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rwsem_lock_starttime); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_percpu_rwsem_lock_starttime); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_x); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_nx); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_ro); diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index 536976636c58..2f33e0a6e1a9 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h @@ -9,6 +9,9 @@ #include #include +void _trace_android_vh_record_percpu_rwsem_lock_starttime( + struct task_struct *tsk, unsigned long settime); + struct percpu_rw_semaphore { struct rcu_sync rss; unsigned int __percpu *read_count; @@ -73,6 +76,7 @@ static inline void percpu_down_read(struct percpu_rw_semaphore *sem) * bleeding the critical section out. */ preempt_enable(); + _trace_android_vh_record_percpu_rwsem_lock_starttime(current, jiffies); } static inline bool percpu_down_read_trylock(struct percpu_rw_semaphore *sem) @@ -93,14 +97,17 @@ static inline bool percpu_down_read_trylock(struct percpu_rw_semaphore *sem) * bleeding the critical section out. */ - if (ret) + if (ret) { + _trace_android_vh_record_percpu_rwsem_lock_starttime(current, jiffies); rwsem_acquire_read(&sem->dep_map, 0, 1, _RET_IP_); + } return ret; } static inline void percpu_up_read(struct percpu_rw_semaphore *sem) { + _trace_android_vh_record_percpu_rwsem_lock_starttime(current, 0); rwsem_release(&sem->dep_map, _RET_IP_); preempt_disable(); diff --git a/include/trace/hooks/dtask.h b/include/trace/hooks/dtask.h index 9890bfe5c41d..fcf0ea550455 100644 --- a/include/trace/hooks/dtask.h +++ b/include/trace/hooks/dtask.h @@ -71,7 +71,18 @@ DECLARE_HOOK(android_vh_mutex_unlock_slowpath_end, DECLARE_HOOK(android_vh_mutex_start_check_new_owner, TP_PROTO(struct mutex *lock), TP_ARGS(lock)); - +DECLARE_HOOK(android_vh_record_mutex_lock_starttime, + TP_PROTO(struct task_struct *tsk, unsigned long settime_jiffies), + TP_ARGS(tsk, settime_jiffies)); +DECLARE_HOOK(android_vh_record_rtmutex_lock_starttime, + TP_PROTO(struct task_struct *tsk, unsigned long settime_jiffies), + TP_ARGS(tsk, settime_jiffies)); +DECLARE_HOOK(android_vh_record_rwsem_lock_starttime, + TP_PROTO(struct task_struct *tsk, unsigned long settime_jiffies), + TP_ARGS(tsk, settime_jiffies)); +DECLARE_HOOK(android_vh_record_percpu_rwsem_lock_starttime, + TP_PROTO(struct task_struct *tsk, unsigned long settime_jiffies), + TP_ARGS(tsk, settime_jiffies)); /* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_DTASK_H */ diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c index 6d4f413264d2..4fa524e21420 100644 --- a/kernel/locking/mutex.c +++ b/kernel/locking/mutex.c @@ -170,8 +170,10 @@ static __always_inline bool __mutex_trylock_fast(struct mutex *lock) unsigned long curr = (unsigned long)current; unsigned long zero = 0UL; - if (atomic_long_try_cmpxchg_acquire(&lock->owner, &zero, curr)) + if (atomic_long_try_cmpxchg_acquire(&lock->owner, &zero, curr)) { + trace_android_vh_record_mutex_lock_starttime(current, jiffies); return true; + } return false; } @@ -748,6 +750,7 @@ static noinline void __sched __mutex_unlock_slowpath(struct mutex *lock, unsigne */ void __sched mutex_unlock(struct mutex *lock) { + trace_android_vh_record_mutex_lock_starttime(current, 0); #ifndef CONFIG_DEBUG_LOCK_ALLOC if (__mutex_unlock_fast(lock)) return; @@ -978,6 +981,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, lock_acquired(&lock->dep_map, ip); if (ww_ctx) ww_mutex_set_context_fastpath(ww, ww_ctx); + trace_android_vh_record_mutex_lock_starttime(current, jiffies); preempt_enable(); return 0; } @@ -1097,6 +1101,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, spin_unlock(&lock->wait_lock); preempt_enable(); + trace_android_vh_record_mutex_lock_starttime(current, jiffies); return 0; err: @@ -1433,8 +1438,10 @@ int __sched mutex_trylock(struct mutex *lock) #endif locked = __mutex_trylock(lock); - if (locked) + if (locked) { + trace_android_vh_record_mutex_lock_starttime(current, jiffies); mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); + } return locked; } diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c index b88eda4eb624..4a9e7aafd7f4 100644 --- a/kernel/locking/percpu-rwsem.c +++ b/kernel/locking/percpu-rwsem.c @@ -10,6 +10,21 @@ #include #include +#include + +/* + * trace_android_vh_record_percpu_rwsem_lock_starttime is called in + * include/linux/percpu-rwsem.h by including include/hooks/dtask.h, which + * will result to build-err. So we create + * func:_trace_android_vh_record_percpu_rwsem_lock_starttime for percpu-rwsem.h to call. + */ +void _trace_android_vh_record_percpu_rwsem_lock_starttime(struct task_struct *tsk, + unsigned long settime) +{ + trace_android_vh_record_percpu_rwsem_lock_starttime(tsk, settime); +} +EXPORT_SYMBOL_GPL(_trace_android_vh_record_percpu_rwsem_lock_starttime); + int __percpu_init_rwsem(struct percpu_rw_semaphore *sem, const char *name, struct lock_class_key *key) { @@ -237,11 +252,13 @@ void percpu_down_write(struct percpu_rw_semaphore *sem) /* Wait for all active readers to complete. */ rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE); + trace_android_vh_record_percpu_rwsem_lock_starttime(current, jiffies); } EXPORT_SYMBOL_GPL(percpu_down_write); void percpu_up_write(struct percpu_rw_semaphore *sem) { + trace_android_vh_record_percpu_rwsem_lock_starttime(current, 0); rwsem_release(&sem->dep_map, _RET_IP_); /* diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 49c0fa173bde..419cc6639894 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -1471,6 +1471,7 @@ static inline void __rt_mutex_lock(struct rt_mutex *lock, unsigned int subclass) mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_); rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, rt_mutex_slowlock); + trace_android_vh_record_rtmutex_lock_starttime(current, jiffies); } #ifdef CONFIG_DEBUG_LOCK_ALLOC @@ -1519,6 +1520,8 @@ int __sched rt_mutex_lock_interruptible(struct rt_mutex *lock) ret = rt_mutex_fastlock(lock, TASK_INTERRUPTIBLE, rt_mutex_slowlock); if (ret) mutex_release(&lock->dep_map, _RET_IP_); + else + trace_android_vh_record_rtmutex_lock_starttime(current, jiffies); return ret; } @@ -1563,6 +1566,8 @@ rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout) rt_mutex_slowlock); if (ret) mutex_release(&lock->dep_map, _RET_IP_); + else + trace_android_vh_record_rtmutex_lock_starttime(current, jiffies); return ret; } @@ -1589,6 +1594,8 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock) ret = rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock); if (ret) mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); + else + trace_android_vh_record_rtmutex_lock_starttime(current, jiffies); return ret; } @@ -1603,6 +1610,7 @@ void __sched rt_mutex_unlock(struct rt_mutex *lock) { mutex_release(&lock->dep_map, _RET_IP_); rt_mutex_fastunlock(lock, rt_mutex_slowunlock); + trace_android_vh_record_rtmutex_lock_starttime(current, 0); } EXPORT_SYMBOL_GPL(rt_mutex_unlock); diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c index a33e6a36dae9..d368d1a1af49 100644 --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c @@ -279,6 +279,10 @@ static inline bool rwsem_read_trylock(struct rw_semaphore *sem) long cnt = atomic_long_add_return_acquire(RWSEM_READER_BIAS, &sem->count); if (WARN_ON_ONCE(cnt < 0)) rwsem_set_nonspinnable(sem); + + if ((cnt & RWSEM_READ_FAILED_MASK) == 0) + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); + return !(cnt & RWSEM_READ_FAILED_MASK); } @@ -1021,9 +1025,11 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, int state) raw_spin_unlock_irq(&sem->wait_lock); wake_up_q(&wake_q); } + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); return sem; } else if (rwsem_reader_phase_trylock(sem, waiter.last_rowner)) { /* rwsem_reader_phase_trylock() implies ACQUIRE on success */ + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); return sem; } @@ -1104,6 +1110,7 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, int state) __set_current_state(TASK_RUNNING); trace_android_vh_rwsem_read_wait_finish(sem); lockevent_inc(rwsem_rlock); + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); return sem; out_nolock: @@ -1150,6 +1157,7 @@ rwsem_down_write_slowpath(struct rw_semaphore *sem, int state) if (rwsem_can_spin_on_owner(sem, RWSEM_WR_NONSPINNABLE) && rwsem_optimistic_spin(sem, true)) { /* rwsem_optimistic_spin() implies ACQUIRE on success */ + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); return sem; } @@ -1280,7 +1288,7 @@ rwsem_down_write_slowpath(struct rw_semaphore *sem, int state) rwsem_disable_reader_optspin(sem, disable_rspin); raw_spin_unlock_irq(&sem->wait_lock); lockevent_inc(rwsem_wlock); - + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); return ret; out_nolock: @@ -1396,6 +1404,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem) if (atomic_long_try_cmpxchg_acquire(&sem->count, &tmp, tmp + RWSEM_READER_BIAS)) { rwsem_set_reader_owned(sem); + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); return 1; } } while (!(tmp & RWSEM_READ_FAILED_MASK)); @@ -1410,10 +1419,12 @@ static inline void __down_write(struct rw_semaphore *sem) long tmp = RWSEM_UNLOCKED_VALUE; if (unlikely(!atomic_long_try_cmpxchg_acquire(&sem->count, &tmp, - RWSEM_WRITER_LOCKED))) + RWSEM_WRITER_LOCKED))) { rwsem_down_write_slowpath(sem, TASK_UNINTERRUPTIBLE); - else + } else { + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); rwsem_set_owner(sem); + } } static inline int __down_write_killable(struct rw_semaphore *sem) @@ -1425,6 +1436,7 @@ static inline int __down_write_killable(struct rw_semaphore *sem) if (IS_ERR(rwsem_down_write_slowpath(sem, TASK_KILLABLE))) return -EINTR; } else { + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); rwsem_set_owner(sem); } return 0; @@ -1440,6 +1452,7 @@ static inline int __down_write_trylock(struct rw_semaphore *sem) if (atomic_long_try_cmpxchg_acquire(&sem->count, &tmp, RWSEM_WRITER_LOCKED)) { rwsem_set_owner(sem); + trace_android_vh_record_rwsem_lock_starttime(current, jiffies); return true; } return false; @@ -1455,6 +1468,7 @@ static inline void __up_read(struct rw_semaphore *sem) DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem); DEBUG_RWSEMS_WARN_ON(!is_rwsem_reader_owned(sem), sem); + trace_android_vh_record_rwsem_lock_starttime(current, 0); rwsem_clear_reader_owned(sem); tmp = atomic_long_add_return_release(-RWSEM_READER_BIAS, &sem->count); DEBUG_RWSEMS_WARN_ON(tmp < 0, sem); @@ -1481,6 +1495,7 @@ static inline void __up_write(struct rw_semaphore *sem) DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE), sem); + trace_android_vh_record_rwsem_lock_starttime(current, 0); rwsem_clear_owner(sem); tmp = atomic_long_fetch_add_release(-RWSEM_WRITER_LOCKED, &sem->count); if (unlikely(tmp & RWSEM_FLAG_WAITERS)) From 8d868467814e79d4770c276f954e5dd928401da6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Aug 2022 12:53:02 +0200 Subject: [PATCH 04/52] Revert "ANDROID: vendor_hooks: Add hooks for binder" This reverts commit acefa91e517b9321295429d3a0e534908e2939c1. The hooks trace_android_vh_binder_proc_transaction_entry and trace_android_vh_binder_select_worklist_ilocked are not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 219898723 Cc: Liujie Xie Signed-off-by: Greg Kroah-Hartman Change-Id: I2c04e60fa9d6eb6d85be7882d12f1b70956b8e80 --- drivers/android/binder.c | 12 ++---------- drivers/android/vendor_hooks.c | 2 -- include/trace/hooks/binder.h | 9 --------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index ba7d6a96514f..e2f6da3332a6 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2576,7 +2576,6 @@ static int binder_proc_transaction(struct binder_transaction *t, struct binder_priority node_prio; bool oneway = !!(t->flags & TF_ONE_WAY); bool pending_async = false; - bool skip = false; struct binder_transaction *t_outdated = NULL; BUG_ON(!node); @@ -2605,10 +2604,7 @@ static int binder_proc_transaction(struct binder_transaction *t, return proc->is_frozen ? BR_FROZEN_REPLY : BR_DEAD_REPLY; } - trace_android_vh_binder_proc_transaction_entry(proc, t, - &thread, node->debug_id, pending_async, !oneway, &skip); - - if (!thread && !pending_async && !skip) + if (!thread && !pending_async) thread = binder_select_thread_ilocked(proc); trace_android_vh_binder_proc_transaction(current, proc->tsk, @@ -4150,10 +4146,6 @@ static int binder_thread_read(struct binder_proc *proc, size_t trsize = sizeof(*trd); binder_inner_proc_lock(proc); - trace_android_vh_binder_select_worklist_ilocked(&list, thread, - proc, wait_for_proc_work); - if (list) - goto skip; if (!binder_worklist_empty_ilocked(&thread->todo)) list = &thread->todo; else if (!binder_worklist_empty_ilocked(&proc->todo) && @@ -4167,7 +4159,7 @@ static int binder_thread_read(struct binder_proc *proc, goto retry; break; } -skip: + if (end - ptr < sizeof(tr) + 4) { binder_inner_proc_unlock(proc); break; diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index d62f48f3f00f..bf1bbb705313 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -294,10 +294,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_reply); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_trans); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_binder_transaction); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_preset); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction_entry); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction_end); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_select_worklist_ilocked); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_new_ref); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_del_ref); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_post_init_entity_util_avg); diff --git a/include/trace/hooks/binder.h b/include/trace/hooks/binder.h index 5147261de15c..fd877ec5b67f 100644 --- a/include/trace/hooks/binder.h +++ b/include/trace/hooks/binder.h @@ -75,11 +75,6 @@ DECLARE_RESTRICTED_HOOK(android_rvh_binder_transaction, DECLARE_HOOK(android_vh_binder_preset, TP_PROTO(struct hlist_head *hhead, struct mutex *lock), TP_ARGS(hhead, lock)); -DECLARE_HOOK(android_vh_binder_proc_transaction_entry, - TP_PROTO(struct binder_proc *proc, struct binder_transaction *t, - struct binder_thread **thread, int node_debug_id, bool pending_async, - bool sync, bool *skip), - TP_ARGS(proc, t, thread, node_debug_id, pending_async, sync, skip)); DECLARE_HOOK(android_vh_binder_proc_transaction, TP_PROTO(struct task_struct *caller_task, struct task_struct *binder_proc_task, struct task_struct *binder_th_task, int node_debug_id, @@ -90,10 +85,6 @@ DECLARE_HOOK(android_vh_binder_proc_transaction_end, struct task_struct *binder_th_task, unsigned int code, bool pending_async, bool sync), TP_ARGS(caller_task, binder_proc_task, binder_th_task, code, pending_async, sync)); -DECLARE_HOOK(android_vh_binder_select_worklist_ilocked, - TP_PROTO(struct list_head **list, struct binder_thread *thread, struct binder_proc *proc, - int wait_for_proc_work), - TP_ARGS(list, thread, proc, wait_for_proc_work)); DECLARE_HOOK(android_vh_binder_new_ref, TP_PROTO(struct task_struct *proc, uint32_t ref_desc, int node_debug_id), TP_ARGS(proc, ref_desc, node_debug_id)); From eb99e6d80ee21eb061c55cdf14c0b05e0c61af4d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Aug 2022 12:57:40 +0200 Subject: [PATCH 05/52] Revert "ANDROID: vendor_hook: Add hook in __free_pages()" This reverts commit 01680ae117e650bbc7b4c2714165218e019efebe. The hook android_vh_free_pages is not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 234214858 Cc: Bing Han Signed-off-by: Greg Kroah-Hartman Change-Id: I36d4bfb83e1605c6fd1f9ff8dcd39cdbcdef8760 --- drivers/android/vendor_hooks.c | 1 - include/trace/hooks/mm.h | 3 --- mm/page_alloc.c | 1 - 3 files changed, 5 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index bf1bbb705313..1eff6b292764 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -446,7 +446,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pidfd_open); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 8b0225ce7ced..0362142a1323 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -254,9 +254,6 @@ DECLARE_HOOK(android_vh_si_swapinfo, DECLARE_HOOK(android_vh_alloc_si, TP_PROTO(struct swap_info_struct **p, bool *skip), TP_ARGS(p, skip)); -DECLARE_HOOK(android_vh_free_pages, - TP_PROTO(struct page *page, unsigned int order), - TP_ARGS(page, order)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d2b7eca3a2bf..9e43e2b8425c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5183,7 +5183,6 @@ static inline void free_the_page(struct page *page, unsigned int order) void __free_pages(struct page *page, unsigned int order) { - trace_android_vh_free_pages(page, order); if (put_page_testzero(page)) free_the_page(page, order); else if (!PageHead(page)) From 567d65e53644b104c63d60c8fd679923708a3a22 Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Tue, 16 Aug 2022 08:55:20 -0700 Subject: [PATCH 06/52] ANDROID: Guard rq_clock_task_mult with CONFIG_SMP rq->cpu only exists on CONFIG_SMP builds. PELT only needs to support SMP-enabled builds, so guard rq_clock_task_mult with CONFIG_SMP to support compilation of kernel without CONFIG_SMP enabled. Change-Id: I7779f5b10b44757dfd4cbc159b6ae3f3f1ddf3e7 Fixes: 93772777248d ("ANDROID: sched: Introducing PELT multiplier") Signed-off-by: Elliot Berman --- kernel/sched/sched.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 4b9eff7c8ee9..80a5af131251 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1193,6 +1193,7 @@ static inline u64 rq_clock_task(struct rq *rq) return rq->clock_task; } +#ifdef CONFIG_SMP DECLARE_PER_CPU(u64, clock_task_mult); static inline u64 rq_clock_task_mult(struct rq *rq) @@ -1202,6 +1203,7 @@ static inline u64 rq_clock_task_mult(struct rq *rq) return per_cpu(clock_task_mult, cpu_of(rq)); } +#endif /** * By default the decay is the default pelt decay period. From 23fdb24a480953b265fdda7d29df91828d92cc8d Mon Sep 17 00:00:00 2001 From: Peifeng Li Date: Tue, 16 Aug 2022 16:14:40 +0800 Subject: [PATCH 07/52] ANDROID: GKI: Update symbols to symbol list Leaf changes summary: 11 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 6 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 5 Added variables 6 Added functions: [A] 'function int __traceiter_android_vh_do_page_trylock(void*, page*, rw_semaphore*, bool*, bool*)' [A] 'function int __traceiter_android_vh_handle_failed_page_trylock(void*, list_head*)' [A] 'function int __traceiter_android_vh_page_trylock_clear(void*, page*)' [A] 'function int __traceiter_android_vh_page_trylock_get_result(void*, page*, bool*)' [A] 'function int __traceiter_android_vh_page_trylock_set(void*, page*)' [A] 'function unsigned long int reclaim_pages(list_head*)' 5 Added variables: [A] 'tracepoint __tracepoint_android_vh_do_page_trylock' [A] 'tracepoint __tracepoint_android_vh_handle_failed_page_trylock' [A] 'tracepoint __tracepoint_android_vh_page_trylock_clear' [A] 'tracepoint __tracepoint_android_vh_page_trylock_get_result' [A] 'tracepoint __tracepoint_android_vh_page_trylock_set' Bug: 193384408 Signed-off-by: Peifeng Li Change-Id: I46e420a9e74fe67d37107a28e7f94148a4434b21 --- android/abi_gki_aarch64.xml | 11523 ++++++++++++++++---------------- android/abi_gki_aarch64_oplus | 11 + 2 files changed, 5644 insertions(+), 5890 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 16bd86e5d344..8c2c3d0ff92e 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -450,6 +450,7 @@ + @@ -479,6 +480,7 @@ + @@ -517,6 +519,9 @@ + + + @@ -4311,6 +4316,7 @@ + @@ -6304,6 +6310,7 @@ + @@ -6334,6 +6341,7 @@ + @@ -6375,6 +6383,9 @@ + + + @@ -7392,7 +7403,6 @@ - @@ -9179,9 +9189,9 @@ - - - + + + @@ -9202,7 +9212,6 @@ - @@ -9288,7 +9297,6 @@ - @@ -12631,8 +12639,8 @@ - - + + @@ -14713,9 +14721,9 @@ - + - + @@ -15454,12 +15462,6 @@ - - - - - - @@ -19103,7 +19105,6 @@ - @@ -19494,11 +19495,7 @@ - - - - - + @@ -20454,7 +20451,6 @@ - @@ -20652,7 +20648,6 @@ - @@ -21093,14 +21088,6 @@ - - - - - - - - @@ -25123,7 +25110,7 @@ - + @@ -25162,7 +25149,6 @@ - @@ -26334,7 +26320,7 @@ - + @@ -26492,7 +26478,7 @@ - + @@ -26721,7 +26707,6 @@ - @@ -26799,7 +26784,7 @@ - + @@ -27415,36 +27400,36 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -27872,7 +27857,7 @@ - + @@ -28821,7 +28806,6 @@ - @@ -31691,9 +31675,6 @@ - - - @@ -32702,9 +32683,9 @@ - - - + + + @@ -33605,7 +33586,6 @@ - @@ -34436,10 +34416,9 @@ - - + @@ -35050,7 +35029,7 @@ - + @@ -36691,10 +36670,6 @@ - - - - @@ -38626,7 +38601,6 @@ - @@ -39417,8 +39391,8 @@ - - + + @@ -40393,17 +40367,6 @@ - - - - - - - - - - - @@ -40684,9 +40647,9 @@ - - - + + + @@ -42203,7 +42166,6 @@ - @@ -44695,13 +44657,6 @@ - - - - - - - @@ -44731,11 +44686,6 @@ - - - - - @@ -45183,12 +45133,12 @@ - - - - - - + + + + + + @@ -45319,7 +45269,6 @@ - @@ -46102,21 +46051,21 @@ - + - + - + - + - + - + @@ -48221,8 +48170,8 @@ - - + + @@ -49836,11 +49785,6 @@ - - - - - @@ -50252,7 +50196,7 @@ - + @@ -50968,56 +50912,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -52308,7 +52203,7 @@ - + @@ -53153,7 +53048,6 @@ - @@ -53597,7 +53491,6 @@ - @@ -54637,7 +54530,6 @@ - @@ -55569,9 +55461,9 @@ - - - + + + @@ -56882,7 +56774,7 @@ - + @@ -57350,7 +57242,7 @@ - + @@ -59602,7 +59494,6 @@ - @@ -60066,11 +59957,6 @@ - - - - - @@ -61295,44 +61181,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -62565,65 +62414,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -64120,7 +63911,6 @@ - @@ -64436,15 +64226,15 @@ - + - + - + - + @@ -65526,7 +65316,7 @@ - + @@ -66048,10 +65838,10 @@ - - - - + + + + @@ -67347,11 +67137,6 @@ - - - - - @@ -68381,11 +68166,6 @@ - - - - - @@ -68848,7 +68628,7 @@ - + @@ -73396,8 +73176,8 @@ - - + + @@ -73516,7 +73296,6 @@ - @@ -73842,7 +73621,6 @@ - @@ -74207,8 +73985,8 @@ - - + + @@ -74748,38 +74526,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -74890,7 +74637,7 @@ - + @@ -77584,7 +77331,6 @@ - @@ -79012,12 +78758,12 @@ - + - + @@ -80102,12 +79848,12 @@ - - - - - - + + + + + + @@ -81645,7 +81391,6 @@ - @@ -83096,11 +82841,6 @@ - - - - - @@ -83123,7 +82863,6 @@ - @@ -83584,7 +83323,7 @@ - + @@ -83660,14 +83399,6 @@ - - - - - - - - @@ -87410,7 +87141,7 @@ - + @@ -88092,9 +87823,9 @@ - - - + + + @@ -88563,26 +88294,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -88607,7 +88319,7 @@ - + @@ -90143,7 +89855,7 @@ - + @@ -90791,8 +90503,8 @@ - - + + @@ -93050,7 +92762,7 @@ - + @@ -93225,7 +92937,7 @@ - + @@ -93661,12 +93373,12 @@ - + - + @@ -93758,7 +93470,6 @@ - @@ -95233,7 +94944,6 @@ - @@ -96520,7 +96230,7 @@ - + @@ -97032,7 +96742,7 @@ - + @@ -97084,7 +96794,7 @@ - + @@ -97522,7 +97232,7 @@ - + @@ -98234,9 +97944,6 @@ - - - @@ -99752,8 +99459,8 @@ - - + + @@ -99973,8 +99680,8 @@ - - + + @@ -102123,12 +101830,12 @@ - + - + - + @@ -103665,9 +103372,6 @@ - - - @@ -103706,7 +103410,7 @@ - + @@ -103847,8 +103551,8 @@ - - + + @@ -104449,7 +104153,6 @@ - @@ -108802,20 +108505,6 @@ - - - - - - - - - - - - - - @@ -113113,11 +112802,6 @@ - - - - - @@ -115234,7 +114918,6 @@ - @@ -115319,7 +115002,6 @@ - @@ -115443,8 +115125,8 @@ - - + + @@ -117616,9 +117298,9 @@ - - - + + + @@ -117627,14 +117309,14 @@ - - - + + + - - - + + + @@ -117780,11 +117462,11 @@ - - - - - + + + + + @@ -117811,18 +117493,18 @@ - - - - - + + + + + - - - - - + + + + + @@ -118082,25 +117764,25 @@ - - - - - - - - + + + + + + + + - - - + + + - - - - + + + + @@ -118166,11 +117848,19 @@ - - - - - + + + + + + + + + + + + + @@ -118180,9 +117870,9 @@ - - - + + + @@ -118191,14 +117881,14 @@ - - - - - - - - + + + + + + + + @@ -118231,10 +117921,10 @@ - - - - + + + + @@ -118243,22 +117933,22 @@ - - - + + + - - - - + + + + - - - - - + + + + + @@ -118337,11 +118027,11 @@ - - - - - + + + + + @@ -118355,11 +118045,16 @@ - - - - - + + + + + + + + + + @@ -118431,11 +118126,11 @@ - - - - - + + + + + @@ -118460,9 +118155,9 @@ - - - + + + @@ -118472,52 +118167,52 @@ - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - - - - - - + + + + + + + + - - - - + + + + @@ -118586,25 +118281,41 @@ - - - - + + + + - - - - - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -118636,14 +118347,14 @@ - - - - - - - - + + + + + + + + @@ -118702,16 +118413,16 @@ - - - - + + + + - - - - + + + + @@ -118839,9 +118550,9 @@ - - - + + + @@ -118850,10 +118561,10 @@ - - - - + + + + @@ -118861,10 +118572,10 @@ - - - - + + + + @@ -118873,10 +118584,10 @@ - - - - + + + + @@ -118936,12 +118647,12 @@ - - - - - - + + + + + + @@ -119063,13 +118774,13 @@ - - - - - - - + + + + + + + @@ -119588,10 +119299,10 @@ - + - - + + @@ -119619,12 +119330,12 @@ - + - - + + @@ -119663,9 +119374,9 @@ - - - + + + @@ -119676,21 +119387,22 @@ - + + - + - + - + - - - + + + @@ -119704,11 +119416,12 @@ - + + - + @@ -119721,20 +119434,20 @@ - + - + - - - - - - - - + + + + + + + + @@ -119744,12 +119457,15 @@ - + - - - + + + + + + @@ -119757,7 +119473,7 @@ - + @@ -119775,8 +119491,8 @@ - - + + @@ -119800,18 +119516,18 @@ - + - + - + - + - + @@ -119819,7 +119535,7 @@ - + @@ -119838,14 +119554,14 @@ - + - + @@ -120108,9 +119824,9 @@ - - - + + + @@ -120121,33 +119837,33 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - + + + - - - + + + @@ -120157,27 +119873,27 @@ - - - + + + - - - + + + - - - + + + - - - + + + @@ -120187,8 +119903,8 @@ - - + + @@ -120207,8 +119923,8 @@ - - + + @@ -120224,57 +119940,57 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + @@ -120285,16 +120001,16 @@ - - + + - - + + @@ -120322,12 +120038,12 @@ - - - - - - + + + + + + @@ -120344,9 +120060,9 @@ - - - + + + @@ -120362,29 +120078,29 @@ - - + + - - - - - + + + + + - - - + + + - - + + - - - + + + @@ -120401,15 +120117,15 @@ - - - + + + - - - + + + @@ -120422,22 +120138,22 @@ - - - - + + + + - - - - + + + + - - - - + + + + @@ -120516,13 +120232,13 @@ - - - - - - - + + + + + + + @@ -120531,29 +120247,29 @@ - - - + + + - - - - - - + + + + + + - - - - + + + + - - + + @@ -120595,11 +120311,11 @@ - - - - - + + + + + @@ -120619,14 +120335,14 @@ - - + + - - - - + + + + @@ -120649,15 +120365,15 @@ - - - - + + + + - - - + + + @@ -120665,11 +120381,11 @@ - - - - - + + + + + @@ -120720,21 +120436,21 @@ - - - - - + + + + + - - - - - - + + + + + + - - + + @@ -120775,18 +120491,18 @@ - - + + - - - + + + - - - + + + @@ -120819,17 +120535,17 @@ - - - - + + + + - - - - - + + + + + @@ -120840,47 +120556,47 @@ - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - - - + + + + - - + + - - + + @@ -120890,15 +120606,15 @@ - - + + - - - - - + + + + + @@ -120911,9 +120627,9 @@ - - - + + + @@ -120922,49 +120638,49 @@ - - - - + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + @@ -120974,10 +120690,10 @@ - - - - + + + + @@ -121027,17 +120743,17 @@ - - + + - - + + - - - + + + @@ -121072,10 +120788,10 @@ - - - - + + + + @@ -121107,13 +120823,13 @@ - - - + + + - - + + @@ -121144,8 +120860,8 @@ - - + + @@ -121154,8 +120870,8 @@ - - + + @@ -121177,8 +120893,8 @@ - - + + @@ -121225,8 +120941,8 @@ - - + + @@ -121248,14 +120964,14 @@ - - + + - - - - + + + + @@ -121291,9 +121007,9 @@ - - - + + + @@ -121442,16 +121158,16 @@ - - + + - - + + @@ -121500,42 +121216,42 @@ - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - + + + - - - - - - + + + + + + - - - + + + @@ -121556,31 +121272,31 @@ - - - - + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + @@ -121598,9 +121314,9 @@ - - - + + + @@ -121648,67 +121364,67 @@ - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + + @@ -121724,16 +121440,16 @@ - - + + - - - - - - + + + + + + @@ -121754,22 +121470,22 @@ - - + + - - + + - - + + - - + + @@ -121793,23 +121509,23 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + @@ -121819,8 +121535,8 @@ - - + + @@ -121833,8 +121549,8 @@ - - + + @@ -121904,9 +121620,9 @@ - - - + + + @@ -121950,11 +121666,11 @@ - - - - - + + + + + @@ -121970,19 +121686,19 @@ - - - + + + - - - + + + - - - + + + @@ -122014,9 +121730,9 @@ - - - + + + @@ -122105,14 +121821,14 @@ - - - + + + - - - + + + @@ -122124,47 +121840,47 @@ - - - + + + - - - - + + + + - - + + - - - - - + + + + + - - - - - + + + + + - - + + - - - - + + + + - - + + @@ -122177,30 +121893,30 @@ - - + + - - + + - - + + - - - + + + - - - + + + @@ -122209,48 +121925,48 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - + + + @@ -122261,8 +121977,8 @@ - - + + @@ -122380,8 +122096,8 @@ - - + + @@ -122489,28 +122205,28 @@ - - - + + + - - + + - - - - - + + + + + @@ -122521,13 +122237,13 @@ - - - - - - - + + + + + + + @@ -122538,11 +122254,11 @@ - - - - - + + + + + @@ -122554,11 +122270,11 @@ - - - - - + + + + + @@ -122577,8 +122293,8 @@ - - + + @@ -122615,10 +122331,10 @@ - - - - + + + + @@ -122656,22 +122372,22 @@ - - + + - - - - + + + + - - + + - - + + @@ -122682,9 +122398,9 @@ - - - + + + @@ -122703,15 +122419,15 @@ - - + + - - - - + + + + @@ -122722,9 +122438,9 @@ - - - + + + @@ -122785,8 +122501,8 @@ - - + + @@ -122817,18 +122533,18 @@ - - + + - - - + + + - - - + + + @@ -122840,8 +122556,8 @@ - - + + @@ -122857,9 +122573,9 @@ - - - + + + @@ -122892,12 +122608,12 @@ - - + + - - + + @@ -122908,23 +122624,23 @@ - - + + - - - + + + - - - - + + + + @@ -122939,9 +122655,9 @@ - - - + + + @@ -122960,8 +122676,8 @@ - - + + @@ -122981,58 +122697,58 @@ - - - + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - + - + - - - + + + - - - - - + + + + + - - - - - + + + + + @@ -123081,16 +122797,16 @@ - - + + - - + + @@ -123125,10 +122841,10 @@ - - - - + + + + @@ -123183,42 +122899,42 @@ - - - - - - + + + + + + - - - - - - + + + + + + - - + + - - - + + + - - - + + + - + @@ -123261,10 +122977,10 @@ - - - - + + + + @@ -123272,9 +122988,9 @@ - - - + + + @@ -123284,7 +123000,7 @@ - + @@ -123309,8 +123025,8 @@ - - + + @@ -123331,22 +123047,22 @@ - - + + - - - + + + - - - + + + @@ -123396,11 +123112,11 @@ - - - - - + + + + + @@ -123408,44 +123124,44 @@ - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - + + - - + + - - - - + + + + @@ -123470,8 +123186,8 @@ - - + + @@ -123496,18 +123212,18 @@ - - - + + + - - - + + + @@ -123524,9 +123240,9 @@ - - - + + + @@ -123537,11 +123253,11 @@ - - - - - + + + + + @@ -123551,11 +123267,11 @@ - - + + - + @@ -123577,17 +123293,17 @@ - - + + - - + + - - - + + + @@ -123595,22 +123311,22 @@ - - + + - - + + - - - - + + + + @@ -123618,9 +123334,9 @@ - - - + + + @@ -123651,12 +123367,12 @@ - - + + - - + + @@ -123665,7 +123381,7 @@ - + @@ -123696,11 +123412,11 @@ - - - - - + + + + + @@ -123710,17 +123426,17 @@ - - - + + + - - - - - - + + + + + + @@ -123732,12 +123448,12 @@ - - - - - - + + + + + + @@ -123774,11 +123490,11 @@ - - - - - + + + + + @@ -123788,11 +123504,11 @@ - - - - - + + + + + @@ -123824,9 +123540,9 @@ - - - + + + @@ -123837,8 +123553,8 @@ - - + + @@ -123848,9 +123564,9 @@ - - - + + + @@ -123859,11 +123575,11 @@ - - - - - + + + + + @@ -123876,16 +123592,16 @@ - - + + - - + + - - + + @@ -123902,18 +123618,18 @@ - - - - + + + + - - + + @@ -123955,49 +123671,49 @@ - - + + - - - - + + + + - - - + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -124019,9 +123735,9 @@ - - - + + + @@ -124034,9 +123750,9 @@ - - - + + + @@ -124058,10 +123774,10 @@ - - - - + + + + @@ -124092,15 +123808,15 @@ - - - - + + + + - - - + + + @@ -124120,8 +123836,8 @@ - - + + @@ -124137,8 +123853,8 @@ - - + + @@ -124146,13 +123862,13 @@ - - + + - - - + + + @@ -124163,9 +123879,9 @@ - - - + + + @@ -124182,16 +123898,16 @@ - - + + - - + + @@ -124216,9 +123932,9 @@ - - - + + + @@ -124312,9 +124028,9 @@ - - - + + + @@ -124327,17 +124043,17 @@ - - - - + + + + - - - - + + + + @@ -124345,10 +124061,10 @@ - - - - + + + + @@ -124356,9 +124072,9 @@ - - - + + + @@ -124383,11 +124099,11 @@ - - - - - + + + + + @@ -124459,20 +124175,20 @@ - - + + - - + + - - + + @@ -124485,8 +124201,8 @@ - - + + @@ -124508,12 +124224,12 @@ - - - - - - + + + + + + @@ -124522,40 +124238,40 @@ - - - + + + - - - - - - - + + + + + + + - - + + - - - + + + - - - - + + + + - - - - + + + + @@ -124590,28 +124306,28 @@ - - - + + + - - + + - - - - + + + + - - - + + + @@ -124633,10 +124349,10 @@ - - - - + + + + @@ -124658,11 +124374,11 @@ - - - - - + + + + + @@ -124685,15 +124401,15 @@ - - - + + + - - - - + + + + @@ -124710,14 +124426,14 @@ - - - + + + - - - + + + @@ -124746,24 +124462,31 @@ - - + + - - + + - - - - + + + + + + + + + + + @@ -124784,10 +124507,10 @@ - - - - + + + + @@ -124795,15 +124518,15 @@ - - - - + + + + - - - + + + @@ -124910,11 +124633,11 @@ - - - - - + + + + + @@ -125112,29 +124835,29 @@ - - - - + + + + - - - + + + - - - - + + + + - - - - - + + + + + @@ -125144,10 +124867,10 @@ - - - - + + + + @@ -125179,6 +124902,11 @@ + + + + + @@ -125186,14 +124914,14 @@ - - - - - - - - + + + + + + + + @@ -125206,9 +124934,9 @@ - - - + + + @@ -125229,6 +124957,12 @@ + + + + + + @@ -125241,8 +124975,8 @@ - - + + @@ -125309,14 +125043,14 @@ - - - + + + - - - + + + @@ -125324,10 +125058,10 @@ - - - - + + + + @@ -125350,6 +125084,11 @@ + + + + + @@ -125380,15 +125119,15 @@ - - - - + + + + - - - + + + @@ -125487,16 +125226,16 @@ - - - + + + - - - - - + + + + + @@ -125552,34 +125291,34 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + - - + + - - - - - + + + + + @@ -125590,12 +125329,12 @@ - - + + - - + + @@ -125704,9 +125443,9 @@ - - - + + + @@ -125728,17 +125467,17 @@ - - + + - - - + + + - - + + @@ -125746,15 +125485,15 @@ - - - + + + - - - - + + + + @@ -125765,34 +125504,34 @@ - - + + - - - - + + + + - - + + - - - + + + - - - - + + + + @@ -125804,9 +125543,9 @@ - - - + + + @@ -125814,8 +125553,8 @@ - - + + @@ -125826,15 +125565,15 @@ - + - - - - - - + + + + + + @@ -125846,13 +125585,13 @@ - - - - + + + + - - + + @@ -125872,10 +125611,10 @@ - - - - + + + + @@ -126033,46 +125772,46 @@ - - - + + + - - - + + + - - + + - - - - - + + + + + - - + + - - - + + + - - - - + + + + - - - - - + + + + + @@ -126205,8 +125944,8 @@ - - + + @@ -126250,8 +125989,8 @@ - - + + @@ -126263,8 +126002,8 @@ - - + + @@ -126275,8 +126014,8 @@ - - + + @@ -126446,9 +126185,9 @@ - - - + + + @@ -126458,62 +126197,62 @@ - - + + - - - + + + - - + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - - + + + - - - + + + @@ -126531,14 +126270,14 @@ - - - + + + - - - + + + @@ -126573,13 +126312,13 @@ - - - - - - - + + + + + + + @@ -126803,62 +126542,62 @@ - - + + - - - + + + - - + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + @@ -126874,15 +126613,15 @@ - - + + - - - - - + + + + + @@ -126893,10 +126632,10 @@ - - - - + + + + @@ -126939,8 +126678,8 @@ - - + + @@ -126948,9 +126687,9 @@ - - - + + + @@ -126987,9 +126726,9 @@ - - - + + + @@ -126998,8 +126737,8 @@ - - + + @@ -127007,19 +126746,19 @@ - - - - - + + + + + - - - - - - + + + + + + @@ -127027,20 +126766,20 @@ - - + + - - + + - - + + - - + + @@ -127053,17 +126792,17 @@ - - + + - - + + - - - + + + @@ -127110,19 +126849,19 @@ - - - - - - - + + + + + + + - - - + + + @@ -127130,17 +126869,17 @@ - - - + + + - - + + @@ -127158,20 +126897,20 @@ - - + + - - + + - - + + @@ -127184,11 +126923,11 @@ - - - - - + + + + + @@ -127199,33 +126938,33 @@ - - - + + + - - - - + + + + - - - - + + + + - - + + - - + + @@ -127535,23 +127274,23 @@ - - + + - - - - + + + + - - - + + + @@ -127567,12 +127306,12 @@ - - - - - - + + + + + + @@ -127624,26 +127363,26 @@ - - - - - + + + + + - - + + - - - - + + + + - - - - + + + + @@ -127798,10 +127537,10 @@ - - - - + + + + @@ -127851,9 +127590,9 @@ - - - + + + @@ -127982,19 +127721,19 @@ - - - + + + - - - + + + - - - + + + @@ -128095,8 +127834,8 @@ - - + + @@ -128118,9 +127857,9 @@ - - - + + + @@ -128153,8 +127892,8 @@ - - + + @@ -128169,24 +127908,24 @@ - - + + - - - + + + - - - - + + + + - - - + + + @@ -128205,9 +127944,9 @@ - - - + + + @@ -128221,18 +127960,18 @@ - - + + - - - + + + - - - + + + @@ -128253,9 +127992,9 @@ - - - + + + @@ -128286,28 +128025,28 @@ - - + + - - + + - - - + + + - - - - + + + + - - - + + + @@ -128318,83 +128057,83 @@ - - - + + + - - - - + + + + - - - + + + - - + + - - - + + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - - + + + + - - - - + + + + @@ -128450,17 +128189,17 @@ - - + + - - + + - - - + + + @@ -128474,20 +128213,20 @@ - - + + - - + + - - + + @@ -128556,9 +128295,9 @@ - - - + + + @@ -128570,44 +128309,44 @@ - - + + - - - - - + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + @@ -128617,12 +128356,12 @@ - - - - - - + + + + + + @@ -128633,9 +128372,9 @@ - - - + + + @@ -128643,18 +128382,18 @@ - - - - + + + + - - - - - - - + + + + + + + @@ -128669,30 +128408,30 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + @@ -128728,8 +128467,8 @@ - - + + @@ -128813,20 +128552,20 @@ - - + + - - - - - - - - - - + + + + + + + + + + @@ -128835,19 +128574,19 @@ - - - + + + - - - - + + + + - - - + + + @@ -128874,40 +128613,40 @@ - - - - + + + + - - + + - - + + - - - + + + - - - - + + + + - - - - + + + + @@ -129146,8 +128885,8 @@ - - + + @@ -129161,13 +128900,13 @@ - - + + - - - + + + @@ -129184,10 +128923,10 @@ - - - - + + + + @@ -129220,14 +128959,14 @@ - - - + + + - - - + + + @@ -129235,17 +128974,17 @@ - - - - + + + + - - + + @@ -129260,9 +128999,9 @@ - - - + + + @@ -129276,54 +129015,54 @@ - - - - + + + + - - + + - - + + - - + + - - - - + + + + - - - - + + + + - - + + - - + + - - - + + + - - + + @@ -129333,15 +129072,15 @@ - - - + + + - - - - + + + + @@ -129374,18 +129113,18 @@ - - - - + + + + - - - - - + + + + + @@ -129393,9 +129132,9 @@ - - - + + + @@ -129429,12 +129168,12 @@ - - + + - - + + @@ -129480,15 +129219,15 @@ - - - + + + - - - - + + + + @@ -129497,13 +129236,13 @@ - - - + + + - - + + @@ -129513,21 +129252,21 @@ - - - + + + - - - - + + + + - - - - + + + + @@ -129543,26 +129282,26 @@ - - + + - - - + + + - - + + - - - + + + @@ -129579,11 +129318,11 @@ - - + + - + @@ -129598,8 +129337,8 @@ - - + + @@ -129647,18 +129386,18 @@ - - - + + + - - + + - - - + + + @@ -129666,13 +129405,13 @@ - - + + - - - + + + @@ -129688,9 +129427,9 @@ - - - + + + @@ -129784,9 +129523,9 @@ - - - + + + @@ -129835,11 +129574,11 @@ - - - - - + + + + + @@ -129859,11 +129598,11 @@ - - - - - + + + + + @@ -129975,8 +129714,8 @@ - - + + @@ -129985,9 +129724,9 @@ - - - + + + @@ -130000,8 +129739,8 @@ - - + + @@ -130044,12 +129783,12 @@ - - + + - - + + @@ -130086,35 +129825,35 @@ - - + + - - - + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - + + + @@ -130126,13 +129865,13 @@ - - - + + + - - + + @@ -130175,36 +129914,36 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - + + + - - - - + + + + - - + + @@ -130247,13 +129986,13 @@ - - - - - - - + + + + + + + @@ -130278,13 +130017,13 @@ - - - + + + - - + + @@ -130320,10 +130059,10 @@ - - - - + + + + @@ -130333,12 +130072,12 @@ - - + + - - + + @@ -130349,17 +130088,17 @@ - - - - - - - + + + + + + + - - + + @@ -130376,8 +130115,8 @@ - - + + @@ -130407,15 +130146,15 @@ - - + + - - - - - + + + + + @@ -130427,8 +130166,8 @@ - - + + @@ -130454,8 +130193,8 @@ - - + + @@ -130469,20 +130208,20 @@ - - + + - + - - - + + + @@ -130499,41 +130238,41 @@ - - - - + + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - + + + @@ -130543,13 +130282,13 @@ - - + + - - - + + + @@ -130563,41 +130302,41 @@ - - - - - - + + + + + + - - + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + @@ -130611,8 +130350,8 @@ - - + + @@ -130624,18 +130363,18 @@ - - + + - - - - + + + + @@ -130659,23 +130398,23 @@ - - - + + + - - - + + + - - - + + + - - + + @@ -130688,9 +130427,9 @@ - - - + + + @@ -130698,29 +130437,29 @@ - - - - + + + + - - + + - - - - - + + + + + - - - - - - + + + + + + @@ -130764,9 +130503,9 @@ - - - + + + @@ -130775,8 +130514,8 @@ - - + + @@ -130785,9 +130524,9 @@ - - - + + + @@ -130884,8 +130623,8 @@ - - + + @@ -130912,10 +130651,10 @@ - - - - + + + + @@ -130927,25 +130666,25 @@ - - - + + + - - + + - - + + - - + + - - + + @@ -130990,10 +130729,10 @@ - - + + - + @@ -131008,22 +130747,22 @@ - - - + + + - - - + + + - - + + - - + + @@ -131080,38 +130819,38 @@ - - - - + + + + - - - - - - - - + + + + + + + + - - + + - - + + - + - - + + @@ -131122,9 +130861,9 @@ - - - + + + @@ -131139,26 +130878,26 @@ - - + + - - - - + + + + - - - - - - + + + + + + - - + + @@ -131169,32 +130908,33 @@ + - - + + - - - + + + - - + + - - - - - + + + + + - - - - + + + + @@ -131209,28 +130949,28 @@ - - - - - + + + + + - - + + - - - - - + + + + + - - - - + + + + @@ -131252,18 +130992,18 @@ - - + + - - + + - - + + @@ -131286,12 +131026,12 @@ - - + + - - + + @@ -131328,9 +131068,9 @@ - - - + + + @@ -131365,81 +131105,81 @@ - - - + + + - - - + + + - - - - + + + + - - - - - - + + + + + + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -131569,12 +131309,12 @@ - - + + - - + + @@ -131617,14 +131357,14 @@ - - + + - - - - + + + + @@ -131645,36 +131385,36 @@ - - - - - + + + + + - - + + - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + @@ -131685,39 +131425,39 @@ - - + + - - - + + + - - - - + + + + - - - + + + - - + + - - - + + + - - - - + + + + @@ -131743,14 +131483,14 @@ - - + + - - - - + + + + @@ -131771,12 +131511,12 @@ - - + + - - + + @@ -131792,8 +131532,8 @@ - - + + @@ -131926,21 +131666,21 @@ - - - - - + + + + + - - - - - - - - + + + + + + + + @@ -131950,8 +131690,8 @@ - - + + @@ -131974,8 +131714,8 @@ - - + + @@ -131983,9 +131723,9 @@ - - - + + + @@ -132005,24 +131745,24 @@ - - - - + + + + - - - + + + - - - - + + + + @@ -132030,50 +131770,50 @@ - - - - - - + + + + + + - - - + + + - - + + - - + + - - - - + + + + - - - + + + - - - + + + - - - + + + @@ -132089,8 +131829,8 @@ - - + + @@ -132111,8 +131851,8 @@ - - + + @@ -132127,8 +131867,8 @@ - - + + @@ -132161,20 +131901,20 @@ - - + + - - + + - - + + @@ -132211,12 +131951,12 @@ - - + + - - + + @@ -132228,34 +131968,34 @@ - - + + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - + + @@ -132340,9 +132080,9 @@ - - - + + + @@ -132503,74 +132243,74 @@ - - - + + + - - + + - - - + + + - - + + - - - - - - + + + + + + - - - - - - + + + + + + - - - + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - + + + - - - - + + + + - - - - + + + + @@ -132578,53 +132318,53 @@ - - - - + + + + - - - - - + + + + + - - - - + + + + - - + + - - + + - - - - - - + + + + + + - - - - - + + + + + @@ -132659,8 +132399,8 @@ - - + + @@ -132760,13 +132500,13 @@ - - - + + + - - + + @@ -132777,15 +132517,15 @@ - - - - - - - - - + + + + + + + + + @@ -132821,9 +132561,9 @@ - - - + + + @@ -132849,30 +132589,30 @@ - - - + + + - - - - + + + + - - - - + + + + - - - + + + @@ -132885,10 +132625,10 @@ - - - - + + + + @@ -132896,11 +132636,11 @@ - - - - - + + + + + @@ -132923,10 +132663,10 @@ - - - - + + + + @@ -132939,20 +132679,20 @@ - - - + + + - - - - + + + + - + - - + + @@ -132969,9 +132709,9 @@ - - - + + + @@ -133073,14 +132813,14 @@ - - - + + + - - + + @@ -133167,8 +132907,8 @@ - - + + @@ -133178,56 +132918,56 @@ - - + + - - - - - - - - - + + + + + + + + + - - + + - - - - - - - - - + + + + + + + + + - - + + - - + + - - + + - - + + - + @@ -133238,10 +132978,10 @@ - - - - + + + + @@ -133267,21 +133007,21 @@ - - - - + + + + - - - + + + - - - - + + + + @@ -133292,35 +133032,35 @@ - - - - - - - - + + + + + + + + - - + + - - - + + + - - - - + + + + - - - - + + + + @@ -133352,46 +133092,46 @@ - - - - + + + + - - - + + + - - + + - - + + - - - + + + - - - - - + + + + + - - + + - - - + + + @@ -133400,35 +133140,35 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - - + + - - + + @@ -133437,23 +133177,23 @@ - - - + + + - - - + + + - - - + + + @@ -133461,34 +133201,34 @@ - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - - - - - + + + + + @@ -133498,16 +133238,16 @@ - - - - + + + + - - - - + + + + @@ -133523,10 +133263,10 @@ - - - - + + + + @@ -133536,10 +133276,10 @@ - - - - + + + + @@ -133549,37 +133289,37 @@ - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + @@ -133590,9 +133330,9 @@ - - - + + + @@ -133606,11 +133346,11 @@ - - - - - + + + + + @@ -133646,11 +133386,11 @@ - - + + - + @@ -133667,15 +133407,15 @@ - - + + - - + + - - + + @@ -133695,8 +133435,8 @@ - - + + @@ -133710,8 +133450,8 @@ - - + + @@ -133723,8 +133463,8 @@ - - + + @@ -133738,18 +133478,18 @@ - - - + + + - - - - + + + + - - + + @@ -133757,10 +133497,10 @@ - - - - + + + + @@ -133773,14 +133513,14 @@ - - - - + + + + - - + + @@ -133816,18 +133556,18 @@ - - - + + + - - - + + + @@ -133838,8 +133578,8 @@ - - + + @@ -133860,10 +133600,10 @@ - - - - + + + + @@ -133873,30 +133613,30 @@ - - - - - + + + + + - - + + - - + + - - - + + + - - + + @@ -133915,11 +133655,11 @@ - - - - - + + + + + @@ -133927,13 +133667,13 @@ - - + + - - + + @@ -133950,11 +133690,11 @@ - - - - - + + + + + @@ -133993,8 +133733,8 @@ - - + + @@ -134002,25 +133742,25 @@ - - - + + + - - + + - - - - + + + + - - - - + + + + @@ -134033,9 +133773,9 @@ - - - + + + @@ -134046,13 +133786,13 @@ - - + + - - - + + + @@ -134060,50 +133800,50 @@ - - - + + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - + + + @@ -134117,8 +133857,8 @@ - - + + @@ -134194,9 +133934,9 @@ - - - + + + @@ -134234,32 +133974,32 @@ - - + + - - - + + + - - - - + + + + - - - + + + - - - + + + - + @@ -134272,9 +134012,9 @@ - - - + + + @@ -134354,10 +134094,10 @@ - - - - + + + + @@ -134402,13 +134142,13 @@ - - - - - - - + + + + + + + @@ -134599,12 +134339,12 @@ - - + + - - + + @@ -134616,11 +134356,11 @@ - - - - - + + + + + @@ -134661,8 +134401,8 @@ - - + + @@ -134715,8 +134455,8 @@ - - + + @@ -134728,9 +134468,9 @@ - - - + + + @@ -134741,28 +134481,28 @@ - - - + + + - - - - - - + + + + + + - - + + - - - - - + + + + + @@ -134773,9 +134513,9 @@ - - - + + + @@ -134836,8 +134576,8 @@ - - + + @@ -134876,9 +134616,9 @@ - - - + + + @@ -134934,8 +134674,8 @@ - - + + @@ -134957,12 +134697,12 @@ - - + + - - + + @@ -134996,8 +134736,8 @@ - - + + @@ -135008,9 +134748,9 @@ - - - + + + @@ -135018,47 +134758,47 @@ - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - - - - + + + + + @@ -135066,18 +134806,18 @@ - - - - + + + + - - + + @@ -135085,14 +134825,14 @@ - - - - + + + + - - - + + + @@ -135128,17 +134868,17 @@ - - + + - - - + + + @@ -135148,9 +134888,9 @@ - - - + + + @@ -135192,12 +134932,12 @@ - - + + - - + + @@ -135211,67 +134951,67 @@ - - - + + + - - + + - - + + - - + + - - + + - - - - - + + + + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + @@ -135279,19 +135019,19 @@ - - + + - - + + - - - - - + + + + + @@ -135302,41 +135042,41 @@ - - - - + + + + - - - + + + - - + + - - - - - + + + + + - - + + - - + + @@ -135350,16 +135090,16 @@ - - - - + + + + - - - - + + + + @@ -135380,11 +135120,11 @@ - - - - - + + + + + @@ -135401,24 +135141,24 @@ - - - - + + + + - - - - - + + + + + - - - - - + + + + + @@ -135443,10 +135183,10 @@ - - - - + + + + @@ -135459,12 +135199,12 @@ - - + + - - + + @@ -135489,18 +135229,18 @@ - - - + + + - - + + - - - + + + @@ -135524,18 +135264,18 @@ - - - - - + + + + + - - - - - + + + + + @@ -135546,19 +135286,19 @@ - - - - + + + + - - + + - - - + + + @@ -135577,14 +135317,14 @@ - - - + + + - - - + + + @@ -135610,9 +135350,9 @@ - - - + + + @@ -135625,22 +135365,22 @@ - - - - + + + + - - + + - - + + @@ -135660,43 +135400,43 @@ - - + + - - - + + + - - - + + + - - - - - + + + + + - - - + + + - - - - - + + + + + @@ -135709,9 +135449,9 @@ - - - + + + @@ -135744,14 +135484,14 @@ - - - - + + + + - - + + @@ -135762,44 +135502,44 @@ - - - - + + + + - - - + + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + @@ -135833,16 +135573,16 @@ - - - - - - + + + + + + - - - + + + @@ -135850,9 +135590,9 @@ - - - + + + @@ -135896,33 +135636,33 @@ - - - + + + - - - + + + - - + + - - + + - - - + + + - - - - + + + + @@ -135947,9 +135687,9 @@ - - - + + + @@ -135965,32 +135705,32 @@ - - - - + + + + - - + + - - + + - - - + + + - - - + + + - - - + + + @@ -135999,9 +135739,9 @@ - - - + + + @@ -136009,74 +135749,74 @@ - - - + + + - - + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - + + - - + + - - - - + + + + @@ -136088,42 +135828,42 @@ - - - - + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - + + @@ -136138,8 +135878,8 @@ - - + + @@ -136159,8 +135899,8 @@ - - + + @@ -136174,61 +135914,61 @@ - - - - - + + + + + - - - + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - + + + + @@ -136246,12 +135986,12 @@ - - - - - - + + + + + + @@ -136262,12 +136002,12 @@ - - - - - - + + + + + + @@ -136282,9 +136022,9 @@ - - - + + + @@ -136297,15 +136037,15 @@ - - + + - - - - - + + + + + @@ -136322,10 +136062,10 @@ - - - - + + + + @@ -136345,10 +136085,10 @@ - - - - + + + + @@ -136394,10 +136134,10 @@ - - - - + + + + @@ -136412,16 +136152,16 @@ - - - + + + - - + + - - + + @@ -136449,11 +136189,11 @@ - - - - - + + + + + @@ -136483,16 +136223,16 @@ - - - - - - + + + + + + - - + + @@ -136595,33 +136335,33 @@ - - + + - - + + - - - - - - + + + + + + - - - + + + - - + + @@ -136647,8 +136387,8 @@ - - + + @@ -136668,16 +136408,16 @@ - - + + - - + + - - + + @@ -136762,19 +136502,19 @@ - - - + + + - - - + + + - - - + + + @@ -136789,8 +136529,8 @@ - - + + @@ -136821,9 +136561,9 @@ - - - + + + @@ -136853,14 +136593,14 @@ - - - + + + - - - + + + @@ -136873,9 +136613,9 @@ - - - + + + @@ -136883,10 +136623,10 @@ - - - - + + + + @@ -136900,12 +136640,12 @@ - - + + - - + + @@ -136926,9 +136666,9 @@ - - - + + + @@ -136940,9 +136680,9 @@ - - - + + + @@ -136990,8 +136730,8 @@ - - + + @@ -137037,9 +136777,9 @@ - - - + + + @@ -137055,10 +136795,10 @@ - - - - + + + + @@ -137079,10 +136819,10 @@ - - - - + + + + @@ -137115,17 +136855,17 @@ - - + + - - - + + + @@ -137139,55 +136879,55 @@ - - - - + + + + - - + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - - - + + + - - + + - - + + - - + + @@ -137209,20 +136949,20 @@ - - - - - - + + + + + + - - + + - - + + @@ -137230,21 +136970,21 @@ - - - - - + + + + + - - - - - + + + + + - - + + @@ -137255,7 +136995,7 @@ - + @@ -137274,21 +137014,21 @@ - - - - + + + + - - - - - - - - - + + + + + + + + + @@ -137322,8 +137062,8 @@ - - + + @@ -137343,9 +137083,9 @@ - - - + + + @@ -137353,23 +137093,23 @@ - - - + + + - - - + + + - - - + + + @@ -137390,37 +137130,37 @@ - - + + - - - - + + + + - - - + + + - - + + - - - - + + + + @@ -137434,11 +137174,11 @@ - - - - - + + + + + @@ -137448,12 +137188,12 @@ - - - - - - + + + + + + @@ -137497,10 +137237,10 @@ - - - - + + + + @@ -137559,24 +137299,24 @@ - - + + - - + + - - + + @@ -137586,11 +137326,11 @@ - - - - - + + + + + @@ -137635,14 +137375,14 @@ - - - - + + + + - - - + + + @@ -137875,8 +137615,8 @@ - - + + @@ -137896,29 +137636,29 @@ - - - + + + - - + + - - + + - - + + - - + + - - + + @@ -137930,14 +137670,14 @@ - - - + + + - - - + + + @@ -137950,16 +137690,16 @@ - - - - + + + + - - - - + + + + @@ -138015,12 +137755,12 @@ - - + + - - + + @@ -138067,24 +137807,24 @@ - - + + - - + + - - + + - - + + @@ -138104,13 +137844,13 @@ - - + + - - - + + + @@ -138124,16 +137864,16 @@ - - - - + + + + - - - - + + + + @@ -138146,9 +137886,9 @@ - - - + + + @@ -138169,8 +137909,8 @@ - - + + @@ -138185,8 +137925,8 @@ - - + + @@ -138220,8 +137960,8 @@ - - + + @@ -138239,10 +137979,10 @@ - - - - + + + + @@ -138255,54 +137995,54 @@ - - + + - - - + + + - - + + - + - + - - - - + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + - - + + - - + + @@ -138311,36 +138051,36 @@ - - - - - + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + @@ -138351,12 +138091,12 @@ - - - - - - + + + + + + @@ -138375,9 +138115,9 @@ - - - + + + @@ -138387,8 +138127,8 @@ - - + + @@ -138402,10 +138142,10 @@ - - - - + + + + @@ -138418,13 +138158,13 @@ - - - + + + - - + + @@ -138477,11 +138217,11 @@ - - - - - + + + + + @@ -138497,24 +138237,24 @@ - - + + - - + + - - + + - - + + @@ -138522,24 +138262,24 @@ - - + + - - + + - - + + @@ -138599,8 +138339,8 @@ - - + + @@ -138610,28 +138350,28 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + @@ -138645,23 +138385,23 @@ - - - + + + - - + + - - - - + + + + - - + + @@ -138684,48 +138424,48 @@ - - - + + + - - - + + + - - - + + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + @@ -138734,7 +138474,7 @@ - + @@ -138774,17 +138514,17 @@ - + - + - - + + @@ -138803,8 +138543,8 @@ - - + + @@ -138841,10 +138581,14 @@ - - + + + + + + @@ -138854,23 +138598,23 @@ - - - - + + + + - - - + + + - - - + + + @@ -138930,8 +138674,8 @@ - - + + @@ -138972,16 +138716,16 @@ - - + + - - + + - - + + @@ -138992,8 +138736,8 @@ - - + + @@ -139016,12 +138760,12 @@ - - + + - - + + @@ -139041,8 +138785,8 @@ - - + + @@ -139161,10 +138905,10 @@ - - - - + + + + @@ -139179,20 +138923,20 @@ - - - - - - - - + + + + + + + + - - - - + + + + @@ -139200,14 +138944,14 @@ - - - + + + - - - + + + @@ -139225,8 +138969,8 @@ - - + + @@ -139238,8 +138982,8 @@ - - + + @@ -139280,8 +139024,8 @@ - - + + @@ -139332,22 +139076,22 @@ - - - - + + + + - - - - + + + + - - - - + + + + @@ -139442,8 +139186,8 @@ - - + + @@ -139451,22 +139195,22 @@ - - + + - - - - - - + + + + + + - - - - + + + + @@ -139479,9 +139223,9 @@ - - - + + + @@ -139489,9 +139233,9 @@ - - - + + + @@ -139539,13 +139283,13 @@ - - - - - - - + + + + + + + @@ -139553,28 +139297,28 @@ - - + + - - + + - - + + - - + + - - + + @@ -139590,20 +139334,20 @@ - - - - - - + + + + + + - - - + + + - - + + @@ -139619,8 +139363,8 @@ - - + + @@ -139637,8 +139381,8 @@ - - + + @@ -139651,15 +139395,15 @@ - - - + + + - - - - + + + + @@ -139667,39 +139411,39 @@ - - - + + + - - - - + + + + - - + + - - - + + + - - - - + + + + - - - + + + - - - + + + @@ -139707,30 +139451,30 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - + + @@ -139857,8 +139601,8 @@ - - + + @@ -139994,12 +139738,12 @@ - - + + - - + + @@ -140016,9 +139760,9 @@ - - - + + + @@ -140026,9 +139770,9 @@ - - - + + + @@ -140036,9 +139780,9 @@ - - - + + + @@ -140063,12 +139807,12 @@ - - + + - - + + @@ -140086,10 +139830,10 @@ - - - - + + + + @@ -140111,61 +139855,61 @@ - - - + + + - - - - + + + + - - - + + + - - + + - - - - - - + + + + + + - - - - + + + + - - - - - - - + + + + + + + - - - + + + - - - + + + - - - + + + @@ -140175,10 +139919,10 @@ - - - - + + + + @@ -140189,13 +139933,13 @@ - + - - - - + + + + @@ -140229,10 +139973,10 @@ - - - - + + + + @@ -140274,7 +140018,7 @@ - + @@ -140282,34 +140026,34 @@ - - + + - - + + - - + + - - - - - - + + + + + + - - - - + + + + - - + + @@ -140320,10 +140064,10 @@ - - - - + + + + @@ -140333,8 +140077,8 @@ - - + + @@ -140345,8 +140089,8 @@ - - + + @@ -140384,8 +140128,8 @@ - - + + @@ -140423,14 +140167,14 @@ - - - - - + + + + + - - + + @@ -140468,11 +140212,11 @@ - - - - - + + + + + @@ -140616,21 +140360,21 @@ - - + + - - - + + + - - + + - - + + @@ -140664,11 +140408,11 @@ - - - - - + + + + + @@ -140683,21 +140427,21 @@ - - + + - - + + - - + + - - - + + + @@ -140713,11 +140457,11 @@ - - - - - + + + + + @@ -140741,12 +140485,12 @@ - - - - - - + + + + + + @@ -140766,28 +140510,28 @@ - - - - + + + + - - - - + + + + - - - + + + - - - - + + + + @@ -140807,26 +140551,26 @@ - - - - + + + + - - - + + + - - - - - + + + + + - - - + + + @@ -140835,20 +140579,20 @@ - - - + + + - - - + + + - - - + + + @@ -140858,26 +140602,26 @@ - - - + + + - - - + + + - - - - + + + + - - - - + + + + @@ -141023,9 +140767,9 @@ - - - + + + @@ -141040,9 +140784,9 @@ - - - + + + @@ -141050,26 +140794,26 @@ - - + + - - - - + + + + - - + + - - + + @@ -141077,25 +140821,25 @@ - - - + + + - - - + + + - - - + + + - - - - + + + + @@ -141107,33 +140851,33 @@ - - - - - - + + + + + + - - - - - - + + + + + + - - - - + + + + - - - + + + @@ -141141,32 +140885,32 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - - + + + - - + + @@ -141177,13 +140921,13 @@ - - - - - - - + + + + + + + @@ -141215,14 +140959,14 @@ - - + + - - - - + + + + @@ -141230,10 +140974,10 @@ - - - - + + + + @@ -141241,10 +140985,10 @@ - - - - + + + + @@ -141267,10 +141011,10 @@ - - - - + + + + @@ -141286,8 +141030,8 @@ - - + + @@ -141297,29 +141041,29 @@ - + - - + + - - + + - - - - + + + + - - - - - - + + + + + + @@ -141348,13 +141092,13 @@ - - - - - - - + + + + + + + @@ -141373,10 +141117,10 @@ - - - - + + + + @@ -141393,10 +141137,10 @@ - - - - + + + + @@ -141406,30 +141150,30 @@ - - - + + + - - - - - - + + + + + + - - + + - - - - - - - + + + + + + + @@ -141446,13 +141190,13 @@ - - + + - - - + + + @@ -141471,39 +141215,39 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - + + + - - + + @@ -141526,55 +141270,55 @@ - - - - - + + + + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - - + + + - - - + + + @@ -141584,9 +141328,9 @@ - - - + + + @@ -141596,16 +141340,16 @@ - - - - - + + + + + - - - + + + @@ -141640,15 +141384,15 @@ - - - + + + - - - - + + + + @@ -141661,11 +141405,11 @@ - - - - - + + + + + @@ -141675,16 +141419,16 @@ - - - - - + + + + + - - - + + + @@ -141694,8 +141438,8 @@ - - + + @@ -141707,25 +141451,25 @@ - - + + - - + + - - - - - - - + + + + + + + - - + + @@ -141736,9 +141480,9 @@ - - - + + + @@ -141790,15 +141534,15 @@ - - - + + + - - - - + + + + @@ -141826,22 +141570,22 @@ - - - - - + + + + + - - - - - + + + + + - - + + @@ -141920,8 +141664,8 @@ - - + + @@ -141931,9 +141675,9 @@ - - - + + + @@ -142002,8 +141746,8 @@ - - + + @@ -142019,9 +141763,9 @@ - - - + + + @@ -142031,17 +141775,17 @@ - - - - + + + + - - - - - + + + + + @@ -142065,17 +141809,17 @@ - - + + - - - - - - - + + + + + + + @@ -142090,23 +141834,23 @@ - - + + - - - - + + + + - - - + + + - - + + @@ -142117,12 +141861,12 @@ - - - - - - + + + + + + @@ -142141,8 +141885,8 @@ - - + + @@ -142154,18 +141898,18 @@ - - - - - - + + + + + + - - - - + + + + @@ -142173,17 +141917,17 @@ - - - + + + - - + + - - + + @@ -142221,9 +141965,9 @@ - - - + + + @@ -142235,8 +141979,8 @@ - - + + @@ -142268,45 +142012,45 @@ - - - + + + - - - - + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + @@ -142351,9 +142095,9 @@ - - - + + + @@ -142384,10 +142128,10 @@ - - - - + + + + @@ -142484,14 +142228,14 @@ - - - - + + + + - - + + @@ -142509,8 +142253,8 @@ - - + + @@ -142772,9 +142516,9 @@ - - - + + + @@ -142863,9 +142607,9 @@ - - - + + + @@ -142886,13 +142630,13 @@ - - - - - - - + + + + + + + @@ -142904,44 +142648,44 @@ - - - + + + - - - - + + + + - - + + - - + + - - - - - - + + + + + + - - + + - - - + + + @@ -143051,9 +142795,9 @@ - - - + + + @@ -143065,17 +142809,17 @@ - - - - - - + + + + + + - - - + + + @@ -143199,9 +142943,9 @@ - - - + + + @@ -143234,34 +142978,34 @@ - - + + - - + + - - + + - - + + - - - - + + + + - - - - - - + + + + + + @@ -143284,9 +143028,9 @@ - - - + + + @@ -143304,8 +143048,8 @@ - - + + @@ -143340,10 +143084,10 @@ - - - - + + + + @@ -143352,26 +143096,26 @@ - - - - + + + + - - - + + + - - - + + + - - - - + + + + @@ -143379,21 +143123,21 @@ - - - - + + + + - - - - - + + + + + - - - + + + @@ -143412,16 +143156,16 @@ - - - + + + - - - + + + - - + + @@ -143453,33 +143197,33 @@ - - + + - - + + - - + + - - + + - - + + - - - + + + @@ -143490,10 +143234,10 @@ - + - + @@ -143505,12 +143249,12 @@ - - + + - - + + @@ -143525,23 +143269,23 @@ - - + + - - + + - - - + + + - + - + @@ -143560,15 +143304,15 @@ - - - + + + - - - - + + + + @@ -143581,27 +143325,27 @@ - - - + + + - - - - + + + + - - - + + + - - - - + + + + @@ -143623,9 +143367,9 @@ - - - + + + @@ -143634,10 +143378,10 @@ - - - - + + + + @@ -143645,9 +143389,9 @@ - - - + + + @@ -143655,9 +143399,9 @@ - - - + + + @@ -143666,17 +143410,17 @@ - - - - + + + + - + @@ -143694,8 +143438,8 @@ - - + + @@ -143775,8 +143519,8 @@ - - + + @@ -143873,16 +143617,16 @@ - - + + - - + + @@ -143891,8 +143635,8 @@ - - + + @@ -143924,19 +143668,19 @@ - - - - - - - - - + + + + + + + + + - - + + @@ -143948,9 +143692,9 @@ - - - + + + @@ -143975,14 +143719,14 @@ - - - - + + + + - - + + @@ -144010,9 +143754,9 @@ - - - + + + @@ -144035,12 +143779,11 @@ - - - + + @@ -144075,19 +143818,19 @@ - - + + - - - - + + + + - - - + + + @@ -144105,8 +143848,8 @@ - - + + @@ -144116,24 +143859,24 @@ - - - - - + + + + + - - - - + + + + - - - - - + + + + + @@ -144143,26 +143886,26 @@ - - - - + + + + - - - + + + - - - + + + - - - + + + @@ -144171,10 +143914,10 @@ - - - - + + + + @@ -144194,7 +143937,7 @@ - + @@ -144228,19 +143971,19 @@ - - - + + + - - - - - + + + + + @@ -144368,10 +144111,10 @@ - - - - + + + + @@ -144379,10 +144122,10 @@ - - - - + + + + @@ -144461,19 +144204,19 @@ - - - + + + - - - + + + - - - + + + @@ -144503,8 +144246,8 @@ - - + + @@ -144522,16 +144265,16 @@ - - + + - - + + @@ -144584,9 +144327,9 @@ - - - + + + @@ -144600,9 +144343,9 @@ - - - + + + @@ -144641,8 +144384,8 @@ - - + + @@ -144688,9 +144431,9 @@ - - - + + + @@ -144781,11 +144524,11 @@ - - - - - + + + + + @@ -145020,9 +144763,9 @@ - - - + + + @@ -145140,27 +144883,27 @@ - - + + - - + + - - + + - - - - - + + + + + @@ -145194,8 +144937,8 @@ - - + + @@ -145234,17 +144977,17 @@ - - + + - - + + - - - + + + @@ -145255,8 +144998,8 @@ - - + + @@ -145287,12 +145030,12 @@ - - + + - - + + @@ -145319,8 +145062,8 @@ - - + + @@ -145342,8 +145085,8 @@ - - + + @@ -145379,9 +145122,9 @@ - - - + + + @@ -145404,9 +145147,9 @@ - - - + + + @@ -145421,16 +145164,16 @@ - - + + - - + + - - + + @@ -145449,8 +145192,8 @@ - - + + @@ -145465,16 +145208,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -145508,8 +145251,8 @@ - - + + @@ -145524,15 +145267,15 @@ - - - - + + + + - - - + + + @@ -145543,9 +145286,9 @@ - - - + + + @@ -145557,9 +145300,9 @@ - - - + + + @@ -145578,24 +145321,24 @@ - - - + + + - - - - + + + + - - - + + + @@ -145622,8 +145365,8 @@ - - + + @@ -145642,9 +145385,9 @@ - - - + + + @@ -145653,28 +145396,28 @@ - - - - + + + + - - + + - - + + - - - + + + - - - + + + @@ -145683,14 +145426,14 @@ - - - - + + + + - - + + @@ -145701,9 +145444,9 @@ - - - + + + @@ -145718,8 +145461,8 @@ - - + + @@ -145741,8 +145484,8 @@ - - + + @@ -145845,15 +145588,15 @@ - - - + + + - - - - + + + + @@ -145865,8 +145608,8 @@ - - + + @@ -145932,16 +145675,16 @@ - - + + - - + + @@ -145949,10 +145692,10 @@ - - - - + + + + @@ -145976,8 +145719,8 @@ - - + + @@ -145988,30 +145731,30 @@ - - + + - - - + + + - - - + + + - - + + - - + + @@ -146019,10 +145762,10 @@ - - - - + + + + @@ -146046,9 +145789,9 @@ - - - + + + @@ -146056,8 +145799,8 @@ - - + + @@ -146106,9 +145849,9 @@ - - - + + + @@ -146129,10 +145872,10 @@ - - - - + + + + @@ -146182,9 +145925,9 @@ - - - + + + @@ -146244,50 +145987,50 @@ - - - + + + - - - - - - + + + + + + - - - - - + + + + + - - + + - - - - + + + + - - - - - - + + + + + + - - + + @@ -146463,9 +146206,9 @@ - - - + + + @@ -146479,8 +146222,8 @@ - - + + @@ -146494,19 +146237,19 @@ - - - - + + + + - - - + + + @@ -146520,33 +146263,33 @@ - - - - - + + + + + - - - + + + - - + + - - + + - - + + - - - + + + @@ -146799,15 +146542,15 @@ - - - + + + - - - - + + + + @@ -146876,15 +146619,15 @@ - - - + + + - - - + + + @@ -146897,15 +146640,15 @@ - - - - + + + + - - - + + + @@ -146983,9 +146726,9 @@ - - - + + + @@ -147001,36 +146744,36 @@ - - - + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - + + + - - + + @@ -147045,9 +146788,9 @@ - - - + + + @@ -147062,14 +146805,14 @@ - - - + + + - - - + + + @@ -147111,15 +146854,15 @@ - - + + - - - - - + + + + + @@ -147127,11 +146870,11 @@ - - - - - + + + + + @@ -147159,14 +146902,14 @@ - - - - - + + + + + - - + + @@ -147186,8 +146929,8 @@ - - + + @@ -147230,8 +146973,8 @@ - - + + @@ -147267,8 +147010,8 @@ - - + + @@ -147335,9 +147078,9 @@ - - - + + + @@ -147408,26 +147151,26 @@ - - - - - - - + + + + + + + - - + + - - - + + + @@ -147464,21 +147207,21 @@ - - - + + + - - - + + + - - - + + + @@ -147545,15 +147288,15 @@ - - + + - - + + @@ -147564,16 +147307,16 @@ - - - - - + + + + + - - - + + + @@ -147582,11 +147325,11 @@ - - - - - + + + + + @@ -147595,9 +147338,9 @@ - - - + + + @@ -147647,11 +147390,11 @@ - - - - - + + + + + @@ -147661,23 +147404,23 @@ - - - - + + + + - - - + + + - - + + - - + + @@ -147696,12 +147439,12 @@ - - + + - - + + @@ -147709,8 +147452,8 @@ - - + + @@ -147731,8 +147474,8 @@ - - + + @@ -147740,16 +147483,16 @@ - - - + + + - + - - + + @@ -147757,8 +147500,8 @@ - - + + @@ -147774,9 +147517,9 @@ - - - + + + @@ -147799,17 +147542,17 @@ - - - + + + - - + + @@ -147826,12 +147569,12 @@ - - - - - - + + + + + + @@ -147892,9 +147635,9 @@ - - - + + + @@ -147919,34 +147662,34 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - + + + @@ -147956,17 +147699,17 @@ - - + + - - - - + + + + @@ -147977,26 +147720,26 @@ - - - - + + + + - - - - + + + + - - + + - - - - + + + + @@ -148007,9 +147750,9 @@ - - - + + + @@ -148041,10 +147784,10 @@ - - - - + + + + @@ -148077,9 +147820,9 @@ - - - + + + @@ -148096,15 +147839,15 @@ - - - - + + + + - - - + + + @@ -148128,12 +147871,12 @@ - - - - - - + + + + + + @@ -148155,13 +147898,13 @@ - - + + - - - + + + @@ -148178,10 +147921,10 @@ - - - - + + + + @@ -148192,47 +147935,47 @@ - - - + + + - - + + - - - - - - - + + + + + + + - - + + - - - + + + - - - - - - - + + + + + + + - - - - - - + + + + + + diff --git a/android/abi_gki_aarch64_oplus b/android/abi_gki_aarch64_oplus index 4f25e9accef0..0767c782b5b0 100644 --- a/android/abi_gki_aarch64_oplus +++ b/android/abi_gki_aarch64_oplus @@ -2100,6 +2100,7 @@ rdev_get_regmap read_cache_page_gfp reboot_mode + reclaim_pages refcount_dec_and_lock refcount_dec_not_one refcount_warn_saturate @@ -2798,6 +2799,7 @@ __traceiter_android_vh_futex_sleep_start __traceiter_android_vh_get_from_fragment_pool __traceiter_android_vh_gpio_block_read + __traceiter_android_vh_handle_failed_page_trylock __traceiter_android_vh_include_reserved_zone __traceiter_android_vh_iommu_alloc_iova __traceiter_android_vh_iommu_free_iova @@ -2823,9 +2825,13 @@ __traceiter_android_vh_override_creds __traceiter_android_vh_page_referenced_check_bypass __traceiter_android_vh_page_should_be_protected + __traceiter_android_vh_page_trylock_set + __traceiter_android_vh_page_trylock_clear + __traceiter_android_vh_page_trylock_get_result __traceiter_android_vh_mark_page_accessed __traceiter_android_vh_show_mapcount_pages __traceiter_android_vh_do_traversal_lruvec + __traceiter_android_vh_do_page_trylock __traceiter_android_vh_update_page_mapcount __traceiter_android_vh_add_page_to_lrulist __traceiter_android_vh_del_page_from_lrulist @@ -3021,6 +3027,7 @@ __tracepoint_android_vh_futex_sleep_start __tracepoint_android_vh_get_from_fragment_pool __tracepoint_android_vh_gpio_block_read + __tracepoint_android_vh_handle_failed_page_trylock __tracepoint_android_vh_include_reserved_zone __tracepoint_android_vh_iommu_alloc_iova __tracepoint_android_vh_iommu_free_iova @@ -3046,9 +3053,13 @@ __tracepoint_android_vh_override_creds __tracepoint_android_vh_page_referenced_check_bypass __tracepoint_android_vh_page_should_be_protected + __tracepoint_android_vh_page_trylock_set + __tracepoint_android_vh_page_trylock_clear + __tracepoint_android_vh_page_trylock_get_result __tracepoint_android_vh_mark_page_accessed __tracepoint_android_vh_show_mapcount_pages __tracepoint_android_vh_do_traversal_lruvec + __tracepoint_android_vh_do_page_trylock __tracepoint_android_vh_update_page_mapcount __tracepoint_android_vh_add_page_to_lrulist __tracepoint_android_vh_del_page_from_lrulist From 501063ce66dd386c16c47c463c8a3df0e810435f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Aug 2022 13:12:42 +0200 Subject: [PATCH 08/52] Revert "ANDROID: vendor_hooks:vendor hook for mmput" This reverts commit 8b19ed264b40220326562a29f7ffc1342ba61c08. The hook android_vh_mmput is not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 238821038 Cc: xiaofeng Signed-off-by: Greg Kroah-Hartman Change-Id: Idd40f231640723d2342a9dbac7e9206a800e82dd --- drivers/android/vendor_hooks.c | 1 - include/trace/hooks/sched.h | 4 ---- kernel/fork.c | 4 +--- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 1eff6b292764..91f67a58a0bc 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -448,5 +448,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pidfd_open); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); diff --git a/include/trace/hooks/sched.h b/include/trace/hooks/sched.h index d0fc31e2c966..95f292953109 100644 --- a/include/trace/hooks/sched.h +++ b/include/trace/hooks/sched.h @@ -395,10 +395,6 @@ DECLARE_HOOK(android_vh_pidfd_open, TP_PROTO(struct pid *p), TP_ARGS(p)); -DECLARE_HOOK(android_vh_mmput, - TP_PROTO(void *unused), - TP_ARGS(unused)); - DECLARE_HOOK(android_vh_sched_pelt_multiplier, TP_PROTO(unsigned int old, unsigned int cur, int *ret), TP_ARGS(old, cur, ret)); diff --git a/kernel/fork.c b/kernel/fork.c index 58409b7178c2..3b281326c0e1 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1150,10 +1150,8 @@ void mmput(struct mm_struct *mm) { might_sleep(); - if (atomic_dec_and_test(&mm->mm_users)) { - trace_android_vh_mmput(NULL); + if (atomic_dec_and_test(&mm->mm_users)) __mmput(mm); - } } EXPORT_SYMBOL_GPL(mmput); From d0590b99c9946526ee434a33c47d69056d137e06 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Aug 2022 14:37:37 +0200 Subject: [PATCH 09/52] Revert "ANDROID: vendor_hooks: Add hooks to extend the struct swap_info_struct" This reverts commit 667f0d71dc08e25bf013cafa617adf6789fe5b93. The hooks android_vh_init_swap_info_struct and android_vh_alloc_si are not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 234214858 Cc: Bing Han Signed-off-by: Greg Kroah-Hartman Change-Id: If01c284ebf15e804e7cf34e854b7db0d5b68ae1b --- drivers/android/vendor_hooks.c | 2 -- include/trace/hooks/mm.h | 6 ------ mm/swapfile.c | 8 ++------ 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 91f67a58a0bc..6238312d55e9 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -443,9 +443,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pidfd_open); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 0362142a1323..213b14ea4cc6 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -245,15 +245,9 @@ DECLARE_HOOK(android_vh_account_swap_pages, DECLARE_HOOK(android_vh_unuse_swap_page, TP_PROTO(struct swap_info_struct *si, struct page *page), TP_ARGS(si, page)); -DECLARE_HOOK(android_vh_init_swap_info_struct, - TP_PROTO(struct swap_info_struct *p, struct plist_head *swap_avail_heads), - TP_ARGS(p, swap_avail_heads)); DECLARE_HOOK(android_vh_si_swapinfo, TP_PROTO(struct swap_info_struct *si, bool *skip), TP_ARGS(si, skip)); -DECLARE_HOOK(android_vh_alloc_si, - TP_PROTO(struct swap_info_struct **p, bool *skip), - TP_ARGS(p, skip)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); diff --git a/mm/swapfile.c b/mm/swapfile.c index 677f235806c2..0aba6e4742d1 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2902,15 +2902,12 @@ late_initcall(max_swapfiles_check); static struct swap_info_struct *alloc_swap_info(void) { - struct swap_info_struct *p = NULL; + struct swap_info_struct *p; struct swap_info_struct *defer = NULL; unsigned int type; int i; - bool skip = false; - trace_android_vh_alloc_si(&p, &skip); - if (!skip) - p = kvzalloc(struct_size(p, avail_lists, nr_node_ids), GFP_KERNEL); + p = kvzalloc(struct_size(p, avail_lists, nr_node_ids), GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); @@ -3393,7 +3390,6 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) (swap_flags & SWAP_FLAG_PRIO_MASK) >> SWAP_FLAG_PRIO_SHIFT; enable_swap_info(p, prio, swap_map, cluster_info, frontswap_map); - trace_android_vh_init_swap_info_struct(p, swap_avail_heads); pr_info("Adding %uk swap on %s. Priority:%d extents:%d across:%lluk %s%s%s%s%s\n", p->pages<<(PAGE_SHIFT-10), name->name, p->prio, nr_extents, (unsigned long long)span<<(PAGE_SHIFT-10), From 40b3533213efcee418cc54619a56f5cdb2880758 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Aug 2022 14:51:32 +0200 Subject: [PATCH 10/52] Revert "ANDROID: vendor_hooks:vendor hook for pidfd_open" This reverts commit 242b11e574603029393ca1d094c76900797b5897. The hook android_vh_pidfd_open is not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 238725692 Cc: xiaofeng Signed-off-by: Greg Kroah-Hartman Change-Id: I77afe002bebc3b3e97ea7a28faae74e9cb8a6718 --- drivers/android/vendor_hooks.c | 1 - include/trace/hooks/sched.h | 4 ---- kernel/pid.c | 4 ---- 3 files changed, 9 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 6238312d55e9..13c10551d922 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -445,5 +445,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pidfd_open); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); diff --git a/include/trace/hooks/sched.h b/include/trace/hooks/sched.h index 95f292953109..6488dee32a88 100644 --- a/include/trace/hooks/sched.h +++ b/include/trace/hooks/sched.h @@ -391,10 +391,6 @@ DECLARE_HOOK(android_vh_setscheduler_uclamp, TP_PROTO(struct task_struct *tsk, int clamp_id, unsigned int value), TP_ARGS(tsk, clamp_id, value)); -DECLARE_HOOK(android_vh_pidfd_open, - TP_PROTO(struct pid *p), - TP_ARGS(p)); - DECLARE_HOOK(android_vh_sched_pelt_multiplier, TP_PROTO(unsigned int old, unsigned int cur, int *ret), TP_ARGS(old, cur, ret)); diff --git a/kernel/pid.c b/kernel/pid.c index 468d04810b40..48babb1dd3e1 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -45,9 +45,6 @@ #include #include -#undef CREATE_TRACE_POINTS -#include - struct pid init_struct_pid = { .count = REFCOUNT_INIT(1), .tasks = { @@ -605,7 +602,6 @@ SYSCALL_DEFINE2(pidfd_open, pid_t, pid, unsigned int, flags) else fd = -EINVAL; - trace_android_vh_pidfd_open(p); put_pid(p); return fd; } From 86be1a3d9f5a43437b9d1815a6014b4be96e1349 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Aug 2022 18:12:02 +0200 Subject: [PATCH 11/52] Revert "ANDROID: vendor_hook: Add hook in si_swapinfo()" This reverts commit ed2b11d639fabae87d33a9f2c10b15e87b0f4281. The hook android_vh_si_swapinfo is not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 234214858 Cc: Bing Han Signed-off-by: Greg Kroah-Hartman Change-Id: Ib474a0911dd97d54d2f086258e9d53ddd3451967 --- drivers/android/vendor_hooks.c | 1 - include/trace/hooks/mm.h | 3 --- mm/swapfile.c | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 13c10551d922..053ce75a212f 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -443,6 +443,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 213b14ea4cc6..7c97213cd2de 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -245,9 +245,6 @@ DECLARE_HOOK(android_vh_account_swap_pages, DECLARE_HOOK(android_vh_unuse_swap_page, TP_PROTO(struct swap_info_struct *si, struct page *page), TP_ARGS(si, page)); -DECLARE_HOOK(android_vh_si_swapinfo, - TP_PROTO(struct swap_info_struct *si, bool *skip), - TP_ARGS(si, skip)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); diff --git a/mm/swapfile.c b/mm/swapfile.c index 0aba6e4742d1..fb712ff403c5 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -3454,10 +3454,8 @@ void si_swapinfo(struct sysinfo *val) spin_lock(&swap_lock); for (type = 0; type < nr_swapfiles; type++) { struct swap_info_struct *si = swap_info[type]; - bool skip = false; - trace_android_vh_si_swapinfo(si, &skip); - if (!skip && (si->flags & SWP_USED) && !(si->flags & SWP_WRITEOK)) + if ((si->flags & SWP_USED) && !(si->flags & SWP_WRITEOK)) nr_to_be_unused += si->inuse_pages; } val->freeswap = atomic_long_read(&nr_swap_pages) + nr_to_be_unused; From 4e1387087735ef78962293f34a5a36dac6ce3ee0 Mon Sep 17 00:00:00 2001 From: Sarannya S Date: Thu, 18 Aug 2022 19:39:40 +0530 Subject: [PATCH 12/52] ANDROID: abi_gki_aarch64_qcom: Add skb and scatterlist helpers Add sg_miter_skip, skb_copy_datagram_from_iter and sock_alloc_send_pskb to the symbol list. These functions will be used in qrtr to handle fragmented skbs. Leaf changes summary: 3 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 3 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 3 Added functions: [A] 'function bool sg_miter_skip(sg_mapping_iter*, off_t)' [A] 'function int skb_copy_datagram_from_iter(sk_buff*, int, iov_iter*, int)' [A] 'function sk_buff* sock_alloc_send_pskb(sock*, unsigned long int, unsigned long int, int, int*, int)' Bug: 232287599 Change-Id: I5bebdebb833f3ff78f89e67aaca578b9c6c86259 Signed-off-by: Sarannya S --- android/abi_gki_aarch64.xml | 555 +++++++++++++++++------------------ android/abi_gki_aarch64_qcom | 5 +- 2 files changed, 274 insertions(+), 286 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 8c2c3d0ff92e..f432f0776506 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -4772,6 +4772,7 @@ + @@ -4832,6 +4833,7 @@ + @@ -5078,6 +5080,7 @@ + @@ -14763,7 +14766,6 @@ - @@ -14993,15 +14995,15 @@ - + - + - + - + @@ -30628,18 +30630,18 @@ - + - + - + - + - + @@ -36999,12 +37001,6 @@ - - - - - - @@ -44687,9 +44683,6 @@ - - - @@ -52756,81 +52749,81 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -60827,7 +60820,7 @@ - + @@ -62473,24 +62466,24 @@ - + - + - + - + - + - + - + @@ -68987,26 +68980,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -92787,21 +92761,21 @@ - + - + - + - + - + - + @@ -95456,17 +95430,7 @@ - - - - - - - - - - - + @@ -105911,30 +105875,30 @@ - + - + - + - + - + - + - + - + - + @@ -115979,10 +115943,10 @@ - - - - + + + + @@ -116347,12 +116311,12 @@ - - + + - - + + @@ -116385,15 +116349,15 @@ - - - + + + - - - - + + + + @@ -116585,10 +116549,10 @@ - - - - + + + + @@ -116791,10 +116755,10 @@ - - - - + + + + @@ -117551,35 +117515,35 @@ - - - - + + + + - + + + + + + - + + + - - - - - + + + + - - - - - - - - - - - + + + + + @@ -117588,12 +117552,12 @@ - - - - - - + + + + + + @@ -117602,30 +117566,30 @@ - + + + + + + + + + + + - + - - - - - - - - - - - - - - + + + + @@ -117648,17 +117612,17 @@ - - - - - + + + + + - - - - + + + + @@ -118425,11 +118389,11 @@ - - - - - + + + + + @@ -119342,22 +119306,22 @@ - - - - - + + + + + - + - - - + + + - - + + @@ -119493,7 +119457,7 @@ - + @@ -120128,9 +120092,9 @@ - - - + + + @@ -120247,9 +120211,9 @@ - - - + + + @@ -125981,16 +125945,16 @@ - - + + - - + + - - + + @@ -126002,16 +125966,16 @@ - - + + - - + + - - + + @@ -129241,8 +129205,8 @@ - - + + @@ -129269,9 +129233,9 @@ - - - + + + @@ -129282,8 +129246,8 @@ - - + + @@ -129295,8 +129259,8 @@ - - + + @@ -129395,14 +129359,14 @@ - - - + + + - - - + + + @@ -130244,9 +130208,9 @@ - - - + + + @@ -130278,17 +130242,17 @@ - - + + - - + + - - - + + + @@ -131753,7 +131717,7 @@ - + @@ -134770,28 +134734,28 @@ - - + + - - + + - - + + - - + + - - + + @@ -136894,8 +136858,8 @@ - - + + @@ -136926,8 +136890,8 @@ - - + + @@ -137375,14 +137339,14 @@ - - - + + + - - - + + + @@ -138253,8 +138217,8 @@ - - + + @@ -139726,16 +139690,16 @@ - - + + - - + + - - + + @@ -140889,6 +140853,11 @@ + + + + + @@ -141041,15 +141010,15 @@ - + - - + + - - + + @@ -141227,6 +141196,13 @@ + + + + + + + @@ -142577,6 +142553,15 @@ + + + + + + + + + @@ -143197,8 +143182,8 @@ - - + + @@ -143438,8 +143423,8 @@ - - + + @@ -145058,12 +145043,12 @@ - - + + - - + + @@ -147644,18 +147629,18 @@ - - - + + + - - - + + + - - + + diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index 34770c16c5b8..4dedb32d9661 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -1965,7 +1965,6 @@ register_kretprobe register_memory_notifier register_module_notifier - register_qdisc register_netdev register_netdevice register_netdevice_notifier @@ -1973,6 +1972,7 @@ register_oom_notifier register_pernet_device register_pm_notifier + register_qdisc register_reboot_notifier register_restart_handler __register_rpmsg_driver @@ -2194,6 +2194,7 @@ sg_init_one sg_init_table sg_miter_next + sg_miter_skip sg_miter_start sg_miter_stop sg_next @@ -2233,6 +2234,7 @@ skb_complete_wifi_ack skb_copy skb_copy_bits + skb_copy_datagram_from_iter skb_copy_datagram_iter skb_copy_expand skb_dequeue @@ -2321,6 +2323,7 @@ snprintf soc_device_register soc_device_unregister + sock_alloc_send_pskb sock_alloc_send_skb __sock_create sock_create_kern From 04c766fa7690fc18178eb78293a733630789c138 Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Wed, 17 Aug 2022 10:30:58 -0700 Subject: [PATCH 13/52] ANDROID: Use rq_clock_task without CONFIG_SMP Fix build error caused by guarding rq_clock_task_mult with CONFIG_SMP. Issue was not seen in original commit as test case was UM Linux, which does not enable CONFIG_CFS_BANDWIDTH. >> kernel/sched/fair.c:4791:40: error: implicit declaration of function 'rq_clock_task_mult' [-Werror,-Wimplicit-function-declaration] cfs_rq->throttled_clock_task_time += rq_clock_task_mult(rq) - Change-Id: Id3392c37ba1b2bfe78c89bc4b1ca01b920164a35 Reported-by: kernel test robot Fixes: 567d65e53644 ("ANDROID: Guard rq_clock_task_mult with CONFIG_SMP") Signed-off-by: Elliot Berman --- kernel/sched/sched.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 80a5af131251..a3c3bc3ca751 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1203,6 +1203,11 @@ static inline u64 rq_clock_task_mult(struct rq *rq) return per_cpu(clock_task_mult, cpu_of(rq)); } +#else +static inline u64 rq_clock_task_mult(struct rq *rq) +{ + return rq_clock_task(rq); +} #endif /** From 7ff95bd758c6d4f1d31961ee6ea7c9af57562a55 Mon Sep 17 00:00:00 2001 From: Peifeng Li Date: Wed, 17 Aug 2022 11:35:21 +0800 Subject: [PATCH 14/52] ANDROID: GKI: Update symbols to symbol list Leaf changes summary: 8 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 4 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 4 Added variables 4 Added functions: [A] 'function int __traceiter_android_vh_record_mutex_lock_starttime(void*, task_struct*, unsigned long int)' [A] 'function int __traceiter_android_vh_record_percpu_rwsem_lock_starttime(void*, task_struct*, unsigned long int)' [A] 'function int __traceiter_android_vh_record_rtmutex_lock_starttime(void*, task_struct*, unsigned long int)' [A] 'function int __traceiter_android_vh_record_rwsem_lock_starttime(void*, task_struct*, unsigned long int)' 4 Added variables: [A] 'tracepoint __tracepoint_android_vh_record_mutex_lock_starttime' [A] 'tracepoint __tracepoint_android_vh_record_percpu_rwsem_lock_starttime' [A] 'tracepoint __tracepoint_android_vh_record_rtmutex_lock_starttime' [A] 'tracepoint __tracepoint_android_vh_record_rwsem_lock_starttime' Bug: 193384408 Signed-off-by: Peifeng Li Change-Id: Ia5acf188732440ca70795f0afb3298e4f9d6eb8a --- android/abi_gki_aarch64.xml | 36 +++++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_oplus | 8 ++++++++ 2 files changed, 44 insertions(+) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index f432f0776506..e0004c18f143 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -528,6 +528,10 @@ + + + + @@ -6397,6 +6401,10 @@ + + + + @@ -118305,6 +118313,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -119436,6 +119468,10 @@ + + + + diff --git a/android/abi_gki_aarch64_oplus b/android/abi_gki_aarch64_oplus index 0767c782b5b0..fc00ead539dc 100644 --- a/android/abi_gki_aarch64_oplus +++ b/android/abi_gki_aarch64_oplus @@ -2840,6 +2840,10 @@ __traceiter_android_vh_printk_hotplug __traceiter_android_vh_process_killed __traceiter_android_vh_revert_creds + __traceiter_android_vh_record_mutex_lock_starttime + __traceiter_android_vh_record_rtmutex_lock_starttime + __traceiter_android_vh_record_rwsem_lock_starttime + __traceiter_android_vh_record_percpu_rwsem_lock_starttime __traceiter_android_vh_rmqueue __traceiter_android_vh_rwsem_init __traceiter_android_vh_rwsem_mark_wake_readers @@ -3068,6 +3072,10 @@ __tracepoint_android_vh_printk_hotplug __tracepoint_android_vh_process_killed __tracepoint_android_vh_revert_creds + __tracepoint_android_vh_record_mutex_lock_starttime + __tracepoint_android_vh_record_rtmutex_lock_starttime + __tracepoint_android_vh_record_rwsem_lock_starttime + __tracepoint_android_vh_record_percpu_rwsem_lock_starttime __tracepoint_android_vh_rmqueue __tracepoint_android_vh_rwsem_init __tracepoint_android_vh_rwsem_mark_wake_readers From 7449d8120a05fc74d863b73df0773c46a69cfd83 Mon Sep 17 00:00:00 2001 From: Bing Han Date: Thu, 18 Aug 2022 15:35:24 +0800 Subject: [PATCH 15/52] ANDROID: vendor_hook: Add hook in si_swapinfo() This reverts commit 86be1a3d9f5a43437b9d1815a6014b4be96e1349 The hook android_vh_si_swapinfo is deleted, due to the symbol is not added to the abi list. The symbol is added to the abi list in patch:2183484. This patch is to add the hook android_vh_si_swapinfo again. Bug: 234214858 Bug: 203756332 Cc: Greg Kroah-Hartman Signed-off-by: Bing Han Change-Id: Ifd1e05f44ac04b67816618139badd5c2ee786b50 --- drivers/android/vendor_hooks.c | 1 + include/trace/hooks/mm.h | 3 +++ mm/swapfile.c | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 053ce75a212f..13c10551d922 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -443,5 +443,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 7c97213cd2de..213b14ea4cc6 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -245,6 +245,9 @@ DECLARE_HOOK(android_vh_account_swap_pages, DECLARE_HOOK(android_vh_unuse_swap_page, TP_PROTO(struct swap_info_struct *si, struct page *page), TP_ARGS(si, page)); +DECLARE_HOOK(android_vh_si_swapinfo, + TP_PROTO(struct swap_info_struct *si, bool *skip), + TP_ARGS(si, skip)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); diff --git a/mm/swapfile.c b/mm/swapfile.c index fb712ff403c5..0aba6e4742d1 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -3454,8 +3454,10 @@ void si_swapinfo(struct sysinfo *val) spin_lock(&swap_lock); for (type = 0; type < nr_swapfiles; type++) { struct swap_info_struct *si = swap_info[type]; + bool skip = false; - if ((si->flags & SWP_USED) && !(si->flags & SWP_WRITEOK)) + trace_android_vh_si_swapinfo(si, &skip); + if (!skip && (si->flags & SWP_USED) && !(si->flags & SWP_WRITEOK)) nr_to_be_unused += si->inuse_pages; } val->freeswap = atomic_long_read(&nr_swap_pages) + nr_to_be_unused; From 6c56a05b87249f2e42ab6059d7f27f475265bfdf Mon Sep 17 00:00:00 2001 From: Bing Han Date: Thu, 18 Aug 2022 15:37:32 +0800 Subject: [PATCH 16/52] ANDROID: vendor_hooks: Add hooks to extend the struct swap_info_struct This reverts commit: d0590b99c9946526ee434a33c47d69056d137e06 The hooks android_vh_init_swap_info_struct and android_vh_alloc_si are deleted, due to the symbols are not added to the abi list. The symbols are added to the abi list in patch:2183484. This patch is to add the hooks android_vh_init_swap_info_struct and android_vh_alloc_si again. Bug: 234214858 Bug: 203756332 Cc: Greg Kroah-Hartman Signed-off-by: Bing Han Change-Id: Id5524a726d213c5eab55570fd28d28da978974e7 --- drivers/android/vendor_hooks.c | 2 ++ include/trace/hooks/mm.h | 6 ++++++ mm/swapfile.c | 8 ++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 13c10551d922..6415c78cbbdd 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -443,6 +443,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 213b14ea4cc6..0362142a1323 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -245,9 +245,15 @@ DECLARE_HOOK(android_vh_account_swap_pages, DECLARE_HOOK(android_vh_unuse_swap_page, TP_PROTO(struct swap_info_struct *si, struct page *page), TP_ARGS(si, page)); +DECLARE_HOOK(android_vh_init_swap_info_struct, + TP_PROTO(struct swap_info_struct *p, struct plist_head *swap_avail_heads), + TP_ARGS(p, swap_avail_heads)); DECLARE_HOOK(android_vh_si_swapinfo, TP_PROTO(struct swap_info_struct *si, bool *skip), TP_ARGS(si, skip)); +DECLARE_HOOK(android_vh_alloc_si, + TP_PROTO(struct swap_info_struct **p, bool *skip), + TP_ARGS(p, skip)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); diff --git a/mm/swapfile.c b/mm/swapfile.c index 0aba6e4742d1..677f235806c2 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2902,12 +2902,15 @@ late_initcall(max_swapfiles_check); static struct swap_info_struct *alloc_swap_info(void) { - struct swap_info_struct *p; + struct swap_info_struct *p = NULL; struct swap_info_struct *defer = NULL; unsigned int type; int i; + bool skip = false; - p = kvzalloc(struct_size(p, avail_lists, nr_node_ids), GFP_KERNEL); + trace_android_vh_alloc_si(&p, &skip); + if (!skip) + p = kvzalloc(struct_size(p, avail_lists, nr_node_ids), GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); @@ -3390,6 +3393,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) (swap_flags & SWAP_FLAG_PRIO_MASK) >> SWAP_FLAG_PRIO_SHIFT; enable_swap_info(p, prio, swap_map, cluster_info, frontswap_map); + trace_android_vh_init_swap_info_struct(p, swap_avail_heads); pr_info("Adding %uk swap on %s. Priority:%d extents:%d across:%lluk %s%s%s%s%s\n", p->pages<<(PAGE_SHIFT-10), name->name, p->prio, nr_extents, (unsigned long long)span<<(PAGE_SHIFT-10), From a47fb6a9ae411a860f0f46453608a12bfbc86c5d Mon Sep 17 00:00:00 2001 From: Bing Han Date: Thu, 18 Aug 2022 15:38:58 +0800 Subject: [PATCH 17/52] ANDROID: vendor_hook: Add hook in __free_pages() This reverts commit eb99e6d80ee21eb061c55cdf14c0b05e0c61af4d The hook android_vh_free_pages is deleted, due to the symbol is not added to the abi list. The symbol is added to the abi list in patch:2183484. This patch is to add the hook android_vh_free_pages again. Bug: 234214858 Bug: 203756332 Cc: Greg Kroah-Hartman Signed-off-by: Bing Han Change-Id: I2c97ea4d310e2004b94d891678127c17f7b07c93 --- drivers/android/vendor_hooks.c | 1 + include/trace/hooks/mm.h | 3 +++ mm/page_alloc.c | 1 + 3 files changed, 5 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 6415c78cbbdd..9ba5ee6016cf 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -446,5 +446,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 0362142a1323..8b0225ce7ced 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -254,6 +254,9 @@ DECLARE_HOOK(android_vh_si_swapinfo, DECLARE_HOOK(android_vh_alloc_si, TP_PROTO(struct swap_info_struct **p, bool *skip), TP_ARGS(p, skip)); +DECLARE_HOOK(android_vh_free_pages, + TP_PROTO(struct page *page, unsigned int order), + TP_ARGS(page, order)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9e43e2b8425c..d2b7eca3a2bf 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5183,6 +5183,7 @@ static inline void free_the_page(struct page *page, unsigned int order) void __free_pages(struct page *page, unsigned int order) { + trace_android_vh_free_pages(page, order); if (put_page_testzero(page)) free_the_page(page, order); else if (!PageHead(page)) From 15ad83d91f89416100663032d8b8d7e8c6c608c0 Mon Sep 17 00:00:00 2001 From: Bing Han Date: Thu, 18 Aug 2022 12:20:58 +0800 Subject: [PATCH 18/52] ANDROID: GKI: Update symbol list for transsion Leaf changes summary: 52 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 26 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 26 Added variables 26 Added functions: [A] 'function int __traceiter_android_vh_account_swap_pages(void*, swap_info_struct*, bool*)' [A] 'function int __traceiter_android_vh_alloc_si(void*, swap_info_struct**, bool*)' [A] 'function int __traceiter_android_vh_alloc_swap_slot_cache(void*, swap_slots_cache*, int*, bool*)' [A] 'function int __traceiter_android_vh_count_pswpin(void*, swap_info_struct*)' [A] 'function int __traceiter_android_vh_count_pswpout(void*, swap_info_struct*)' [A] 'function int __traceiter_android_vh_count_swpout_vm_event(void*, swap_info_struct*, page*, bool*)' [A] 'function int __traceiter_android_vh_cow_user_page(void*, vm_fault*, page*)' [A] 'function int __traceiter_android_vh_drain_slots_cache_cpu(void*, swap_slots_cache*, unsigned int, bool, bool*)' [A] 'function int __traceiter_android_vh_free_pages(void*, page*, unsigned int)' [A] 'function int __traceiter_android_vh_free_swap_slot(void*, swp_entry_t, swap_slots_cache*, bool*)' [A] 'function int __traceiter_android_vh_get_swap_page(void*, page*, swp_entry_t*, swap_slots_cache*, bool*)' [A] 'function int __traceiter_android_vh_handle_pte_fault_end(void*, vm_fault*, unsigned long int)' [A] 'function int __traceiter_android_vh_inactive_is_low(void*, unsigned long int, unsigned long int*, lru_list, bool*)' [A] 'function int __traceiter_android_vh_init_swap_info_struct(void*, swap_info_struct*, plist_head*)' [A] 'function int __traceiter_android_vh_migrate_page_states(void*, page*, page*)' [A] 'function int __traceiter_android_vh_page_isolated_for_reclaim(void*, mm_struct*, page*)' [A] 'function int __traceiter_android_vh_page_referenced_one_end(void*, vm_area_struct*, page*, int)' [A] 'function int __traceiter_android_vh_set_shmem_page_flag(void*, page*)' [A] 'function int __traceiter_android_vh_si_swapinfo(void*, swap_info_struct*, bool*)' [A] 'function int __traceiter_android_vh_snapshot_refaults(void*, lruvec*)' [A] 'function int __traceiter_android_vh_swap_slot_cache_active(void*, bool)' [A] 'function int __traceiter_android_vh_swapin_add_anon_rmap(void*, vm_fault*, page*)' [A] 'function int __traceiter_android_vh_unuse_swap_page(void*, swap_info_struct*, page*)' [A] 'function int __traceiter_android_vh_waiting_for_page_migration(void*, page*)' [A] 'function void plist_del(plist_node*, plist_head*)' [A] 'function void plist_requeue(plist_node*, plist_head*)' 26 Added variables: [A] 'tracepoint __tracepoint_android_vh_account_swap_pages' [A] 'tracepoint __tracepoint_android_vh_alloc_si' [A] 'tracepoint __tracepoint_android_vh_alloc_swap_slot_cache' [A] 'tracepoint __tracepoint_android_vh_count_pswpin' [A] 'tracepoint __tracepoint_android_vh_count_pswpout' [A] 'tracepoint __tracepoint_android_vh_count_swpout_vm_event' [A] 'tracepoint __tracepoint_android_vh_cow_user_page' [A] 'tracepoint __tracepoint_android_vh_drain_slots_cache_cpu' [A] 'tracepoint __tracepoint_android_vh_free_pages' [A] 'tracepoint __tracepoint_android_vh_free_swap_slot' [A] 'tracepoint __tracepoint_android_vh_get_swap_page' [A] 'tracepoint __tracepoint_android_vh_handle_pte_fault_end' [A] 'tracepoint __tracepoint_android_vh_inactive_is_low' [A] 'tracepoint __tracepoint_android_vh_init_swap_info_struct' [A] 'tracepoint __tracepoint_android_vh_migrate_page_states' [A] 'tracepoint __tracepoint_android_vh_page_isolated_for_reclaim' [A] 'tracepoint __tracepoint_android_vh_page_referenced_one_end' [A] 'tracepoint __tracepoint_android_vh_set_shmem_page_flag' [A] 'tracepoint __tracepoint_android_vh_si_swapinfo' [A] 'tracepoint __tracepoint_android_vh_snapshot_refaults' [A] 'tracepoint __tracepoint_android_vh_swap_slot_cache_active' [A] 'tracepoint __tracepoint_android_vh_swapin_add_anon_rmap' [A] 'tracepoint __tracepoint_android_vh_unuse_swap_page' [A] 'tracepoint __tracepoint_android_vh_waiting_for_page_migration' [A] 'atomic_long_t nr_swap_pages' [A] 'unsigned long int zero_pfn' Bug: 234214858 Signed-off-by: Bing Han Change-Id: I7e1764ee1bbd2e44bb67933024d89520ba48da22 --- android/abi_gki_aarch64.xml | 332 +++++++++++++++++++++++++++++- android/abi_gki_aarch64_transsion | 52 +++++ 2 files changed, 383 insertions(+), 1 deletion(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index e0004c18f143..3fb33ab9b246 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -391,6 +391,7 @@ + @@ -398,6 +399,8 @@ + + @@ -440,6 +443,10 @@ + + + + @@ -455,6 +462,7 @@ + @@ -466,6 +474,8 @@ + + @@ -478,10 +488,14 @@ + + + + @@ -505,6 +519,7 @@ + @@ -517,7 +532,9 @@ + + @@ -565,6 +582,7 @@ + @@ -576,9 +594,13 @@ + + + + @@ -603,6 +625,7 @@ + @@ -610,6 +633,7 @@ + @@ -4141,6 +4165,8 @@ + + @@ -6258,6 +6284,7 @@ + @@ -6265,6 +6292,8 @@ + + @@ -6307,6 +6336,10 @@ + + + + @@ -6322,6 +6355,7 @@ + @@ -6334,6 +6368,8 @@ + + @@ -6346,11 +6382,15 @@ + + + + @@ -6375,6 +6415,7 @@ + @@ -6388,7 +6429,9 @@ + + @@ -6445,6 +6488,7 @@ + @@ -6457,10 +6501,14 @@ + + + + @@ -6487,6 +6535,7 @@ + @@ -6495,6 +6544,7 @@ + @@ -6666,6 +6716,7 @@ + @@ -6748,6 +6799,7 @@ + @@ -15033,6 +15085,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -50914,6 +51049,7 @@ + @@ -67622,7 +67758,14 @@ - + + + + + + + + @@ -73599,6 +73742,7 @@ + @@ -88388,6 +88532,7 @@ + @@ -92681,6 +92826,7 @@ + @@ -117427,6 +117573,12 @@ + + + + + + @@ -117479,6 +117631,19 @@ + + + + + + + + + + + + + @@ -117763,6 +117928,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -117863,6 +118051,14 @@ + + + + + + + + @@ -117935,6 +118131,19 @@ + + + + + + + + + + + + + @@ -118006,6 +118215,14 @@ + + + + + + + + @@ -118022,6 +118239,20 @@ + + + + + + + + + + + + + + @@ -118029,6 +118260,12 @@ + + + + + + @@ -118171,6 +118408,12 @@ + + + + + + @@ -118245,6 +118488,12 @@ + + + + + + @@ -118253,6 +118502,13 @@ + + + + + + + @@ -118525,6 +118781,11 @@ + + + + + @@ -118595,6 +118856,17 @@ + + + + + + + + + + + @@ -118613,6 +118885,17 @@ + + + + + + + + + + + @@ -118770,6 +119053,12 @@ + + + + + + @@ -118821,6 +119110,11 @@ + + + + + @@ -119325,6 +119619,7 @@ + @@ -119332,6 +119627,8 @@ + + @@ -119374,6 +119671,10 @@ + + + + @@ -119389,6 +119690,7 @@ + @@ -119401,6 +119703,8 @@ + + @@ -119413,11 +119717,15 @@ + + + + @@ -119442,6 +119750,7 @@ + @@ -119455,7 +119764,9 @@ + + @@ -119512,6 +119823,7 @@ + @@ -119524,10 +119836,14 @@ + + + + @@ -119554,6 +119870,7 @@ + @@ -119562,6 +119879,7 @@ + @@ -135194,6 +135512,7 @@ + @@ -137725,6 +138044,16 @@ + + + + + + + + + + @@ -147956,6 +148285,7 @@ + diff --git a/android/abi_gki_aarch64_transsion b/android/abi_gki_aarch64_transsion index 7538d32cf51b..648b5a445e8b 100644 --- a/android/abi_gki_aarch64_transsion +++ b/android/abi_gki_aarch64_transsion @@ -6,3 +6,55 @@ scan_swap_map_slots swap_alloc_cluster check_cache_active + zero_pfn + nr_swap_pages + plist_requeue + plist_del + __traceiter_android_vh_handle_pte_fault_end + __traceiter_android_vh_cow_user_page + __traceiter_android_vh_swapin_add_anon_rmap + __traceiter_android_vh_waiting_for_page_migration + __traceiter_android_vh_migrate_page_states + __traceiter_android_vh_page_referenced_one_end + __traceiter_android_vh_count_pswpin + __traceiter_android_vh_count_pswpout + __traceiter_android_vh_count_swpout_vm_event + __traceiter_android_vh_swap_slot_cache_active + __traceiter_android_vh_drain_slots_cache_cpu + __traceiter_android_vh_alloc_swap_slot_cache + __traceiter_android_vh_free_swap_slot + __traceiter_android_vh_get_swap_page + __traceiter_android_vh_page_isolated_for_reclaim + __traceiter_android_vh_inactive_is_low + __traceiter_android_vh_snapshot_refaults + __traceiter_android_vh_account_swap_pages + __traceiter_android_vh_unuse_swap_page + __traceiter_android_vh_init_swap_info_struct + __traceiter_android_vh_si_swapinfo + __traceiter_android_vh_alloc_si + __traceiter_android_vh_free_pages + __traceiter_android_vh_set_shmem_page_flag + __tracepoint_android_vh_handle_pte_fault_end + __tracepoint_android_vh_cow_user_page + __tracepoint_android_vh_swapin_add_anon_rmap + __tracepoint_android_vh_waiting_for_page_migration + __tracepoint_android_vh_migrate_page_states + __tracepoint_android_vh_page_referenced_one_end + __tracepoint_android_vh_count_pswpin + __tracepoint_android_vh_count_pswpout + __tracepoint_android_vh_count_swpout_vm_event + __tracepoint_android_vh_swap_slot_cache_active + __tracepoint_android_vh_drain_slots_cache_cpu + __tracepoint_android_vh_alloc_swap_slot_cache + __tracepoint_android_vh_free_swap_slot + __tracepoint_android_vh_get_swap_page + __tracepoint_android_vh_page_isolated_for_reclaim + __tracepoint_android_vh_inactive_is_low + __tracepoint_android_vh_snapshot_refaults + __tracepoint_android_vh_account_swap_pages + __tracepoint_android_vh_unuse_swap_page + __tracepoint_android_vh_init_swap_info_struct + __tracepoint_android_vh_si_swapinfo + __tracepoint_android_vh_alloc_si + __tracepoint_android_vh_free_pages + __tracepoint_android_vh_set_shmem_page_flag \ No newline at end of file From ef04c4095d0baf70ed1b2955cfcbd7f7144bf940 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 14 Jul 2022 18:38:15 -1000 Subject: [PATCH 19/52] UPSTREAM: cgroup: Elide write-locking threadgroup_rwsem when updating csses on an empty subtree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cgroup_update_dfl_csses() write-lock the threadgroup_rwsem as updating the csses can trigger process migrations. However, if the subtree doesn't contain any tasks, there aren't gonna be any cgroup migrations. This condition can be trivially detected by testing whether mgctx.preloaded_src_csets is empty. Elide write-locking threadgroup_rwsem if the subtree is empty. After this optimization, the usage pattern of creating a cgroup, enabling the necessary controllers, and then seeding it with CLONE_INTO_CGROUP and then removing the cgroup after it becomes empty doesn't need to write-lock threadgroup_rwsem at all. Bug: 242685775 Change-Id: Ifc96030fc7b0655ecd85ef19c52c9ed97e910ffb Signed-off-by: Tejun Heo Cc: Christian Brauner Cc: Michal Koutný (cherry picked from commit 671c11f0619e5ccb380bcf0f062f69ba95fc974a https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git master) Signed-off-by: Mukesh Ojha --- kernel/cgroup/cgroup.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index d50776066fa5..cd5fafbe3af7 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -2945,12 +2945,11 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) struct cgroup_subsys_state *d_css; struct cgroup *dsct; struct ext_css_set *ext_src_set; + bool has_tasks; int ret; lockdep_assert_held(&cgroup_mutex); - percpu_down_write(&cgroup_threadgroup_rwsem); - /* look up all csses currently attached to @cgrp's subtree */ spin_lock_irq(&css_set_lock); cgroup_for_each_live_descendant_pre(dsct, d_css, cgrp) { @@ -2961,6 +2960,16 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) } spin_unlock_irq(&css_set_lock); + /* + * We need to write-lock threadgroup_rwsem while migrating tasks. + * However, if there are no source csets for @cgrp, changing its + * controllers isn't gonna produce any task migrations and the + * write-locking can be skipped safely. + */ + has_tasks = !list_empty(&mgctx.preloaded_src_csets); + if (has_tasks) + percpu_down_write(&cgroup_threadgroup_rwsem); + /* NULL dst indicates self on default hierarchy */ ret = cgroup_migrate_prepare_dst(&mgctx); if (ret) @@ -2980,7 +2989,8 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) ret = cgroup_migrate_execute(&mgctx); out_finish: cgroup_migrate_finish(&mgctx); - percpu_up_write(&cgroup_threadgroup_rwsem); + if (has_tasks) + percpu_up_write(&cgroup_threadgroup_rwsem); return ret; } From d1e180148e5538dd3d05f97b9206b91d35927d75 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 16 Aug 2022 17:47:16 +0530 Subject: [PATCH 20/52] BACKPORT: cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock Bringing up a CPU may involve creating and destroying tasks which requires read-locking threadgroup_rwsem, so threadgroup_rwsem nests inside cpus_read_lock(). However, cpuset's ->attach(), which may be called with thredagroup_rwsem write-locked, also wants to disable CPU hotplug and acquires cpus_read_lock(), leading to a deadlock. Fix it by guaranteeing that ->attach() is always called with CPU hotplug disabled and removing cpus_read_lock() call from cpuset_attach(). Bug: 242685775 Change-Id: Ib14746f8e361eac8a1cfb88ae920488d1155d904 Signed-off-by: Tejun Heo Reviewed-and-tested-by: Imran Khan Reported-and-tested-by: Xuewen Yan Fixes: 05c7b7a92cc8 ("cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug") Cc: stable@vger.kernel.org # v5.17+ Link: https://lore.kernel.org/lkml/YvrWaml3F+x9Dk+T@slm.duckdns.org/ Link: https://lore.kernel.org/lkml/20220705123705.764-1-xuewen.yan@unisoc.com/ (cherry picked from commit 4f7e7236435ca0abe005c674ebd6892c6e83aeb3 https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-6.0-fixes) Signed-off-by: Mukesh Ojha --- kernel/cgroup/cgroup.c | 83 +++++++++++++++++++++++++++++------------- kernel/cgroup/cpuset.c | 3 +- 2 files changed, 58 insertions(+), 28 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index cd5fafbe3af7..93866c87e680 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -2328,6 +2328,47 @@ int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen) } EXPORT_SYMBOL_GPL(task_cgroup_path); +/** + * cgroup_attach_lock - Lock for ->attach() + * @lock_threadgroup: whether to down_write cgroup_threadgroup_rwsem + * + * cgroup migration sometimes needs to stabilize threadgroups against forks and + * exits by write-locking cgroup_threadgroup_rwsem. However, some ->attach() + * implementations (e.g. cpuset), also need to disable CPU hotplug. + * Unfortunately, letting ->attach() operations acquire cpus_read_lock() can + * lead to deadlocks. + * + * Bringing up a CPU may involve creating new tasks which requires read-locking + * threadgroup_rwsem, so threadgroup_rwsem nests inside cpus_read_lock(). If we + * call an ->attach() which acquires the cpus lock while write-locking + * threadgroup_rwsem, the locking order is reversed and we end up waiting for an + * on-going CPU hotplug operation which in turn is waiting for the + * threadgroup_rwsem to be released to create new tasks. For more details: + * + * http://lkml.kernel.org/r/20220711174629.uehfmqegcwn2lqzu@wubuntu + * + * Resolve the situation by always acquiring cpus_read_lock() before optionally + * write-locking cgroup_threadgroup_rwsem. This allows ->attach() to assume that + * CPU hotplug is disabled on entry. + */ +static void cgroup_attach_lock(bool lock_threadgroup) +{ + cpus_read_lock(); + if (lock_threadgroup) + percpu_down_write(&cgroup_threadgroup_rwsem); +} + +/** + * cgroup_attach_unlock - Undo cgroup_attach_lock() + * @lock_threadgroup: whether to up_write cgroup_threadgroup_rwsem + */ +static void cgroup_attach_unlock(bool lock_threadgroup) +{ + if (lock_threadgroup) + percpu_up_write(&cgroup_threadgroup_rwsem); + cpus_read_unlock(); +} + /** * cgroup_migrate_add_task - add a migration target task to a migration context * @task: target task @@ -2812,9 +2853,8 @@ int cgroup_attach_task(struct cgroup *dst_cgrp, struct task_struct *leader, } struct task_struct *cgroup_procs_write_start(char *buf, bool threadgroup, - bool *locked, + bool *threadgroup_locked, struct cgroup *dst_cgrp) - __acquires(&cgroup_threadgroup_rwsem) { struct task_struct *tsk; pid_t pid; @@ -2832,12 +2872,8 @@ struct task_struct *cgroup_procs_write_start(char *buf, bool threadgroup, * Therefore, we can skip the global lock. */ lockdep_assert_held(&cgroup_mutex); - if (pid || threadgroup) { - percpu_down_write(&cgroup_threadgroup_rwsem); - *locked = true; - } else { - *locked = false; - } + *threadgroup_locked = pid || threadgroup; + cgroup_attach_lock(*threadgroup_locked); rcu_read_lock(); if (pid) { @@ -2871,17 +2907,14 @@ struct task_struct *cgroup_procs_write_start(char *buf, bool threadgroup, goto out_unlock_rcu; out_unlock_threadgroup: - if (*locked) { - percpu_up_write(&cgroup_threadgroup_rwsem); - *locked = false; - } + cgroup_attach_unlock(*threadgroup_locked); + *threadgroup_locked = false; out_unlock_rcu: rcu_read_unlock(); return tsk; } -void cgroup_procs_write_finish(struct task_struct *task, bool locked) - __releases(&cgroup_threadgroup_rwsem) +void cgroup_procs_write_finish(struct task_struct *task, bool threadgroup_locked) { struct cgroup_subsys *ss; int ssid; @@ -2889,8 +2922,8 @@ void cgroup_procs_write_finish(struct task_struct *task, bool locked) /* release reference from cgroup_procs_write_start() */ put_task_struct(task); - if (locked) - percpu_up_write(&cgroup_threadgroup_rwsem); + cgroup_attach_unlock(threadgroup_locked); + for_each_subsys(ss, ssid) if (ss->post_attach) ss->post_attach(); @@ -2967,8 +3000,7 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) * write-locking can be skipped safely. */ has_tasks = !list_empty(&mgctx.preloaded_src_csets); - if (has_tasks) - percpu_down_write(&cgroup_threadgroup_rwsem); + cgroup_attach_lock(has_tasks); /* NULL dst indicates self on default hierarchy */ ret = cgroup_migrate_prepare_dst(&mgctx); @@ -2989,8 +3021,7 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) ret = cgroup_migrate_execute(&mgctx); out_finish: cgroup_migrate_finish(&mgctx); - if (has_tasks) - percpu_up_write(&cgroup_threadgroup_rwsem); + cgroup_attach_unlock(has_tasks); return ret; } @@ -4865,13 +4896,13 @@ static ssize_t cgroup_procs_write(struct kernfs_open_file *of, struct task_struct *task; const struct cred *saved_cred; ssize_t ret; - bool locked; + bool threadgroup_locked; dst_cgrp = cgroup_kn_lock_live(of->kn, false); if (!dst_cgrp) return -ENODEV; - task = cgroup_procs_write_start(buf, true, &locked, dst_cgrp); + task = cgroup_procs_write_start(buf, true, &threadgroup_locked, dst_cgrp); ret = PTR_ERR_OR_ZERO(task); if (ret) goto out_unlock; @@ -4897,7 +4928,7 @@ static ssize_t cgroup_procs_write(struct kernfs_open_file *of, ret = cgroup_attach_task(dst_cgrp, task, true); out_finish: - cgroup_procs_write_finish(task, locked); + cgroup_procs_write_finish(task, threadgroup_locked); out_unlock: cgroup_kn_unlock(of->kn); @@ -4917,7 +4948,7 @@ static ssize_t cgroup_threads_write(struct kernfs_open_file *of, struct task_struct *task; const struct cred *saved_cred; ssize_t ret; - bool locked; + bool threadgroup_locked; buf = strstrip(buf); @@ -4925,7 +4956,7 @@ static ssize_t cgroup_threads_write(struct kernfs_open_file *of, if (!dst_cgrp) return -ENODEV; - task = cgroup_procs_write_start(buf, false, &locked, dst_cgrp); + task = cgroup_procs_write_start(buf, false, &threadgroup_locked, dst_cgrp); ret = PTR_ERR_OR_ZERO(task); if (ret) goto out_unlock; @@ -4951,7 +4982,7 @@ static ssize_t cgroup_threads_write(struct kernfs_open_file *of, ret = cgroup_attach_task(dst_cgrp, task, false); out_finish: - cgroup_procs_write_finish(task, locked); + cgroup_procs_write_finish(task, threadgroup_locked); out_unlock: cgroup_kn_unlock(of->kn); diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index ff2071fba6a7..af3ed68cc4f2 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -2238,7 +2238,7 @@ static void cpuset_attach(struct cgroup_taskset *tset) cgroup_taskset_first(tset, &css); cs = css_cs(css); - cpus_read_lock(); + lockdep_assert_cpus_held(); /* see cgroup_attach_lock() */ mutex_lock(&cpuset_mutex); guarantee_online_mems(cs, &cpuset_attach_nodemask_to); @@ -2292,7 +2292,6 @@ static void cpuset_attach(struct cgroup_taskset *tset) wake_up(&cpuset_attach_wq); mutex_unlock(&cpuset_mutex); - cpus_read_unlock(); } /* The various types of files and directories in a cpuset file system */ From 4f116d326e52b12b41450db73edcbc3560f05853 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Wed, 10 Aug 2022 21:42:36 +0800 Subject: [PATCH 21/52] ANDROID: GKI: rockchip: Update symbols for rga driver Leaf changes summary: 2 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 2 Added functions: [A] 'function unsigned long int alloc_iova_fast(iova_domain*, unsigned long int, unsigned long int, bool)' [A] 'function void free_iova_fast(iova_domain*, unsigned long int, unsigned long int)' Bug: 239396464 Signed-off-by: Kever Yang Change-Id: Ibc5b98459919d94d347f33b8b19a5c3be46c8e9a --- android/abi_gki_aarch64_rockchip | 90 ++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 39 deletions(-) diff --git a/android/abi_gki_aarch64_rockchip b/android/abi_gki_aarch64_rockchip index 2bee0c4c5eb8..6eee0b6e4e70 100644 --- a/android/abi_gki_aarch64_rockchip +++ b/android/abi_gki_aarch64_rockchip @@ -92,6 +92,7 @@ clk_gate_ops clk_get __clk_get_name + clk_get_parent clk_get_rate clk_hw_get_flags clk_hw_get_name @@ -241,6 +242,7 @@ devm_input_allocate_device devm_ioremap devm_ioremap_resource + devm_kasprintf devm_kfree devm_kmalloc devm_kmemdup @@ -315,7 +317,9 @@ dma_buf_unmap_attachment dma_buf_vmap dma_buf_vunmap + dma_fence_add_callback dma_fence_context_alloc + dma_fence_get_status dma_fence_init dma_fence_release dma_fence_signal @@ -507,6 +511,7 @@ __get_free_pages get_random_bytes get_unused_fd_flags + get_user_pages_remote get_zeroed_page gic_nonsecure_priorities gpiochip_add_pin_range @@ -526,6 +531,8 @@ gpiod_set_value gpiod_set_value_cansleep gpiod_to_irq + gpio_free + gpio_request gpio_to_desc handle_nested_irq handle_simple_irq @@ -555,8 +562,10 @@ i2c_get_adapter i2c_put_adapter i2c_register_driver + i2c_smbus_read_byte i2c_smbus_read_byte_data i2c_smbus_read_i2c_block_data + i2c_smbus_read_word_data i2c_smbus_write_byte_data i2c_smbus_write_i2c_block_data __i2c_smbus_xfer @@ -589,17 +598,22 @@ input_register_device input_set_abs_params input_set_capability + input_unregister_device iommu_attach_device + iommu_attach_group iommu_detach_device + iommu_detach_group iommu_device_register iommu_device_sysfs_add iommu_device_sysfs_remove iommu_get_dma_cookie iommu_get_domain_for_dev iommu_group_alloc + iommu_group_get iommu_group_put iommu_group_ref_get iommu_map + iommu_map_sg iommu_put_dma_cookie iommu_set_fault_handler iommu_unmap @@ -689,6 +703,7 @@ media_pipeline_start media_pipeline_stop memcpy + __memcpy_fromio memdup_user memmove memset @@ -706,6 +721,7 @@ misc_deregister misc_register mmc_of_parse + __mmdrop mod_delayed_work_on mod_timer __module_get @@ -801,6 +817,9 @@ param_ops_int param_ops_string param_ops_uint + pcie_capability_clear_and_set_word + pci_read_config_dword + pci_write_config_dword PDE_DATA __per_cpu_offset perf_trace_buf_alloc @@ -839,6 +858,7 @@ pm_clk_destroy pm_power_off __pm_relax + pm_relax __pm_runtime_disable pm_runtime_enable pm_runtime_force_resume @@ -851,6 +871,7 @@ __pm_runtime_suspend __pm_runtime_use_autosuspend __pm_stay_awake + pm_stay_awake pm_wakeup_ws_event power_supply_am_i_supplied power_supply_changed @@ -1075,6 +1096,7 @@ __sw_hweight64 __sw_hweight8 sync_file_create + sync_file_get_fence synchronize_irq synchronize_rcu syscon_node_to_regmap @@ -1221,6 +1243,7 @@ v4l2_event_queue v4l2_event_subdev_unsubscribe v4l2_event_subscribe + v4l2_event_unsubscribe v4l2_fh_open v4l2_i2c_subdev_init v4l2_match_dv_timings @@ -1312,6 +1335,10 @@ drm_dp_start_crc drm_dp_stop_crc +# required by aspm_ext.ko + pci_find_capability + pci_find_ext_capability + # required by bifrost_kbase.ko __arch_clear_user __bitmap_andnot @@ -1326,9 +1353,7 @@ devfreq_cooling_unregister devfreq_remove_device dev_pm_opp_find_freq_exact - dma_fence_add_callback dma_fence_default_wait - dma_fence_get_status dma_fence_remove_callback downgrade_write down_read_trylock @@ -1347,7 +1372,6 @@ ktime_get_raw ktime_get_raw_ts64 memchr - __mmdrop of_dma_is_coherent of_property_read_variable_u64_array pid_task @@ -1371,7 +1395,6 @@ shmem_file_setup simple_open strcspn - sync_file_get_fence system_freezing_cnt system_highpri_wq _totalram_pages @@ -1482,7 +1505,6 @@ clk_fixed_factor_ops clk_fractional_divider_ops __clk_get_hw - clk_get_parent clk_hw_register_composite clk_hw_round_rate clk_mux_ops @@ -1501,6 +1523,9 @@ scmi_driver_register scmi_driver_unregister +# required by cm3218.ko + i2c_smbus_write_word_data + # required by cma_heap.ko cma_get_name dma_contiguous_default_area @@ -1544,16 +1569,17 @@ mmc_cqe_request_done # required by cryptodev.ko - __close_fd crypto_ahash_final crypto_alloc_akcipher - get_user_pages_remote krealloc proc_dointvec register_sysctl_table sg_last unregister_sysctl_table +# required by da223.ko + simple_strtoul + # required by display-connector.ko drm_atomic_get_new_bridge_state drm_probe_ddc @@ -1672,12 +1698,6 @@ irq_get_domain_generic_chip of_pinctrl_get -# required by grf.ko - of_find_matching_node_and_match - -# required by gslx680-pad.ko - input_unregister_device - # required by hid-alps.ko down input_alloc_absinfo @@ -1706,7 +1726,6 @@ hid_destroy_device hid_input_report hid_parse_report - i2c_smbus_read_byte # required by i2c-mux.ko i2c_add_numbered_adapter @@ -1985,10 +2004,7 @@ dw_pcie_write dw_pcie_write_dbi pci_disable_link_state - pcie_capability_clear_and_set_word - pci_read_config_dword pci_set_power_state - pci_write_config_dword # required by pcierockchiphost.ko devm_pci_alloc_host_bridge @@ -2083,12 +2099,17 @@ kernel_kobj # required by rfkill-rk.ko - gpio_free - gpio_request kstrtoll rfkill_init_sw_state rfkill_set_sw_state +# required by rga3.ko + alloc_iova_fast + dma_fence_wait_timeout + free_iova_fast + kstrdup_quotable_cmdline + mmput + # required by rk628.ko irq_dispose_mapping irq_domain_xlate_onetwocell @@ -2118,11 +2139,6 @@ regmap_del_irq_chip unregister_syscore_ops -# required by rk818_battery.ko - blocking_notifier_call_chain - blocking_notifier_chain_register - blocking_notifier_chain_unregister - # required by rk860x-regulator.ko regulator_suspend_enable @@ -2151,6 +2167,9 @@ # required by rk_headset_irq_hook_adc.ko iio_read_channel_raw +# required by rk_ircut.ko + drain_workqueue + # required by rk_vcodec.ko devfreq_remove_governor devm_iounmap @@ -2160,11 +2179,8 @@ dma_buf_begin_cpu_access_partial dma_buf_end_cpu_access_partial __fdget - iommu_attach_group - iommu_detach_group iommu_device_unregister iommu_dma_reserve_iova - iommu_group_get kthread_flush_worker __kthread_init_worker kthread_queue_work @@ -2174,15 +2190,12 @@ platform_device_del pm_generic_runtime_resume pm_generic_runtime_suspend - pm_relax - pm_stay_awake proc_create_single_data proc_remove strncat # required by rknpu.ko dev_pm_domain_attach_by_name - drm_gem_create_mmap_offset drm_gem_dumb_destroy drm_gem_handle_delete drm_gem_prime_export @@ -2253,7 +2266,6 @@ dev_pm_qos_add_request dev_pm_qos_remove_request dev_pm_qos_update_request - regulator_get remove_cpu strchr strsep @@ -2421,7 +2433,6 @@ drm_writeback_signal_completion iommu_domain_alloc iommu_domain_free - iommu_map_sg memblock_free mipi_dsi_packet_format_is_short of_find_backlight_by_node @@ -2464,12 +2475,17 @@ sdhci_setup_host # required by sdhci-of-dwcmshc.ko + device_get_match_data devm_clk_bulk_get_optional dma_get_required_mask sdhci_adma_write_desc sdhci_remove_host sdhci_request +# required by sensor_dev.ko + class_create_file_ns + class_remove_file_ns + # required by sg.ko blk_get_request blk_put_request @@ -2498,9 +2514,6 @@ sg_scsi_ioctl __task_pid_nr_ns -# required by sgm41542_charger.ko - regulator_unregister - # required by sha1-ce.ko crypto_sha1_finup crypto_sha1_update @@ -2534,6 +2547,9 @@ # required by snd-soc-es8316.ko snd_pcm_hw_constraint_list +# required by snd-soc-es8326.ko + snd_soc_register_component + # required by snd-soc-hdmi-codec.ko snd_ctl_add snd_ctl_new1 @@ -2568,7 +2584,6 @@ snd_soc_dapm_force_bias_level # required by snd-soc-simple-card-utils.ko - devm_kasprintf devm_kvasprintf snd_soc_dai_set_tdm_slot snd_soc_of_parse_audio_simple_widgets @@ -2607,7 +2622,6 @@ swiotlb_max_segment # required by tcpci_husb311.ko - i2c_smbus_read_word_data tcpci_get_tcpm_port tcpci_irq tcpci_register_port @@ -2710,10 +2724,8 @@ # required by video_rkisp.ko media_device_cleanup - __memcpy_fromio __memcpy_toio param_ops_ullong - v4l2_event_unsubscribe v4l2_pipeline_link_notify # required by videobuf2-dma-sg.ko From 052619d9e13613344b8b8913bf815bfb8a515786 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Wed, 17 Aug 2022 12:10:43 +0800 Subject: [PATCH 22/52] ANDROID: GKI: rockchip: Enable symbols bcmdhd-sdio Leaf changes summary: 9 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 9 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 9 Added functions: [A] 'function int mmc_sw_reset(mmc_host*)' [A] 'function int pinctrl_generic_add_group(pinctrl_dev*, const char*, int*, int, void*)' [A] 'function int pinmux_generic_add_function(pinctrl_dev*, const char*, const char**, const unsigned int, void*)' [A] 'function u16 sdio_readw(sdio_func*, unsigned int, int*)' [A] 'function void sdio_retune_crc_disable(sdio_func*)' [A] 'function void sdio_retune_crc_enable(sdio_func*)' [A] 'function void sdio_retune_hold_now(sdio_func*)' [A] 'function void sdio_retune_release(sdio_func*)' [A] 'function void sdio_writew(sdio_func*, u16, unsigned int, int*)' Bug: 239396464 Signed-off-by: Kever Yang Change-Id: I5f10fbc9e6b274c11508c10444ec7a31ba73ad71 --- android/abi_gki_aarch64.xml | 359 ++++++++++++++++--------------- android/abi_gki_aarch64_rockchip | 170 ++++++++++----- 2 files changed, 310 insertions(+), 219 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 3fb33ab9b246..bf6dc0f308a8 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -814,6 +814,7 @@ + @@ -2542,6 +2543,7 @@ + @@ -3574,6 +3576,7 @@ + @@ -4113,6 +4116,7 @@ + @@ -4134,6 +4138,7 @@ + @@ -4714,9 +4719,14 @@ + + + + + @@ -4725,6 +4735,7 @@ + @@ -14826,6 +14837,7 @@ + @@ -15055,15 +15067,15 @@ - + - + - + - + @@ -15085,89 +15097,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -30773,18 +30702,18 @@ - + - + - + - + - + @@ -37144,6 +37073,12 @@ + + + + + + @@ -44826,6 +44761,9 @@ + + + @@ -52893,81 +52831,81 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -60964,7 +60902,7 @@ - + @@ -62610,24 +62548,24 @@ - + - + - + - + - + - + - + @@ -67758,14 +67696,7 @@ - - - - - - - - + @@ -69131,7 +69062,26 @@ - + + + + + + + + + + + + + + + + + + + + @@ -92826,7 +92776,6 @@ - @@ -95584,7 +95533,17 @@ - + + + + + + + + + + + @@ -106029,30 +105988,30 @@ - + - + - + - + - + - + - + - + - + @@ -116465,12 +116424,12 @@ - - + + - - + + @@ -120446,9 +120405,9 @@ - - - + + + @@ -120550,6 +120509,13 @@ + + + + + + + @@ -120565,9 +120531,9 @@ - - - + + + @@ -129704,6 +129670,12 @@ + + + + + + @@ -129713,14 +129685,14 @@ - - - + + + - - - + + + @@ -134969,6 +134941,10 @@ + + + + @@ -137781,6 +137757,14 @@ + + + + + + + + @@ -137893,6 +137877,14 @@ + + + + + + + + @@ -140756,6 +140748,12 @@ + + + + + + @@ -140768,6 +140766,22 @@ + + + + + + + + + + + + + + + + @@ -140814,6 +140828,13 @@ + + + + + + + @@ -141375,15 +141396,15 @@ - + - - + + - - + + @@ -143547,8 +143568,8 @@ - - + + diff --git a/android/abi_gki_aarch64_rockchip b/android/abi_gki_aarch64_rockchip index 6eee0b6e4e70..3cf7478b5d90 100644 --- a/android/abi_gki_aarch64_rockchip +++ b/android/abi_gki_aarch64_rockchip @@ -57,6 +57,7 @@ cancel_delayed_work cancel_delayed_work_sync cancel_work_sync + capable cdev_add cdev_del cdev_device_add @@ -117,6 +118,7 @@ completion_done __const_udelay consume_skb + cpu_bit_bitmap __cpufreq_driver_target cpufreq_generic_suspend cpufreq_register_governor @@ -189,6 +191,7 @@ devfreq_suspend_device devfreq_unregister_opp_notifier dev_fwnode + dev_get_regmap device_add device_add_disk device_create @@ -258,6 +261,7 @@ devm_phy_optional_get devm_pinctrl_get devm_pinctrl_register + devm_pinctrl_register_and_init devm_platform_get_and_ioremap_resource devm_platform_ioremap_resource devm_platform_ioremap_resource_byname @@ -317,6 +321,7 @@ dma_buf_unmap_attachment dma_buf_vmap dma_buf_vunmap + dma_contiguous_default_area dma_fence_add_callback dma_fence_context_alloc dma_fence_get_status @@ -349,15 +354,18 @@ dma_unmap_page_attrs dma_unmap_resource dma_unmap_sg_attrs + down down_read down_write driver_register driver_unregister drm_add_edid_modes drm_atomic_get_crtc_state + drm_atomic_get_new_bridge_state drm_atomic_get_new_connector_for_encoder drm_atomic_helper_bridge_destroy_state drm_atomic_helper_bridge_duplicate_state + drm_atomic_helper_bridge_propagate_bus_fmt drm_atomic_helper_bridge_reset drm_atomic_helper_connector_destroy_state drm_atomic_helper_connector_duplicate_state @@ -421,6 +429,7 @@ drm_helper_probe_single_connector_modes drm_ioctl drm_kms_helper_hotplug_event + drm_kms_helper_is_poll_worker drm_match_cea_mode drm_mode_copy drm_mode_create @@ -466,6 +475,7 @@ extcon_get_state extcon_register_notifier extcon_set_property_capability + extcon_set_state extcon_set_state_sync extcon_unregister_notifier failure_tracking @@ -480,8 +490,8 @@ flush_workqueue fpsimd_context_busy fput - frame_vector_to_pages free_irq + free_netdev __free_pages free_pages free_percpu @@ -494,6 +504,7 @@ fwnode_property_read_string fwnode_property_read_u32_array gcd + generic_file_llseek generic_handle_irq generic_mii_ioctl __genphy_config_aneg @@ -584,6 +595,7 @@ iio_device_attach_buffer iio_push_to_buffers iio_read_channel_processed + init_net __init_rwsem __init_swait_queue_head init_timer_key @@ -659,6 +671,7 @@ kmem_cache_free kmemdup kobject_create_and_add + kobject_init_and_add kobject_put kobject_uevent_env kstrdup @@ -684,6 +697,7 @@ led_trigger_unregister __list_add_valid __list_del_entry_valid + __local_bh_enable_ip __log_post_read_mmio __log_read_mmio __log_write_mmio @@ -716,6 +730,8 @@ mipi_dsi_attach mipi_dsi_create_packet mipi_dsi_detach + mipi_dsi_device_register_full + mipi_dsi_device_unregister mipi_dsi_host_register mipi_dsi_host_unregister misc_deregister @@ -740,6 +756,13 @@ netdev_err netdev_info netdev_warn + netif_rx + netif_rx_ni + netif_tx_wake_queue + netlink_unicast + nla_memcpy + nla_put + nla_reserve no_llseek nonseekable_open noop_llseek @@ -769,6 +792,7 @@ of_find_device_by_node of_find_i2c_device_by_node of_find_matching_node_and_match + of_find_mipi_dsi_host_by_node of_find_node_by_name of_find_node_opts_by_path of_find_property @@ -833,8 +857,15 @@ phy_power_off phy_power_on phy_set_mode_ext + pinconf_generic_dt_free_map pinconf_generic_dt_node_to_map pinctrl_dev_get_drvdata + pinctrl_enable + pinctrl_generic_add_group + pinctrl_generic_get_group + pinctrl_generic_get_group_count + pinctrl_generic_get_group_name + pinctrl_generic_get_group_pins pinctrl_gpio_direction_input pinctrl_gpio_direction_output pinctrl_lookup_state @@ -842,6 +873,11 @@ pinctrl_pm_select_sleep_state pinctrl_select_state pinctrl_utils_free_map + pinmux_generic_add_function + pinmux_generic_get_function + pinmux_generic_get_function_count + pinmux_generic_get_function_groups + pinmux_generic_get_function_name platform_bus_type platform_device_put platform_device_register_full @@ -884,6 +920,8 @@ power_supply_register power_supply_reg_notifier power_supply_unregister + prandom_bytes + prandom_u32 preempt_schedule preempt_schedule_notrace prepare_to_wait_event @@ -925,6 +963,8 @@ regcache_sync __register_chrdev register_chrdev_region + register_inetaddr_notifier + register_netdevice register_netdevice_notifier register_pm_notifier register_reboot_notifier @@ -979,6 +1019,7 @@ round_jiffies_relative rtc_class_open rtc_read_time + rtc_time64_to_tm rtc_tm_to_time64 rtc_valid_tm rtnl_is_locked @@ -1024,9 +1065,11 @@ simple_attr_release simple_read_from_buffer simple_strtol + simple_strtoul single_open single_release skb_clone + skb_copy skb_copy_bits skb_copy_expand skb_pull @@ -1075,21 +1118,26 @@ snd_soc_put_volsw snd_soc_unregister_component snprintf + sort __spi_register_driver spi_sync sprintf sscanf __stack_chk_fail __stack_chk_guard + strchr strcmp strcpy strlcpy strlen strncasecmp + strncat strncmp strncpy strnlen + strrchr strscpy + strsep strstr __sw_hweight16 __sw_hweight32 @@ -1144,7 +1192,9 @@ __udelay __unregister_chrdev unregister_chrdev_region + unregister_inetaddr_notifier unregister_netdevice_notifier + unregister_netdevice_queue unregister_reboot_notifier unregister_shrinker up @@ -1260,10 +1310,6 @@ v4l2_valid_dv_timings vabits_actual vb2_buffer_done - vb2_common_vm_ops - vb2_create_framevec - vb2_destroy_framevec - vb2_dma_contig_memops vb2_fop_mmap vb2_fop_poll vb2_fop_release @@ -1293,8 +1339,7 @@ vmap vm_get_page_prot vm_map_pages - vm_map_ram - vm_unmap_ram + vsnprintf vunmap vzalloc wait_for_completion @@ -1304,6 +1349,7 @@ wakeup_source_add wakeup_source_remove __warn_printk + work_busy # required by 8250_dw.ko of_device_is_big_endian @@ -1339,6 +1385,66 @@ pci_find_capability pci_find_ext_capability +# required by bcmdhd.ko + alloc_etherdev_mqs + complete_and_exit + dev_open + down_interruptible + down_timeout + iwe_stream_add_event + iwe_stream_add_point + iwe_stream_add_value + __kfifo_init + kobject_uevent + mmc_set_data_timeout + mmc_sw_reset + mmc_wait_for_req + netdev_update_features + __netlink_kernel_create + netlink_kernel_release + nla_append + nla_put_nohdr + __nlmsg_put + _raw_read_lock_bh + _raw_read_unlock_bh + register_netdev + sched_set_fifo_low + sdio_claim_host + sdio_disable_func + sdio_enable_func + sdio_f0_readb + sdio_f0_writeb + sdio_get_host_pm_caps + sdio_memcpy_fromio + sdio_memcpy_toio + sdio_readb + sdio_readl + sdio_readsb + sdio_readw + sdio_register_driver + sdio_release_host + sdio_retune_crc_disable + sdio_retune_crc_enable + sdio_retune_hold_now + sdio_retune_release + sdio_set_block_size + sdio_set_host_pm_flags + sdio_unregister_driver + sdio_writeb + sdio_writel + sdio_writew + set_cpus_allowed_ptr + __skb_pad + skb_realloc_headroom + sock_wfree + sprint_symbol + strcat + strspn + sys_tz + unregister_netdev + unregister_pm_notifier + wireless_send_event + # required by bifrost_kbase.ko __arch_clear_user __bitmap_andnot @@ -1360,13 +1466,11 @@ dump_stack find_get_pid freezing_slow_path - generic_file_llseek get_user_pages get_user_pages_fast hrtimer_active iomem_resource kobject_del - kobject_init_and_add kstrndup kstrtobool_from_user ktime_get_raw @@ -1441,25 +1545,19 @@ get_net_ns_by_fd get_net_ns_by_pid inet_csk_get_port - init_net init_uts_ns key_create_or_update key_put keyring_alloc ktime_get_coarse_with_offset memcmp - netif_rx_ni netlink_broadcast netlink_register_notifier - netlink_unicast netlink_unregister_notifier net_ns_type_operations nla_find - nla_memcpy __nla_parse nla_put_64bit - nla_put - nla_reserve __nla_validate of_prop_next_u32 __put_net @@ -1528,7 +1626,6 @@ # required by cma_heap.ko cma_get_name - dma_contiguous_default_area dma_heap_get_drvdata dma_heap_put @@ -1577,11 +1674,7 @@ sg_last unregister_sysctl_table -# required by da223.ko - simple_strtoul - # required by display-connector.ko - drm_atomic_get_new_bridge_state drm_probe_ddc # required by dm9601.ko @@ -1672,7 +1765,6 @@ tcpm_register_port tcpm_unregister_port tcpm_vbus_change - vsnprintf # required by gc2145.ko v4l2_ctrl_subdev_log_status @@ -1699,7 +1791,6 @@ of_pinctrl_get # required by hid-alps.ko - down input_alloc_absinfo input_mt_sync_frame @@ -1787,7 +1878,6 @@ dev_queue_xmit ether_setup ethtool_op_get_link - free_netdev get_random_u32 __hw_addr_init __hw_addr_sync @@ -1796,24 +1886,17 @@ kernel_param_unlock kfree_skb_list ktime_get_seconds - __local_bh_enable_ip napi_gro_receive netdev_set_default_ethtool_ops netif_carrier_off netif_carrier_on netif_receive_skb netif_receive_skb_list - netif_rx netif_tx_stop_all_queues - netif_tx_wake_queue net_ratelimit - prandom_bytes - prandom_u32 ___pskb_trim rcu_barrier register_inet6addr_notifier - register_inetaddr_notifier - register_netdevice rhashtable_free_and_destroy rhashtable_insert_slow rhltable_init @@ -1825,7 +1908,6 @@ skb_checksum_help skb_clone_sk skb_complete_wifi_ack - skb_copy skb_dequeue skb_ensure_writable __skb_get_hash @@ -1835,9 +1917,7 @@ skb_queue_tail synchronize_net unregister_inet6addr_notifier - unregister_inetaddr_notifier unregister_netdevice_many - unregister_netdevice_queue # required by nvme-core.ko bd_set_nr_sectors @@ -1867,7 +1947,6 @@ blk_set_queue_dying blk_status_to_errno blk_sync_queue - capable cleanup_srcu_struct device_remove_file_self dev_pm_qos_expose_latency_tolerance @@ -1993,7 +2072,6 @@ videomode_from_timing # required by pcie-dw-rockchip.ko - cpu_bit_bitmap cpumask_next_and dw_pcie_find_ext_capability dw_pcie_host_init @@ -2022,7 +2100,6 @@ # required by phy-rockchip-inno-usb2.ko devm_extcon_register_notifier - extcon_set_state extcon_sync # required by phy-rockchip-inno-usb3.ko @@ -2077,7 +2154,6 @@ pm_genpd_add_subdomain pm_genpd_init pm_genpd_remove - strrchr # required by pwm-regulator.ko regulator_map_voltage_iterate @@ -2192,7 +2268,6 @@ pm_generic_runtime_suspend proc_create_single_data proc_remove - strncat # required by rknpu.ko dev_pm_domain_attach_by_name @@ -2267,8 +2342,6 @@ dev_pm_qos_remove_request dev_pm_qos_update_request remove_cpu - strchr - strsep thermal_zone_get_temp # required by rockchip_thermal.ko @@ -2292,7 +2365,6 @@ drm_atomic_commit drm_atomic_get_connector_state drm_atomic_get_plane_state - drm_atomic_helper_bridge_propagate_bus_fmt drm_atomic_helper_check drm_atomic_helper_check_plane_state drm_atomic_helper_cleanup_planes @@ -2443,21 +2515,14 @@ platform_find_device_by_driver __platform_register_drivers platform_unregister_drivers - sort __vmalloc -# required by rohm-bu18tl82.ko - mipi_dsi_device_register_full - mipi_dsi_device_unregister - of_find_mipi_dsi_host_by_node - # required by rtc-hym8563.ko devm_rtc_device_register # required by rtc-rk808.ko devm_rtc_allocate_device __rtc_register_device - rtc_time64_to_tm rtc_update_irq # required by sdhci-of-arasan.ko @@ -2720,7 +2785,6 @@ # required by video_rkcif.ko media_entity_setup_link - work_busy # required by video_rkisp.ko media_device_cleanup @@ -2728,8 +2792,14 @@ param_ops_ullong v4l2_pipeline_link_notify -# required by videobuf2-dma-sg.ko +# required by videobuf2-cma-sg.ko + frame_vector_to_pages split_page + vb2_common_vm_ops + vb2_create_framevec + vb2_destroy_framevec + vm_map_ram + vm_unmap_ram # required by vl6180.ko iio_read_const_attr From f32894eadfeb45602ac80148cde3d293aaa12140 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Wed, 17 Aug 2022 15:17:26 +0800 Subject: [PATCH 23/52] ANDROID: GKI: rockchip: update fragment file Sync the latest fragment file. Bug: 239396464 Signed-off-by: Kever Yang Change-Id: I2e0afd0c4ff7a60b712e642cbe8a914c4407602d --- arch/arm64/configs/rockchip_gki.fragment | 141 ++++++++++++++++++++--- build.config.rockchip | 2 +- 2 files changed, 124 insertions(+), 19 deletions(-) diff --git a/arch/arm64/configs/rockchip_gki.fragment b/arch/arm64/configs/rockchip_gki.fragment index 36645c46d0b4..6253108101a8 100644 --- a/arch/arm64/configs/rockchip_gki.fragment +++ b/arch/arm64/configs/rockchip_gki.fragment @@ -1,20 +1,24 @@ +CONFIG_AP6XXX=m CONFIG_ARCH_ROCKCHIP=y CONFIG_ARM_ROCKCHIP_BUS_DEVFREQ=m CONFIG_ARM_ROCKCHIP_CPUFREQ=m -# CONFIG_ATA_SFF is not set +CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ=m CONFIG_BACKLIGHT_PWM=m CONFIG_BATTERY_CW2015=m +CONFIG_BATTERY_CW2017=m +CONFIG_BATTERY_CW221X=m CONFIG_BATTERY_RK817=m CONFIG_BATTERY_RK818=m CONFIG_BLK_DEV_NVME=m CONFIG_BMA2XX_ACC=m CONFIG_CHARGER_BQ25700=m +CONFIG_CHARGER_BQ25890=m CONFIG_CHARGER_RK817=m CONFIG_CHARGER_RK818=m +CONFIG_CHARGER_SC89890=m +CONFIG_CHARGER_SGM41542=m CONFIG_CHR_DEV_SCH=m CONFIG_CHR_DEV_SG=m -# CONFIG_CLK_RK1808 is not set -# CONFIG_CLK_RK3308 is not set CONFIG_COMMON_CLK_PWM=m CONFIG_COMMON_CLK_RK808=m CONFIG_COMMON_CLK_ROCKCHIP=m @@ -25,12 +29,10 @@ CONFIG_COMPASS_DEVICE=m CONFIG_CPUFREQ_DT=m CONFIG_CPU_FREQ_GOV_ONDEMAND=m CONFIG_CPU_FREQ_GOV_USERSPACE=m -CONFIG_CPU_PX30=y -CONFIG_CPU_RK3328=y -CONFIG_CPU_RK3368=y -CONFIG_CPU_RK3399=y -CONFIG_CPU_RK3568=y +CONFIG_CPU_RK3588=y CONFIG_CRYPTO_AES_ARM64_CE_CCM=m +CONFIG_CRYPTO_DEV_ROCKCHIP=m +CONFIG_CRYPTO_DEV_ROCKCHIP_DEV=m CONFIG_CRYPTO_GHASH_ARM64_CE=m CONFIG_CRYPTO_SHA1_ARM64_CE=m CONFIG_CRYPTO_TWOFISH=m @@ -38,13 +40,20 @@ CONFIG_DEVFREQ_EVENT_ROCKCHIP_NOCP=m CONFIG_DMABUF_HEAPS_CMA=m CONFIG_DMABUF_HEAPS_SYSTEM=m CONFIG_DRAGONRISE_FF=y +CONFIG_DRM_DISPLAY_CONNECTOR=m CONFIG_DRM_DW_HDMI_CEC=m CONFIG_DRM_DW_HDMI_I2S_AUDIO=m +CONFIG_DRM_MAXIM_MAX96745=m +CONFIG_DRM_MAXIM_MAX96752F=m +CONFIG_DRM_MAXIM_MAX96755F=m CONFIG_DRM_PANEL_SIMPLE=m +CONFIG_DRM_RK1000_TVE=m +CONFIG_DRM_RK630_TVE=m CONFIG_DRM_ROCKCHIP=m +CONFIG_DRM_ROCKCHIP_RK628=m +CONFIG_DRM_ROHM_BU18XL82=m CONFIG_DRM_SII902X=m CONFIG_DTC_SYMBOLS=y -# CONFIG_DWMAC_GENERIC is not set CONFIG_DW_WATCHDOG=m CONFIG_GPIO_ROCKCHIP=m CONFIG_GREENASIA_FF=y @@ -116,13 +125,12 @@ CONFIG_I2C_CHARDEV=m CONFIG_I2C_GPIO=m CONFIG_I2C_HID=m CONFIG_I2C_RK3X=m +CONFIG_IEP=m CONFIG_IIO_BUFFER_CB=m CONFIG_INPUT_RK805_PWRKEY=m -CONFIG_ION=y -CONFIG_ION_SYSTEM_HEAP=y -CONFIG_JOLIET=y CONFIG_KEYBOARD_ADC=m CONFIG_LEDS_GPIO=m +CONFIG_LEDS_RGB13H=m CONFIG_LEDS_TRIGGER_BACKLIGHT=m CONFIG_LEDS_TRIGGER_DEFAULT_ON=m CONFIG_LEDS_TRIGGER_HEARTBEAT=m @@ -131,7 +139,16 @@ CONFIG_LSM330_ACC=m CONFIG_LS_CM3217=m CONFIG_LS_CM3218=m CONFIG_LS_STK3410=m -# CONFIG_MALI400_PROFILING is not set +CONFIG_LS_UCS14620=m +CONFIG_MALI_BIFROST=m +CONFIG_MALI_BIFROST_DEBUG=y +CONFIG_MALI_BIFROST_EXPERT=y +CONFIG_MALI_CSF_SUPPORT=y +CONFIG_MALI_PLATFORM_NAME="rk" +CONFIG_MALI_PWRSOFT_765=y +CONFIG_MFD_RK628=m +CONFIG_MFD_RK630_I2C=m +CONFIG_MFD_RK806_SPI=m CONFIG_MFD_RK808=m CONFIG_MMC_DW=m CONFIG_MMC_DW_ROCKCHIP=m @@ -141,22 +158,33 @@ CONFIG_MPU6500_ACC=m CONFIG_MPU6880_ACC=m CONFIG_OPTEE=m CONFIG_PANTHERLORD_FF=y +CONFIG_PCIEASPM_EXT=m +CONFIG_PCIE_DW_ROCKCHIP=m +CONFIG_PCIE_ROCKCHIP_HOST=m +CONFIG_PHY_ROCKCHIP_CSI2_DPHY=m CONFIG_PHY_ROCKCHIP_DP=m CONFIG_PHY_ROCKCHIP_EMMC=m CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=m +CONFIG_PHY_ROCKCHIP_INNO_HDMI=m CONFIG_PHY_ROCKCHIP_INNO_USB2=m CONFIG_PHY_ROCKCHIP_INNO_USB3=m CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=m CONFIG_PHY_ROCKCHIP_NANENG_EDP=m CONFIG_PHY_ROCKCHIP_PCIE=m +CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY=m +CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX=m +CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX_HDMI=m CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=m CONFIG_PHY_ROCKCHIP_TYPEC=m CONFIG_PHY_ROCKCHIP_USB=m +CONFIG_PHY_ROCKCHIP_USBDP=m CONFIG_PINCTRL_RK805=m +CONFIG_PINCTRL_RK806=m CONFIG_PINCTRL_ROCKCHIP=m CONFIG_PL330_DMA=m CONFIG_PROXIMITY_DEVICE=m CONFIG_PS_STK3410=m +CONFIG_PS_UCS14620=m CONFIG_PWM_ROCKCHIP=m CONFIG_REGULATOR_ACT8865=m CONFIG_REGULATOR_FAN53555=m @@ -164,25 +192,43 @@ CONFIG_REGULATOR_GPIO=m CONFIG_REGULATOR_LP8752=m CONFIG_REGULATOR_MP8865=m CONFIG_REGULATOR_PWM=m +CONFIG_REGULATOR_RK806=m CONFIG_REGULATOR_RK808=m +CONFIG_REGULATOR_RK860X=m CONFIG_REGULATOR_TPS65132=m +CONFIG_REGULATOR_WL2868C=m CONFIG_REGULATOR_XZ3216=m +CONFIG_RFKILL_RK=m CONFIG_RK_CONSOLE_THREAD=y -CONFIG_RK_NAND=m +CONFIG_RK_HEADSET=m CONFIG_ROCKCHIP_ANALOGIX_DP=y CONFIG_ROCKCHIP_CDN_DP=y CONFIG_ROCKCHIP_CPUINFO=m CONFIG_ROCKCHIP_DEBUG=m +CONFIG_ROCKCHIP_DW_DP=y +CONFIG_ROCKCHIP_DW_HDCP2=m CONFIG_ROCKCHIP_DW_HDMI=y CONFIG_ROCKCHIP_DW_MIPI_DSI=y CONFIG_ROCKCHIP_EFUSE=m -CONFIG_ROCKCHIP_FIQ_DEBUGGER=m CONFIG_ROCKCHIP_GRF=m CONFIG_ROCKCHIP_INNO_HDMI=y CONFIG_ROCKCHIP_IODOMAIN=m CONFIG_ROCKCHIP_IOMMU=m CONFIG_ROCKCHIP_IPA=m CONFIG_ROCKCHIP_LVDS=y +CONFIG_ROCKCHIP_MPP_AV1DEC=y +CONFIG_ROCKCHIP_MPP_IEP2=y +CONFIG_ROCKCHIP_MPP_JPGDEC=y +CONFIG_ROCKCHIP_MPP_RKVDEC=y +CONFIG_ROCKCHIP_MPP_RKVDEC2=y +CONFIG_ROCKCHIP_MPP_RKVENC=y +CONFIG_ROCKCHIP_MPP_RKVENC2=y +CONFIG_ROCKCHIP_MPP_SERVICE=m +CONFIG_ROCKCHIP_MPP_VDPU1=y +CONFIG_ROCKCHIP_MPP_VDPU2=y +CONFIG_ROCKCHIP_MPP_VEPU1=y +CONFIG_ROCKCHIP_MPP_VEPU2=y +CONFIG_ROCKCHIP_MULTI_RGA=m CONFIG_ROCKCHIP_OPP=m CONFIG_ROCKCHIP_OTP=m CONFIG_ROCKCHIP_PHY=m @@ -191,14 +237,19 @@ CONFIG_ROCKCHIP_PVTM=m CONFIG_ROCKCHIP_REMOTECTL=m CONFIG_ROCKCHIP_REMOTECTL_PWM=m CONFIG_ROCKCHIP_RGB=y +CONFIG_ROCKCHIP_RKNPU=m CONFIG_ROCKCHIP_SARADC=m CONFIG_ROCKCHIP_SIP=m +CONFIG_ROCKCHIP_SUSPEND_MODE=m CONFIG_ROCKCHIP_SYSTEM_MONITOR=m CONFIG_ROCKCHIP_THERMAL=m +CONFIG_ROCKCHIP_TIMER=m CONFIG_ROCKCHIP_VENDOR_STORAGE=m CONFIG_ROCKCHIP_VENDOR_STORAGE_UPDATE_LOADER=y +CONFIG_RTC_DRV_HYM8563=m CONFIG_RTC_DRV_RK808=m CONFIG_SENSOR_DEVICE=m +CONFIG_SERIAL_8250_DW=m CONFIG_SMARTJOYPLUS_FF=y CONFIG_SND_SIMPLE_CARD=m CONFIG_SND_SOC_BT_SCO=m @@ -209,13 +260,20 @@ CONFIG_SND_SOC_ES7210=m CONFIG_SND_SOC_ES7243E=m CONFIG_SND_SOC_ES8311=m CONFIG_SND_SOC_ES8316=m +CONFIG_SND_SOC_ES8323=m +CONFIG_SND_SOC_ES8326=m CONFIG_SND_SOC_ES8396=m CONFIG_SND_SOC_RK3328=m CONFIG_SND_SOC_RK817=m CONFIG_SND_SOC_RK_CODEC_DIGITAL=m CONFIG_SND_SOC_ROCKCHIP=m +CONFIG_SND_SOC_ROCKCHIP_HDMI=m +CONFIG_SND_SOC_ROCKCHIP_I2S=m +CONFIG_SND_SOC_ROCKCHIP_I2S_TDM=m +CONFIG_SND_SOC_ROCKCHIP_MULTICODECS=m CONFIG_SND_SOC_ROCKCHIP_PDM=m CONFIG_SND_SOC_ROCKCHIP_SPDIF=m +CONFIG_SND_SOC_ROCKCHIP_SPDIFRX=m CONFIG_SND_SOC_RT5640=m CONFIG_SND_SOC_SPDIF=m CONFIG_SPI_ROCKCHIP=m @@ -224,14 +282,61 @@ CONFIG_SW_SYNC=m CONFIG_SYSCON_REBOOT_MODE=m CONFIG_TEE=m CONFIG_TEST_POWER=m +CONFIG_TOUCHSCREEN_ELAN5515=m +CONFIG_TOUCHSCREEN_GSL3673=m CONFIG_TOUCHSCREEN_GSLX680_PAD=m -CONFIG_TOUCHSCREEN_GT1X=m CONFIG_TYPEC_DP_ALTMODE=m CONFIG_TYPEC_FUSB302=m +CONFIG_TYPEC_HUSB311=m +CONFIG_UCS12CM0=m +CONFIG_USB_DWC2=m +CONFIG_USB_NET_CDC_MBIM=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_KALMIA=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_SMSC75XX=m +CONFIG_USB_NET_SMSC95XX=m +CONFIG_USB_OHCI_HCD=m +# CONFIG_USB_OHCI_HCD_PCI is not set +CONFIG_USB_OHCI_HCD_PLATFORM=m +CONFIG_USB_PRINTER=m +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_VIDEO_AW36518=m +CONFIG_VIDEO_AW8601=m +CONFIG_VIDEO_CN3927V=m CONFIG_VIDEO_DW9714=m -CONFIG_VIDEO_OV2680=m +CONFIG_VIDEO_FP5510=m +CONFIG_VIDEO_GC2145=m +CONFIG_VIDEO_GC2385=m +CONFIG_VIDEO_GC4C33=m +CONFIG_VIDEO_GC8034=m +CONFIG_VIDEO_IMX415=m +CONFIG_VIDEO_LT6911UXC=m +CONFIG_VIDEO_LT7911D=m +CONFIG_VIDEO_NVP6188=m +CONFIG_VIDEO_OV02B10=m +CONFIG_VIDEO_OV13850=m +CONFIG_VIDEO_OV13855=m +CONFIG_VIDEO_OV50C40=m CONFIG_VIDEO_OV5695=m -CONFIG_ZISOFS=y +CONFIG_VIDEO_OV8858=m +CONFIG_VIDEO_RK628_BT1120=m +CONFIG_VIDEO_RK628_CSI=m +CONFIG_VIDEO_RK_IRCUT=m +CONFIG_VIDEO_ROCKCHIP_CIF=m +CONFIG_VIDEO_ROCKCHIP_ISP=m +CONFIG_VIDEO_ROCKCHIP_ISPP=m +CONFIG_VIDEO_S5K3L6XX=m +CONFIG_VIDEO_S5KJN1=m +CONFIG_VIDEO_SGM3784=m +CONFIG_VIDEO_THCV244=m +CONFIG_VL6180=m +CONFIG_WIFI_BUILD_MODULE=y +CONFIG_WL_ROCKCHIP=m CONFIG_ZRAM=m CONFIG_ZSMALLOC=m # CONFIG_USB_DUMMY_HCD is not set diff --git a/build.config.rockchip b/build.config.rockchip index e7f08311793b..297c4c95a14b 100644 --- a/build.config.rockchip +++ b/build.config.rockchip @@ -3,6 +3,6 @@ DEFCONFIG=rockchip_aarch64_gki_defconfig KMI_SYMBOL_LIST=android/abi_gki_aarch64_rockchip -PRE_DEFCONFIG_CMDS="KCONFIG_CONFIG=${ROOT_DIR}/common/arch/arm64/configs/${DEFCONFIG} ${ROOT_DIR}/common/scripts/kconfig/merge_config.sh -m -r ${ROOT_DIR}/common/arch/arm64/configs/gki_defconfig ${ROOT_DIR}/common/arch/arm64/configs/rockchip_gki.config" +PRE_DEFCONFIG_CMDS="KCONFIG_CONFIG=${ROOT_DIR}/common/arch/arm64/configs/${DEFCONFIG} ${ROOT_DIR}/common/scripts/kconfig/merge_config.sh -m -r ${ROOT_DIR}/common/arch/arm64/configs/gki_defconfig ${ROOT_DIR}/common/arch/arm64/configs/rockchip_gki.fragment" POST_DEFCONFIG_CMDS="rm ${ROOT_DIR}/common/arch/arm64/configs/${DEFCONFIG}" From a47cec9c434191698c1ef04f98f90aa7cad7d2b2 Mon Sep 17 00:00:00 2001 From: Peifeng Li Date: Mon, 22 Aug 2022 12:47:27 +0800 Subject: [PATCH 24/52] ANDROID: GKI: Update symbols to symbol list Leaf changes summary: 2 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable 1 Added function: [A] 'function int __traceiter_android_vh_remove_vmalloc_stack(void*, vm_struct*)' 1 Added variable: [A] 'tracepoint __tracepoint_android_vh_remove_vmalloc_stack' Bug: 193384408 Signed-off-by: Peifeng Li Change-Id: I73fed5d8689959d4dc28d811b35570c87ac7336d --- android/abi_gki_aarch64.xml | 85 +++++++++++++++++++++++++++-------- android/abi_gki_aarch64_oplus | 2 + 2 files changed, 68 insertions(+), 19 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index bf6dc0f308a8..671db57b96e6 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -549,6 +549,7 @@ + @@ -6459,6 +6460,7 @@ + @@ -44022,7 +44024,23 @@ - + + + + + + + + + + + + + + + + + @@ -48313,6 +48331,7 @@ + @@ -53196,6 +53215,13 @@ + + + + + + + @@ -65762,6 +65788,13 @@ + + + + + + + @@ -90279,6 +90312,7 @@ + @@ -101920,6 +101954,12 @@ + + + + + + @@ -110156,6 +110196,7 @@ + @@ -118552,6 +118593,11 @@ + + + + + @@ -119742,6 +119788,7 @@ + @@ -122093,9 +122140,9 @@ - - - + + + @@ -122105,14 +122152,14 @@ - - - + + + - - - + + + @@ -123017,9 +123064,9 @@ - - - + + + @@ -123519,14 +123566,14 @@ - - - + + + - - - + + + diff --git a/android/abi_gki_aarch64_oplus b/android/abi_gki_aarch64_oplus index fc00ead539dc..c34ab7b965e0 100644 --- a/android/abi_gki_aarch64_oplus +++ b/android/abi_gki_aarch64_oplus @@ -2856,6 +2856,7 @@ __traceiter_android_vh_rwsem_write_finished __traceiter_android_vh_save_track_hash __traceiter_android_vh_save_vmalloc_stack + __traceiter_android_vh_remove_vmalloc_stack __traceiter_android_vh_sched_stat_runtime_rt __traceiter_android_vh_scheduler_tick __traceiter_android_vh_selinux_avc_insert @@ -3088,6 +3089,7 @@ __tracepoint_android_vh_rwsem_write_finished __tracepoint_android_vh_save_track_hash __tracepoint_android_vh_save_vmalloc_stack + __tracepoint_android_vh_remove_vmalloc_stack __tracepoint_android_vh_sched_stat_runtime_rt __tracepoint_android_vh_scheduler_tick __tracepoint_android_vh_selinux_avc_insert From a3e8b0479685fbd2d584aaafe09ce7670d65cdc5 Mon Sep 17 00:00:00 2001 From: Manaf Meethalavalappu Pallikunhi Date: Mon, 6 Jun 2022 02:10:38 +0530 Subject: [PATCH 25/52] ANDROID: thermal: vendor hook to disable thermal cooling stats Add vendor hook to thermal to allow vendor to selectively disable thermal cooling device stats feature based on requirement. It helps vendor to optimize memory footprint due to this feature especially for low memory devices. Bug: 218825214 Change-Id: I2ec72505f03575e09229c54765584614b16a3904 Signed-off-by: Manaf Meethalavalappu Pallikunhi (cherry picked from commit f6e47fd00f24d5e814d316b03974e970dd87879e) --- drivers/android/vendor_hooks.c | 1 + drivers/thermal/thermal_sysfs.c | 22 +++++++++++++++++++++- include/trace/hooks/thermal.h | 5 +++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 9ba5ee6016cf..2f821f4b7c7e 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -401,6 +401,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_udp_recvmsg); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_tcp_recvmsg_stat); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pci_d3_sleep); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_kmalloc_slab); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_disable_thermal_cooling_stats); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmap_region); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_page_mapcount); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_add_page_to_lrulist); diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index f52708f310e0..3251b27fc5df 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "thermal_core.h" @@ -886,9 +887,22 @@ static struct attribute *cooling_device_stats_attrs[] = { NULL }; +static umode_t cooling_device_stats_is_visible(struct kobject *kobj, + struct attribute *attr, int attrno) +{ + struct thermal_cooling_device *cdev = to_cooling_device( + kobj_to_dev(kobj)); + + if (!cdev->stats) + return 0; + + return attr->mode; +} + static const struct attribute_group cooling_device_stats_attr_group = { .attrs = cooling_device_stats_attrs, - .name = "stats" + .name = "stats", + .is_visible = cooling_device_stats_is_visible, }; static void cooling_device_stats_setup(struct thermal_cooling_device *cdev) @@ -896,6 +910,12 @@ static void cooling_device_stats_setup(struct thermal_cooling_device *cdev) struct cooling_dev_stats *stats; unsigned long states; int var; + bool disable_cdev_stats = false; + + trace_android_vh_disable_thermal_cooling_stats(cdev, + &disable_cdev_stats); + if (disable_cdev_stats) + return; if (cdev->ops->get_max_state(cdev, &states)) return; diff --git a/include/trace/hooks/thermal.h b/include/trace/hooks/thermal.h index 5e61ecd38425..c438ab6ef5b6 100644 --- a/include/trace/hooks/thermal.h +++ b/include/trace/hooks/thermal.h @@ -24,6 +24,11 @@ DECLARE_HOOK(android_vh_thermal_pm_notify_suspend, TP_PROTO(struct thermal_zone_device *tz, int *irq_wakeable), TP_ARGS(tz, irq_wakeable)); +struct thermal_cooling_device; +DECLARE_HOOK(android_vh_disable_thermal_cooling_stats, + TP_PROTO(struct thermal_cooling_device *cdev, bool *disable_stats), + TP_ARGS(cdev, disable_stats)); + #endif /* _TRACE_HOOK_THERMAL_H */ /* This part must be outside protection */ #include From 97e5ac2b5519f70c5e853652762d8ee084ab3280 Mon Sep 17 00:00:00 2001 From: Manaf Meethalavalappu Pallikunhi Date: Mon, 22 Aug 2022 18:18:02 +0530 Subject: [PATCH 26/52] ANDROID: abi_gki_aarch64_qcom: Add android_vh_disable_thermal_cooling_stats Add android_vh_disable_thermal_cooling_stats symbol so that vendor module is able to disable thermal cooling device stats. Leaf changes summary: 1 artifact changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable 1 Added variable: [A] 'tracepoint __tracepoint_android_vh_disable_thermal_cooling_stats' Bug: 218825214 Signed-off-by: Manaf Meethalavalappu Pallikunhi Change-Id: I38e56b2cf9b5bc78ac7ebefe2861d7a8932c09b2 --- android/abi_gki_aarch64.xml | 2 ++ android/abi_gki_aarch64_qcom | 1 + 2 files changed, 3 insertions(+) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 671db57b96e6..be4ae4669da6 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -6362,6 +6362,7 @@ + @@ -119690,6 +119691,7 @@ + diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index 4dedb32d9661..a73748d1b9e4 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -2685,6 +2685,7 @@ __tracepoint_android_vh_cpu_idle_exit __tracepoint_android_vh_cpuidle_psci_enter __tracepoint_android_vh_cpuidle_psci_exit + __tracepoint_android_vh_disable_thermal_cooling_stats __tracepoint_android_vh_dump_throttled_rt_tasks __tracepoint_android_vh_freq_table_limits __tracepoint_android_vh_ftrace_dump_buffer From 3c2f107ad286964b19d2c318b7c942e6f2223eec Mon Sep 17 00:00:00 2001 From: Vijayanand Jitta Date: Thu, 11 Aug 2022 20:05:52 +0530 Subject: [PATCH 27/52] ANDROID: mm: memblock: avoid to create memmap for memblock nomap regions This 'commit 86588296acbf ("fdt: Properly handle "no-map" field in the memory region")' is keeping the no-map regions in memblock.memory with MEMBLOCK_NOMAP flag set to use no-map memory for EFI using memblock api's, but during the initialization sparse_init mark all memblock.memory as present using for_each_mem_pfn_range, which is creating the memmap for no-map memblock regions. Upstream has suggested to make use of bootloader to pass this as not a memory,but because of possibility that some bootloaders might not support this and also due to time constraints in evaluating this approach on 5.10, Use command line parameter as a temporary solution. Get in the appropriate solution later after further discussion with upstream. Add kernel param "android12_only.will_be_removed_soon.memblock_nomap_remove" which when enabled will remove page structs for these regions using memblock_remove. With this change we will be able to save ~11MB memory for ~612MB carve out. android12_only.will_be_removed_soon.memblock_nomap_remove=true: [ 0.000000] memblock_alloc_exact_nid_raw: 115343360 bytes align=0x200000 nid=0 from=0x0000000080000000 max_addr=0x0000000000000000 sparse_buffer_init+0x60/0x8c [ 0.000000] memblock_reserve: [0x0000000932c00000-0x00000009399fffff] memblock_alloc_range_nid+0xbc/0x1a0 [ 0.000000] On node 0 totalpages: 1627824 [ 0.000000] DMA32 zone: 5383 pages used for memmap [ 0.000000] Normal zone: 20052 pages used for memmap Default or android12_only.will_be_removed_soon.memblock_nomap_remove=false: [ 0.000000] memblock_alloc_exact_nid_raw: 117440512 bytes align=0x200000 nid=0 from=0x0000000080000000 max_addr=0x0000000000000000 sparse_buffer_init+0x60/0x8c [ 0.000000] memblock_reserve: [0x0000000932a00000-0x00000009399fffff] memblock_alloc_range_nid+0xbc/0x1a0 [ 0.000000] On node 0 totalpages: 1788416 [ 0.000000] DMA32 zone: 8192 pages used for memmap [ 0.000000] Normal zone: 20052 pages used for memmap. Change-Id: I34a7d46f02a6df7c769af3e53e44e49d6fc515af Bug: 227974747 Link: https://lore.kernel.org/all/20210115172949.GA1495225@robh.at.kernel.org Signed-off-by: Faiyaz Mohammed Signed-off-by: Vijayanand Jitta --- Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ drivers/of/fdt.c | 3 +++ include/linux/memblock.h | 1 + mm/memblock.c | 13 +++++++++++++ 4 files changed, 23 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 858dd038499d..ce9e964d7bfb 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2533,6 +2533,12 @@ memblock=debug [KNL] Enable memblock debug messages. + android12_only.will_be_removed_soon.memblock_nomap_remove= [KNL] + Setting this to true through kernel command line will + call memblock_remove on the regions marked with no-map + property thereby saving memory by removing page structs + for those regions. By default this is set to false. + load_ramdisk= [RAM] [Deprecated] lockd.nlm_grace_period=P [NFS] Assign grace period. diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 74d2bd7a6550..01e14ac13571 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -1181,6 +1181,9 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base, if (memblock_is_region_reserved(base, size)) return -EBUSY; + if (memblock_is_nomap_remove()) + return memblock_remove(base, size); + return memblock_mark_nomap(base, size); } return memblock_reserve(base, size); diff --git a/include/linux/memblock.h b/include/linux/memblock.h index ff08bb433c16..3d2351b43d3b 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -487,6 +487,7 @@ bool memblock_is_map_memory(phys_addr_t addr); bool memblock_is_region_memory(phys_addr_t base, phys_addr_t size); bool memblock_is_reserved(phys_addr_t addr); bool memblock_is_region_reserved(phys_addr_t base, phys_addr_t size); +bool memblock_is_nomap_remove(void); void memblock_dump_all(void); diff --git a/mm/memblock.c b/mm/memblock.c index e0c166463ab4..3b559ce0869b 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -152,6 +152,7 @@ static __refdata struct memblock_type *memblock_memory = &memblock.memory; } while (0) static int memblock_debug __initdata_memblock; +static bool memblock_nomap_remove __initdata_memblock; static bool system_has_some_mirror __initdata_memblock = false; static int memblock_can_resize __initdata_memblock; static int memblock_memory_in_slab __initdata_memblock = 0; @@ -1904,6 +1905,18 @@ static int __init early_memblock(char *p) } early_param("memblock", early_memblock); +static int __init early_memblock_nomap(char *str) +{ + kstrtobool(str, &memblock_nomap_remove); + return 0; +} +early_param("android12_only.will_be_removed_soon.memblock_nomap_remove", early_memblock_nomap); + +bool __init memblock_is_nomap_remove(void) +{ + return memblock_nomap_remove; +} + static void __init __free_pages_memory(unsigned long start, unsigned long end) { int order; From 548da5d23d98b796cf9a478675622a606b3307c8 Mon Sep 17 00:00:00 2001 From: xieliujie Date: Fri, 19 Aug 2022 16:16:25 +0800 Subject: [PATCH 28/52] ANDROID: vendor_hooks: Add hooks for oem futex optimization If an important task is going to sleep through do_futex(), find out it's futex-owner by the pid comes from userspace, and boost the owner by some means to shorten the sleep time. How to boost? Depends on these hooks: 53e809978443 ("ANDROID: vendor_hooks: Add hooks for scheduler") Bug: 243110112 Signed-off-by: xieliujie Change-Id: I9a315cfb414fd34e0ef7a2cf9d57df50d4dd984f --- drivers/android/vendor_hooks.c | 6 ++++++ include/trace/hooks/futex.h | 34 ++++++++++++++++++++++++++++++++++ kernel/futex.c | 7 +++++++ 3 files changed, 47 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 2f821f4b7c7e..1a22772d64f1 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -106,6 +106,12 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_finished); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_rwsem_list_add); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_futex_plist_add); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_futex_sleep_start); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_futex); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_futex_wait_start); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_futex_wait_end); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_futex_wake_traverse_plist); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_futex_wake_this); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_futex_wake_up_q_finish); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_wait_start); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_wait_finish); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rtmutex_wait_start); diff --git a/include/trace/hooks/futex.h b/include/trace/hooks/futex.h index f8bf394ea013..829fe5605b02 100644 --- a/include/trace/hooks/futex.h +++ b/include/trace/hooks/futex.h @@ -8,6 +8,10 @@ #include #include #include +#ifndef __GENKSYMS__ +#include +#endif + /* * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality @@ -22,6 +26,36 @@ DECLARE_HOOK(android_vh_futex_sleep_start, TP_PROTO(struct task_struct *p), TP_ARGS(p)); +DECLARE_HOOK(android_vh_do_futex, + TP_PROTO(int cmd, + unsigned int *flags, + u32 __user *uaddr2), + TP_ARGS(cmd, flags, uaddr2)); + +DECLARE_HOOK(android_vh_futex_wait_start, + TP_PROTO(unsigned int flags, + u32 bitset), + TP_ARGS(flags, bitset)); + +DECLARE_HOOK(android_vh_futex_wait_end, + TP_PROTO(unsigned int flags, + u32 bitset), + TP_ARGS(flags, bitset)); + +DECLARE_HOOK(android_vh_futex_wake_traverse_plist, + TP_PROTO(struct plist_head *chain, int *target_nr, + union futex_key key, u32 bitset), + TP_ARGS(chain, target_nr, key, bitset)); + +DECLARE_HOOK(android_vh_futex_wake_this, + TP_PROTO(int ret, int nr_wake, int target_nr, + struct task_struct *p), + TP_ARGS(ret, nr_wake, target_nr, p)); + +DECLARE_HOOK(android_vh_futex_wake_up_q_finish, + TP_PROTO(int nr_wake, int target_nr), + TP_ARGS(nr_wake, target_nr)); + /* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_FUTEX_H */ diff --git a/kernel/futex.c b/kernel/futex.c index 29bd9cd92468..b223cc525032 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -1594,6 +1594,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) struct futex_q *this, *next; union futex_key key = FUTEX_KEY_INIT; int ret; + int target_nr; DEFINE_WAKE_Q(wake_q); if (!bitset) @@ -1611,6 +1612,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) spin_lock(&hb->lock); + trace_android_vh_futex_wake_traverse_plist(&hb->chain, &target_nr, key, bitset); plist_for_each_entry_safe(this, next, &hb->chain, list) { if (match_futex (&this->key, &key)) { if (this->pi_state || this->rt_waiter) { @@ -1622,6 +1624,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) if (!(this->bitset & bitset)) continue; + trace_android_vh_futex_wake_this(ret, nr_wake, target_nr, this->task); mark_wake_futex(&wake_q, this); if (++ret >= nr_wake) break; @@ -1630,6 +1633,7 @@ futex_wake(u32 __user *uaddr, unsigned int flags, int nr_wake, u32 bitset) spin_unlock(&hb->lock); wake_up_q(&wake_q); + trace_android_vh_futex_wake_up_q_finish(nr_wake, target_nr); return ret; } @@ -2699,6 +2703,7 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, if (!bitset) return -EINVAL; q.bitset = bitset; + trace_android_vh_futex_wait_start(flags, bitset); to = futex_setup_timer(abs_time, &timeout, flags, current->timer_slack_ns); @@ -2748,6 +2753,7 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, hrtimer_cancel(&to->timer); destroy_hrtimer_on_stack(&to->timer); } + trace_android_vh_futex_wait_end(flags, bitset); return ret; } @@ -3733,6 +3739,7 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, return -ENOSYS; } + trace_android_vh_do_futex(cmd, &flags, uaddr2); switch (cmd) { case FUTEX_WAIT: val3 = FUTEX_BITSET_MATCH_ANY; From 9ecb2fcca3b3e2e38423f6eda468b05ee04614ff Mon Sep 17 00:00:00 2001 From: Peifeng Li Date: Mon, 22 Aug 2022 18:21:29 +0800 Subject: [PATCH 29/52] ANDROID: avoid huge-page not to clear trylock-bit after shrink_page_list. Clearing trylock-bit of page shrinked by shrnk_page_list in advance which avoids huge-page not to clear trylock-bit after shrink_page_list. Fixes: 1f8f6d59a298 ("ANDROID: vendor_hook: Add hook to not be stuck ro rmap lock in kswapd or direct_reclaim") Bug: 240003372 Signed-off-by: Peifeng Li Change-Id: Iac4d60ec3497d9bb7ba1f001a5c08a604daf4f5a --- mm/vmscan.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 0f82957c4de7..e3a885f6a1b5 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1490,12 +1490,11 @@ static unsigned int shrink_page_list(struct list_head *page_list, * Is there need to periodically free_page_list? It would * appear not as the counts should be low */ + trace_android_vh_page_trylock_clear(page); if (unlikely(PageTransHuge(page))) destroy_compound_page(page); - else { - trace_android_vh_page_trylock_clear(page); + else list_add(&page->lru, &free_pages); - } continue; activate_locked_split: From 568ee90a7ec5c8670edd71a98f85a264d9fdc308 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 24 Aug 2022 12:54:36 +0200 Subject: [PATCH 30/52] ANDROID: fix execute bit on android/abi_gki_aarch64_asus The file android/abi_gki_aarch64_asus should not have execute permissions set on it, so fix that up. Fixes: 428d0bb76207 ("ANDROID: Add initial ASUS symbol list") Signed-off-by: Greg Kroah-Hartman Change-Id: I96b96ed6a93e4aa13de07e1f225de79a78a30867 --- android/abi_gki_aarch64_asus | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 android/abi_gki_aarch64_asus diff --git a/android/abi_gki_aarch64_asus b/android/abi_gki_aarch64_asus old mode 100755 new mode 100644 From 486580ffb5aae2b4e7b277ba2576ecd54d0076f7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 24 Aug 2022 16:45:58 +0200 Subject: [PATCH 31/52] Revert "ANDROID: vendor_hooks: Add hooks for mutex" This reverts commit 8c3ac02bcaf8c2167ad5acd18e6a3c23de361763. The hook android_vh_mutex_start_check_new_owner is not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 231647361 Cc: Liujie Xie Signed-off-by: Greg Kroah-Hartman Change-Id: I8c3bf787525d684f64b8d0654d379df78eb7b69e --- drivers/android/vendor_hooks.c | 1 - include/trace/hooks/dtask.h | 4 +--- kernel/locking/mutex.c | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 1a22772d64f1..5b48337b53a1 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -249,7 +249,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_build_sched_domains); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_mutex_list_add); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_unlock_slowpath); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_unlock_slowpath_end); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_start_check_new_owner); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake_finish); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_undefinstr); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_ptrauth_fault); diff --git a/include/trace/hooks/dtask.h b/include/trace/hooks/dtask.h index fcf0ea550455..208edf8ac265 100644 --- a/include/trace/hooks/dtask.h +++ b/include/trace/hooks/dtask.h @@ -68,9 +68,6 @@ DECLARE_HOOK(android_vh_mutex_unlock_slowpath, DECLARE_HOOK(android_vh_mutex_unlock_slowpath_end, TP_PROTO(struct mutex *lock, struct task_struct *next), TP_ARGS(lock, next)); -DECLARE_HOOK(android_vh_mutex_start_check_new_owner, - TP_PROTO(struct mutex *lock), - TP_ARGS(lock)); DECLARE_HOOK(android_vh_record_mutex_lock_starttime, TP_PROTO(struct task_struct *tsk, unsigned long settime_jiffies), TP_ARGS(tsk, settime_jiffies)); @@ -83,6 +80,7 @@ DECLARE_HOOK(android_vh_record_rwsem_lock_starttime, DECLARE_HOOK(android_vh_record_percpu_rwsem_lock_starttime, TP_PROTO(struct task_struct *tsk, unsigned long settime_jiffies), TP_ARGS(tsk, settime_jiffies)); + /* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_DTASK_H */ diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c index 4fa524e21420..93020a888b09 100644 --- a/kernel/locking/mutex.c +++ b/kernel/locking/mutex.c @@ -1053,7 +1053,6 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, goto err; } - trace_android_vh_mutex_start_check_new_owner(lock); spin_unlock(&lock->wait_lock); schedule_preempt_disabled(); From 98e5fb34d1137987cb2551d79082dc4c794795d4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 24 Aug 2022 17:06:03 +0200 Subject: [PATCH 32/52] Revert "ANDROID: add for tuning readahead size" This reverts commit f06daa5a0bc6c8b524b53671fce40e0a14c4f9af. The hook android_vh_ra_tuning_max_page is not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 229839032 Cc: liang zhang Signed-off-by: Greg Kroah-Hartman Change-Id: Id9211dfd9e1fa19d2ccb14302c60f0d55579f59d --- drivers/android/vendor_hooks.c | 1 - include/trace/hooks/mm.h | 3 --- mm/readahead.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 5b48337b53a1..a678c2fe440a 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -428,7 +428,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_has_work_ilocked); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_read_done); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_tlb_conf); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_node_memcgs); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ra_tuning_max_page); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_memcg_scan_type); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_pte_fault_end); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cow_user_page); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 8b0225ce7ced..8a95d32a0706 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -189,9 +189,6 @@ DECLARE_HOOK(android_vh_pcplist_add_cma_pages_bypass, DECLARE_HOOK(android_vh_subpage_dma_contig_alloc, TP_PROTO(bool *allow_subpage_alloc, struct device *dev, size_t *size), TP_ARGS(allow_subpage_alloc, dev, size)); -DECLARE_HOOK(android_vh_ra_tuning_max_page, - TP_PROTO(struct readahead_control *ractl, unsigned long *max_page), - TP_ARGS(ractl, max_page)); DECLARE_HOOK(android_vh_handle_pte_fault_end, TP_PROTO(struct vm_fault *vmf, unsigned long highest_memmap_pfn), TP_ARGS(vmf, highest_memmap_pfn)); diff --git a/mm/readahead.c b/mm/readahead.c index a95364c99487..a6bfa987a04a 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -459,8 +459,6 @@ static void ondemand_readahead(struct readahead_control *ractl, if (req_size > max_pages && bdi->io_pages > max_pages) max_pages = min(req_size, bdi->io_pages); - trace_android_vh_ra_tuning_max_page(ractl, &max_pages); - /* * start of file */ From 84a0d243b608b3373ef701c20a64353269d69e46 Mon Sep 17 00:00:00 2001 From: Patrick Daly Date: Mon, 22 Aug 2022 18:00:51 -0700 Subject: [PATCH 33/52] ANDROID: mm/memory_hotplug: Fix error path handling Correct a resource leak if arch_add_memory() returns failure. Bug: 243477359 Change-Id: I1dce82a18c2242d7b6fd9fb1fe3a8b2ba67853de Fixes: 417ac617ea5e ("ANDROID: mm/memory_hotplug: implement {add/remove}_memory_subsection") Signed-off-by: Patrick Daly Signed-off-by: Chris Goldsworthy --- mm/memory_hotplug.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 6702c1114ced..9176bae95c9a 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1156,14 +1156,22 @@ int add_memory_subsection(int nid, u64 start, u64 size) ret = arch_add_memory(nid, start, size, ¶ms); if (ret) { - if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) - memblock_remove(start, size); pr_err("%s failed to add subsection start 0x%llx size 0x%llx\n", __func__, start, size); + goto err_add_memory; } mem_hotplug_done(); return ret; + +err_add_memory: + if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) + memblock_remove(start, size); + + mem_hotplug_done(); + + release_memory_resource(res); + return ret; } EXPORT_SYMBOL_GPL(add_memory_subsection); From 425c0f18edf16231aa87cfdebbd9f03e0628533c Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Wed, 24 Aug 2022 08:51:27 -0700 Subject: [PATCH 34/52] ANDROID: Fix a build warning inside early_memblock_nomap Fix a warning caused by ignoring the return value of kstrtobool: mm/memblock.c: In function 'early_memblock_nomap': >> mm/memblock.c:1910:9: warning: ignoring return value of 'kstrtobool' declared with attribute 'warn_unused_result' [-Wunused-result] 1910 | kstrtobool(str, &memblock_nomap_remove); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 3c2f107ad286 ("ANDROID: mm: memblock: avoid to create memmap for memblock nomap regions") Bug: 227974747 Reported-by: kernel test robot Signed-off-by: Suren Baghdasaryan Change-Id: I9cc1145492e47a6604b8204165058d8617c0aaaa --- mm/memblock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index 3b559ce0869b..961c596b0afd 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1907,8 +1907,7 @@ early_param("memblock", early_memblock); static int __init early_memblock_nomap(char *str) { - kstrtobool(str, &memblock_nomap_remove); - return 0; + return kstrtobool(str, &memblock_nomap_remove); } early_param("android12_only.will_be_removed_soon.memblock_nomap_remove", early_memblock_nomap); From 7b0822a26142ade7be8629cfbe41f5ad206ffb64 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 24 Aug 2022 18:50:06 +0200 Subject: [PATCH 35/52] Revert "ANDROID: vendor_hooks: tune reclaim scan type for specified mem_cgroup" This reverts commit e5b4949bfc066d34876ce94725fe1355ce62d4c1. The hook android_vh_tune_memcg_scan_type is not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 230450931 Cc: xiaofeng Signed-off-by: Greg Kroah-Hartman Change-Id: I0e32c24d67a9ede087eca5005796512a9451c1e2 --- drivers/android/vendor_hooks.c | 1 - include/trace/hooks/vmscan.h | 3 --- mm/vmscan.c | 1 - 3 files changed, 5 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index a678c2fe440a..c05568506b7b 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -428,7 +428,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_has_work_ilocked); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_read_done); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_tlb_conf); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_node_memcgs); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_memcg_scan_type); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_pte_fault_end); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cow_user_page); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_swapin_add_anon_rmap); diff --git a/include/trace/hooks/vmscan.h b/include/trace/hooks/vmscan.h index a175232c89f6..ab54c20fef62 100644 --- a/include/trace/hooks/vmscan.h +++ b/include/trace/hooks/vmscan.h @@ -43,9 +43,6 @@ DECLARE_HOOK(android_vh_page_trylock_clear, DECLARE_HOOK(android_vh_shrink_node_memcgs, TP_PROTO(struct mem_cgroup *memcg, bool *skip), TP_ARGS(memcg, skip)); -DECLARE_HOOK(android_vh_tune_memcg_scan_type, - TP_PROTO(struct mem_cgroup *memcg, char *scan_type), - TP_ARGS(memcg, scan_type)); DECLARE_HOOK(android_vh_inactive_is_low, TP_PROTO(unsigned long gb, unsigned long *inactive_ratio, enum lru_list inactive_lru, bool *skip), diff --git a/mm/vmscan.c b/mm/vmscan.c index e3a885f6a1b5..2979893b9cf5 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2397,7 +2397,6 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, denominator = ap + fp; out: trace_android_vh_tune_scan_type((char *)(&scan_balance)); - trace_android_vh_tune_memcg_scan_type(memcg, (char *)(&scan_balance)); for_each_evictable_lru(lru) { int file = is_file_lru(lru); unsigned long lruvec_size; From 3f90d4f1f33a84e4cac2cee2603a868f25db6d4e Mon Sep 17 00:00:00 2001 From: Liujie Xie Date: Wed, 24 Aug 2022 10:05:21 +0800 Subject: [PATCH 36/52] ANDROID: GKI: Update symbol list Leaf changes summary: 12 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 6 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 6 Added variables 6 Added functions: [A] 'function int __traceiter_android_vh_do_futex(void*, int, unsigned int*, u32*)' [A] 'function int __traceiter_android_vh_futex_wait_end(void*, unsigned int, u32)' [A] 'function int __traceiter_android_vh_futex_wait_start(void*, unsigned int, u32)' [A] 'function int __traceiter_android_vh_futex_wake_this(void*, int, int, int, task_struct*)' [A] 'function int __traceiter_android_vh_futex_wake_traverse_plist(void*, plist_head*, int*, futex_key, u32)' [A] 'function int __traceiter_android_vh_futex_wake_up_q_finish(void*, int, int)' 6 Added variables: [A] 'tracepoint __tracepoint_android_vh_do_futex' [A] 'tracepoint __tracepoint_android_vh_futex_wait_end' [A] 'tracepoint __tracepoint_android_vh_futex_wait_start' [A] 'tracepoint __tracepoint_android_vh_futex_wake_this' [A] 'tracepoint __tracepoint_android_vh_futex_wake_traverse_plist' [A] 'tracepoint __tracepoint_android_vh_futex_wake_up_q_finish' Bug: 193384408 Signed-off-by: Liujie Xie Change-Id: I959da586aa55da589be60aa219f6adbd959930e5 --- android/abi_gki_aarch64.xml | 180 ++++++++++++++++++++++++---------- android/abi_gki_aarch64_oplus | 12 +++ 2 files changed, 138 insertions(+), 54 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index be4ae4669da6..9c7f28bd1838 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -457,6 +457,7 @@ + @@ -487,6 +488,11 @@ + + + + + @@ -6363,6 +6369,7 @@ + @@ -6394,6 +6401,11 @@ + + + + + @@ -11255,6 +11267,17 @@ + + + + + + + + + + + @@ -22679,6 +22702,17 @@ + + + + + + + + + + + @@ -44025,23 +44059,7 @@ - - - - - - - - - - - - - - - - - + @@ -48332,7 +48350,6 @@ - @@ -53216,13 +53233,6 @@ - - - - - - - @@ -57417,6 +57427,14 @@ + + + + + + + + @@ -65789,13 +65807,6 @@ - - - - - - - @@ -77035,6 +77046,17 @@ + + + + + + + + + + + @@ -90313,7 +90335,6 @@ - @@ -91986,6 +92007,17 @@ + + + + + + + + + + + @@ -101955,12 +101987,6 @@ - - - - - - @@ -110197,7 +110223,6 @@ - @@ -117652,11 +117677,11 @@ - - - - - + + + + + @@ -118016,6 +118041,13 @@ + + + + + + + @@ -118204,9 +118236,43 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -119636,7 +119702,7 @@ - + @@ -119692,6 +119758,7 @@ + @@ -119722,7 +119789,12 @@ - + + + + + + @@ -134313,12 +134385,12 @@ - + - - - + + + diff --git a/android/abi_gki_aarch64_oplus b/android/abi_gki_aarch64_oplus index c34ab7b965e0..a8d958385dfc 100644 --- a/android/abi_gki_aarch64_oplus +++ b/android/abi_gki_aarch64_oplus @@ -2783,6 +2783,7 @@ __traceiter_android_vh_cpu_idle_enter __traceiter_android_vh_cpu_idle_exit __traceiter_android_vh_cpu_up + __traceiter_android_vh_do_futex __traceiter_android_vh_do_send_sig_info __traceiter_android_vh_drain_all_pages_bypass __traceiter_android_vh_em_cpu_energy @@ -2797,6 +2798,11 @@ __traceiter_android_vh_ftrace_oops_exit __traceiter_android_vh_ftrace_size_check __traceiter_android_vh_futex_sleep_start + __traceiter_android_vh_futex_wait_end + __traceiter_android_vh_futex_wait_start + __traceiter_android_vh_futex_wake_this + __traceiter_android_vh_futex_wake_traverse_plist + __traceiter_android_vh_futex_wake_up_q_finish __traceiter_android_vh_get_from_fragment_pool __traceiter_android_vh_gpio_block_read __traceiter_android_vh_handle_failed_page_trylock @@ -3016,6 +3022,7 @@ __tracepoint_android_vh_cpu_idle_enter __tracepoint_android_vh_cpu_idle_exit __tracepoint_android_vh_cpu_up + __tracepoint_android_vh_do_futex __tracepoint_android_vh_do_send_sig_info __tracepoint_android_vh_drain_all_pages_bypass __tracepoint_android_vh_em_cpu_energy @@ -3030,6 +3037,11 @@ __tracepoint_android_vh_ftrace_oops_exit __tracepoint_android_vh_ftrace_size_check __tracepoint_android_vh_futex_sleep_start + __tracepoint_android_vh_futex_wait_end + __tracepoint_android_vh_futex_wait_start + __tracepoint_android_vh_futex_wake_this + __tracepoint_android_vh_futex_wake_traverse_plist + __tracepoint_android_vh_futex_wake_up_q_finish __tracepoint_android_vh_get_from_fragment_pool __tracepoint_android_vh_gpio_block_read __tracepoint_android_vh_handle_failed_page_trylock From bc08447eb7bd3f98c5847c37a154045657b8a623 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Wed, 24 Aug 2022 15:37:22 +0800 Subject: [PATCH 37/52] ANDROID: GKI: rockchip: add symbol netif_set_xps_queue Leaf changes summary: 1 artifact changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 1 Added function: [A] 'function int netif_set_xps_queue(net_device*, const cpumask*, u16)' Bug: 239396464 Signed-off-by: Kever Yang Change-Id: I964f408c1780ad8aeaa7333dc1aa29f5f23adce8 --- android/abi_gki_aarch64.xml | 7 +++++++ android/abi_gki_aarch64_rockchip | 3 +++ 2 files changed, 10 insertions(+) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 9c7f28bd1838..098fda915835 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -3657,6 +3657,7 @@ + @@ -135429,6 +135430,12 @@ + + + + + + diff --git a/android/abi_gki_aarch64_rockchip b/android/abi_gki_aarch64_rockchip index 3cf7478b5d90..5f59918af934 100644 --- a/android/abi_gki_aarch64_rockchip +++ b/android/abi_gki_aarch64_rockchip @@ -1400,6 +1400,9 @@ mmc_sw_reset mmc_wait_for_req netdev_update_features + netif_napi_add + __netif_napi_del + netif_set_xps_queue __netlink_kernel_create netlink_kernel_release nla_append From dec2f52d08d2d5b36fffafd489457ce4ac1c530e Mon Sep 17 00:00:00 2001 From: xiaofeng Date: Wed, 24 Aug 2022 19:34:06 +0800 Subject: [PATCH 38/52] ANDROID: vendor_hooks:vendor hook for __alloc_pages_slowpath. add vendor hook in __alloc_pages_slowpath ahead of __alloc_pages_direct_reclaim and warn_alloc. Bug: 243629905 Change-Id: Ieacc6cf79823c0bfacfdeec9afb55ed66f40d0b0 Signed-off-by: xiaofeng (cherry picked from commit 0312e9cd22b100a088ff64ab36b2db2eb9f28b7c) --- drivers/android/vendor_hooks.c | 2 ++ include/trace/hooks/mm.h | 8 ++++++++ mm/page_alloc.c | 11 +++++++++++ 3 files changed, 21 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index c05568506b7b..7a1ffec55caf 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -453,3 +453,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_reclaim_bypass); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_failure_bypass); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 8a95d32a0706..19a04b1aa4ff 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -260,6 +260,14 @@ DECLARE_HOOK(android_vh_set_shmem_page_flag, DECLARE_HOOK(android_vh_remove_vmalloc_stack, TP_PROTO(struct vm_struct *vm), TP_ARGS(vm)); +DECLARE_HOOK(android_vh_alloc_pages_reclaim_bypass, + TP_PROTO(gfp_t gfp_mask, int order, int alloc_flags, + int migratetype, struct page **page), + TP_ARGS(gfp_mask, order, alloc_flags, migratetype, page)); +DECLARE_HOOK(android_vh_alloc_pages_failure_bypass, + TP_PROTO(gfp_t gfp_mask, int order, int alloc_flags, + int migratetype, struct page **page), + TP_ARGS(gfp_mask, order, alloc_flags, migratetype, page)); /* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_MM_H */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d2b7eca3a2bf..4696696a9b19 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4924,6 +4924,12 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, if (current->flags & PF_MEMALLOC) goto nopage; + trace_android_vh_alloc_pages_reclaim_bypass(gfp_mask, order, + alloc_flags, ac->migratetype, &page); + + if (page) + goto got_pg; + /* Try direct reclaim and then allocating */ page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, ac, &did_some_progress); @@ -5031,6 +5037,11 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, goto retry; } fail: + trace_android_vh_alloc_pages_failure_bypass(gfp_mask, order, + alloc_flags, ac->migratetype, &page); + if (page) + goto got_pg; + warn_alloc(gfp_mask, ac->nodemask, "page allocation failure: order:%u", order); got_pg: From 2b3f9b8187de1603b5f5a23856ea7799a862e82f Mon Sep 17 00:00:00 2001 From: Charan Teja Kalla Date: Thu, 18 Aug 2022 19:20:00 +0530 Subject: [PATCH 39/52] FROMLIST: mm: fix use-after free of page_ext after race with memory-offline The below is one path where race between page_ext and offline of the respective memory blocks will cause use-after-free on the access of page_ext structure. process1 process2 --------- --------- a)doing /proc/page_owner doing memory offline through offline_pages. b)PageBuddy check is failed thus proceed to get the page_owner information through page_ext access. page_ext = lookup_page_ext(page); migrate_pages(); ................. Since all pages are successfully migrated as part of the offline operation,send MEM_OFFLINE notification where for page_ext it calls: offline_page_ext()--> __free_page_ext()--> free_page_ext()--> vfree(ms->page_ext) mem_section->page_ext = NULL c) Check for the PAGE_EXT flags in the page_ext->flags access results into the use-after-free(leading to the translation faults). As mentioned above, there is really no synchronization between page_ext access and its freeing in the memory_offline. The memory offline steps(roughly) on a memory block is as below: 1) Isolate all the pages 2) while(1) try free the pages to buddy.(->free_list[MIGRATE_ISOLATE]) 3) delete the pages from this buddy list. 4) Then free page_ext.(Note: The struct page is still alive as it is freed only during hot remove of the memory which frees the memmap, which steps the user might not perform). This design leads to the state where struct page is alive but the struct page_ext is freed, where the later is ideally part of the former which just representing the page_flags (check [3] for why this design is chosen). The above mentioned race is just one example __but the problem persists in the other paths too involving page_ext->flags access(eg: page_is_idle())__. Fix all the paths where offline races with page_ext access by maintaining synchronization with rcu lock and is achieved in 3 steps: 1) Invalidate all the page_ext's of the sections of a memory block by storing a flag in the LSB of mem_section->page_ext. 2) Wait till all the existing readers to finish working with the ->page_ext's with synchronize_rcu(). Any parallel process that starts after this call will not get page_ext, through lookup_page_ext(), for the block parallel offline operation is being performed. 3) Now safely free all sections ->page_ext's of the block on which offline operation is being performed. Note: If synchronize_rcu() takes time then optimizations can be done in this path through call_rcu()[2]. Thanks to David Hildenbrand for his views/suggestions on the initial discussion[1] and Pavan kondeti for various inputs on this patch. [1] https://lore.kernel.org/linux-mm/59edde13-4167-8550-86f0-11fc67882107@quicinc.com/ [2] https://lore.kernel.org/all/a26ce299-aed1-b8ad-711e-a49e82bdd180@quicinc.com/T/#u [3] https://lore.kernel.org/all/6fa6b7aa-731e-891c-3efb-a03d6a700efa@redhat.com/ Bug: 236222283 Link: https://lore.kernel.org/all/1661496993-11473-1-git-send-email-quic_charante@quicinc.com/ Change-Id: Ib439ae19c61a557a5c70ea90e3c4b35a5583ba0d Suggested-by: David Hildenbrand Suggested-by: Michal Hocko Signed-off-by: Charan Teja Kalla (fixed merge conflicts and still exported lookup_page_ext) --- include/linux/page_ext.h | 17 ++++--- include/linux/page_idle.h | 33 +++++++++---- mm/page_ext.c | 100 ++++++++++++++++++++++++++++++++++++-- mm/page_owner.c | 73 ++++++++++++++++++++-------- 4 files changed, 183 insertions(+), 40 deletions(-) diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h index 8e58a1b73771..67df1c51a84c 100644 --- a/include/linux/page_ext.h +++ b/include/linux/page_ext.h @@ -56,8 +56,9 @@ static inline void page_ext_init(void) { } #endif - struct page_ext *lookup_page_ext(const struct page *page); +extern struct page_ext *page_ext_get(struct page *page); +extern void page_ext_put(struct page_ext *page_ext); static inline struct page_ext *page_ext_next(struct page_ext *curr) { @@ -73,11 +74,6 @@ static inline void pgdat_page_ext_init(struct pglist_data *pgdat) { } -static inline struct page_ext *lookup_page_ext(const struct page *page) -{ - return NULL; -} - static inline void page_ext_init(void) { } @@ -85,5 +81,14 @@ static inline void page_ext_init(void) static inline void page_ext_init_flatmem(void) { } + +static inline struct page_ext *page_ext_get(struct page *page) +{ + return NULL; +} + +static inline void page_ext_put(struct page_ext *page_ext) +{ +} #endif /* CONFIG_PAGE_EXTENSION */ #endif /* __LINUX_PAGE_EXT_H */ diff --git a/include/linux/page_idle.h b/include/linux/page_idle.h index d8a6aecf99cb..2a21c793d815 100644 --- a/include/linux/page_idle.h +++ b/include/linux/page_idle.h @@ -47,62 +47,77 @@ extern struct page_ext_operations page_idle_ops; static inline bool page_is_young(struct page *page) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); + bool page_young; if (unlikely(!page_ext)) return false; - return test_bit(PAGE_EXT_YOUNG, &page_ext->flags); + page_young = test_bit(PAGE_EXT_YOUNG, &page_ext->flags); + page_ext_put(page_ext); + + return page_young; } static inline void set_page_young(struct page *page) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); if (unlikely(!page_ext)) return; set_bit(PAGE_EXT_YOUNG, &page_ext->flags); + page_ext_put(page_ext); } static inline bool test_and_clear_page_young(struct page *page) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); + bool page_young; if (unlikely(!page_ext)) return false; - return test_and_clear_bit(PAGE_EXT_YOUNG, &page_ext->flags); + page_young = test_and_clear_bit(PAGE_EXT_YOUNG, &page_ext->flags); + page_ext_put(page_ext); + + return page_young; } static inline bool page_is_idle(struct page *page) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); + bool page_idle; if (unlikely(!page_ext)) return false; - return test_bit(PAGE_EXT_IDLE, &page_ext->flags); + page_idle = test_bit(PAGE_EXT_IDLE, &page_ext->flags); + page_ext_put(page_ext); + + return page_idle; } static inline void set_page_idle(struct page *page) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); if (unlikely(!page_ext)) return; set_bit(PAGE_EXT_IDLE, &page_ext->flags); + page_ext_put(page_ext); } static inline void clear_page_idle(struct page *page) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); if (unlikely(!page_ext)) return; clear_bit(PAGE_EXT_IDLE, &page_ext->flags); + page_ext_put(page_ext); } #endif /* CONFIG_64BIT */ diff --git a/mm/page_ext.c b/mm/page_ext.c index e5e31ff1adba..e5b56394e2b4 100644 --- a/mm/page_ext.c +++ b/mm/page_ext.c @@ -8,7 +8,7 @@ #include #include #include - +#include /* * struct page extension * @@ -58,6 +58,10 @@ * can utilize this callback to initialize the state of it correctly. */ +#ifdef CONFIG_SPARSEMEM +#define PAGE_EXT_INVALID (0x1) +#endif + #if defined(CONFIG_PAGE_IDLE_FLAG) && !defined(CONFIG_64BIT) static bool need_page_idle(void) { @@ -117,6 +121,49 @@ static inline struct page_ext *get_entry(void *base, unsigned long index) return base + page_ext_size * index; } +/** + * page_ext_get() - Get the extended information for a page. + * @page: The page we're interested in. + * + * Ensures that the page_ext will remain valid until page_ext_put() + * is called. + * + * Return: NULL if no page_ext exists for this page. + * Context: Any context. Caller may not sleep until they have called + * page_ext_put(). + */ +struct page_ext *page_ext_get(struct page *page) +{ + struct page_ext *page_ext; + + rcu_read_lock(); + page_ext = lookup_page_ext(page); + if (!page_ext) { + rcu_read_unlock(); + return NULL; + } + + return page_ext; +} + +/** + * page_ext_put() - Working with page extended information is done. + * @page_ext - Page extended information received from page_ext_get(). + * + * The page extended information of the page may not be valid after this + * function is called. + * + * Return: None. + * Context: Any context with corresponding page_ext_get() is called. + */ +void page_ext_put(struct page_ext *page_ext) +{ + if (unlikely(!page_ext)) + return; + + rcu_read_unlock(); +} + #if !defined(CONFIG_SPARSEMEM) @@ -131,6 +178,7 @@ struct page_ext *lookup_page_ext(const struct page *page) unsigned long index; struct page_ext *base; + WARN_ON_ONCE(!rcu_read_lock_held()); base = NODE_DATA(page_to_nid(page))->node_page_ext; /* * The sanity checks the page allocator does upon freeing a @@ -200,20 +248,27 @@ void __init page_ext_init_flatmem(void) } #else /* CONFIG_FLAT_NODE_MEM_MAP */ +static bool page_ext_invalid(struct page_ext *page_ext) +{ + return !page_ext || (((unsigned long)page_ext & PAGE_EXT_INVALID) == PAGE_EXT_INVALID); +} struct page_ext *lookup_page_ext(const struct page *page) { unsigned long pfn = page_to_pfn(page); struct mem_section *section = __pfn_to_section(pfn); + struct page_ext *page_ext = READ_ONCE(section->page_ext); + + WARN_ON_ONCE(!rcu_read_lock_held()); /* * The sanity checks the page allocator does upon freeing a * page can reach here before the page_ext arrays are * allocated when feeding a range of pages to the allocator * for the first time during bootup or memory hotplug. */ - if (!section->page_ext) + if (page_ext_invalid(page_ext)) return NULL; - return get_entry(section->page_ext, pfn); + return get_entry(page_ext, pfn); } EXPORT_SYMBOL_GPL(lookup_page_ext); @@ -293,9 +348,30 @@ static void __free_page_ext(unsigned long pfn) ms = __pfn_to_section(pfn); if (!ms || !ms->page_ext) return; - base = get_entry(ms->page_ext, pfn); + + base = READ_ONCE(ms->page_ext); + /* + * page_ext here can be valid while doing the roll back + * operation in online_page_ext(). + */ + if (page_ext_invalid(base)) + base = (void *)base - PAGE_EXT_INVALID; + WRITE_ONCE(ms->page_ext, NULL); + + base = get_entry(base, pfn); free_page_ext(base); - ms->page_ext = NULL; +} + +static void __invalidate_page_ext(unsigned long pfn) +{ + struct mem_section *ms; + void *val; + + ms = __pfn_to_section(pfn); + if (!ms || !ms->page_ext) + return; + val = (void *)ms->page_ext + PAGE_EXT_INVALID; + WRITE_ONCE(ms->page_ext, val); } static int __meminit online_page_ext(unsigned long start_pfn, @@ -338,6 +414,20 @@ static int __meminit offline_page_ext(unsigned long start_pfn, start = SECTION_ALIGN_DOWN(start_pfn); end = SECTION_ALIGN_UP(start_pfn + nr_pages); + /* + * Freeing of page_ext is done in 3 steps to avoid + * use-after-free of it: + * 1) Traverse all the sections and mark their page_ext + * as invalid. + * 2) Wait for all the existing users of page_ext who + * started before invalidation to finish. + * 3) Free the page_ext. + */ + for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) + __invalidate_page_ext(pfn); + + synchronize_rcu(); + for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) __free_page_ext(pfn); return 0; diff --git a/mm/page_owner.c b/mm/page_owner.c index 9501940a3ccd..8dd3f27db21a 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -173,7 +173,7 @@ void __reset_page_owner(struct page *page, unsigned int order) handle = save_stack(GFP_NOWAIT | __GFP_NOWARN); - page_ext = lookup_page_ext(page); + page_ext = page_ext_get(page); if (unlikely(!page_ext)) return; for (i = 0; i < (1 << order); i++) { @@ -183,6 +183,7 @@ void __reset_page_owner(struct page *page, unsigned int order) page_owner->free_ts_nsec = free_ts_nsec; page_ext = page_ext_next(page_ext); } + page_ext_put(page_ext); } static inline void __set_page_owner_handle(struct page *page, @@ -210,19 +211,21 @@ static inline void __set_page_owner_handle(struct page *page, noinline void __set_page_owner(struct page *page, unsigned int order, gfp_t gfp_mask) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext; depot_stack_handle_t handle; + handle = save_stack(gfp_mask); + + page_ext = page_ext_get(page); if (unlikely(!page_ext)) return; - - handle = save_stack(gfp_mask); __set_page_owner_handle(page, page_ext, handle, order, gfp_mask); + page_ext_put(page_ext); } void __set_page_owner_migrate_reason(struct page *page, int reason) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); struct page_owner *page_owner; if (unlikely(!page_ext)) @@ -230,12 +233,13 @@ void __set_page_owner_migrate_reason(struct page *page, int reason) page_owner = get_page_owner(page_ext); page_owner->last_migrate_reason = reason; + page_ext_put(page_ext); } void __split_page_owner(struct page *page, unsigned int nr) { int i; - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); struct page_owner *page_owner; if (unlikely(!page_ext)) @@ -246,17 +250,25 @@ void __split_page_owner(struct page *page, unsigned int nr) page_owner->order = 0; page_ext = page_ext_next(page_ext); } + page_ext_put(page_ext); } void __copy_page_owner(struct page *oldpage, struct page *newpage) { - struct page_ext *old_ext = lookup_page_ext(oldpage); - struct page_ext *new_ext = lookup_page_ext(newpage); + struct page_ext *old_ext; + struct page_ext *new_ext; struct page_owner *old_page_owner, *new_page_owner; - if (unlikely(!old_ext || !new_ext)) + old_ext = page_ext_get(oldpage); + if (unlikely(!old_ext)) return; + new_ext = page_ext_get(newpage); + if (unlikely(!new_ext)) { + page_ext_put(old_ext); + return; + } + old_page_owner = get_page_owner(old_ext); new_page_owner = get_page_owner(new_ext); new_page_owner->order = old_page_owner->order; @@ -279,6 +291,8 @@ void __copy_page_owner(struct page *oldpage, struct page *newpage) */ __set_bit(PAGE_EXT_OWNER, &new_ext->flags); __set_bit(PAGE_EXT_OWNER_ALLOCATED, &new_ext->flags); + page_ext_put(new_ext); + page_ext_put(old_ext); } void pagetypeinfo_showmixedcount_print(struct seq_file *m, @@ -335,12 +349,12 @@ void pagetypeinfo_showmixedcount_print(struct seq_file *m, if (PageReserved(page)) continue; - page_ext = lookup_page_ext(page); + page_ext = page_ext_get(page); if (unlikely(!page_ext)) continue; if (!test_bit(PAGE_EXT_OWNER_ALLOCATED, &page_ext->flags)) - continue; + goto ext_put_continue; page_owner = get_page_owner(page_ext); page_mt = gfp_migratetype(page_owner->gfp_mask); @@ -351,9 +365,12 @@ void pagetypeinfo_showmixedcount_print(struct seq_file *m, count[pageblock_mt]++; pfn = block_end_pfn; + page_ext_put(page_ext); break; } pfn += (1UL << page_owner->order) - 1; +ext_put_continue: + page_ext_put(page_ext); } } @@ -432,7 +449,7 @@ print_page_owner(char __user *buf, size_t count, unsigned long pfn, void __dump_page_owner(struct page *page) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get((void *)page); struct page_owner *page_owner; depot_stack_handle_t handle; unsigned long *entries; @@ -451,6 +468,7 @@ void __dump_page_owner(struct page *page) if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags)) { pr_alert("page_owner info is not present (never set?)\n"); + page_ext_put(page_ext); return; } @@ -483,6 +501,7 @@ void __dump_page_owner(struct page *page) if (page_owner->last_migrate_reason != -1) pr_alert("page has been migrated, last migrate reason: %s\n", migrate_reason_names[page_owner->last_migrate_reason]); + page_ext_put(page_ext); } static ssize_t @@ -508,6 +527,14 @@ read_page_owner(struct file *file, char __user *buf, size_t count, loff_t *ppos) /* Find an allocated page */ for (; pfn < max_pfn; pfn++) { + /* + * This temporary page_owner is required so + * that we can avoid the context switches while holding + * the rcu lock and copying the page owner information to + * user through copy_to_user() or GFP_KERNEL allocations. + */ + struct page_owner page_owner_tmp; + /* * If the new page is in a new MAX_ORDER_NR_PAGES area, * validate the area as existing, skip it if not @@ -530,7 +557,7 @@ read_page_owner(struct file *file, char __user *buf, size_t count, loff_t *ppos) continue; } - page_ext = lookup_page_ext(page); + page_ext = page_ext_get(page); if (unlikely(!page_ext)) continue; @@ -539,14 +566,14 @@ read_page_owner(struct file *file, char __user *buf, size_t count, loff_t *ppos) * because we don't hold the zone lock. */ if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags)) - continue; + goto ext_put_continue; /* * Although we do have the info about past allocation of free * pages, it's not relevant for current memory usage. */ if (!test_bit(PAGE_EXT_OWNER_ALLOCATED, &page_ext->flags)) - continue; + goto ext_put_continue; page_owner = get_page_owner(page_ext); @@ -555,7 +582,7 @@ read_page_owner(struct file *file, char __user *buf, size_t count, loff_t *ppos) * would inflate the stats. */ if (!IS_ALIGNED(pfn, 1 << page_owner->order)) - continue; + goto ext_put_continue; /* * Access to page_ext->handle isn't synchronous so we should @@ -563,13 +590,17 @@ read_page_owner(struct file *file, char __user *buf, size_t count, loff_t *ppos) */ handle = READ_ONCE(page_owner->handle); if (!handle) - continue; + goto ext_put_continue; /* Record the next PFN to read in the file offset */ *ppos = (pfn - min_low_pfn) + 1; + page_owner_tmp = *page_owner; + page_ext_put(page_ext); return print_page_owner(buf, count, pfn, page, - page_owner, handle); + &page_owner_tmp, handle); +ext_put_continue: + page_ext_put(page_ext); } return 0; @@ -627,18 +658,20 @@ static void init_pages_in_zone(pg_data_t *pgdat, struct zone *zone) if (PageReserved(page)) continue; - page_ext = lookup_page_ext(page); + page_ext = page_ext_get(page); if (unlikely(!page_ext)) continue; /* Maybe overlapping zone */ if (test_bit(PAGE_EXT_OWNER, &page_ext->flags)) - continue; + goto ext_put_continue; /* Found early allocated page */ __set_page_owner_handle(page, page_ext, early_handle, 0, 0); count++; +ext_put_continue: + page_ext_put(page_ext); } cond_resched(); } From 99f01600227a1aa314913a92734677d99826c365 Mon Sep 17 00:00:00 2001 From: Charan Teja Kalla Date: Fri, 19 Aug 2022 20:52:40 +0530 Subject: [PATCH 40/52] ANDROID: mm: page_pinner: use page_ext_get/put() to work with page_ext Use page_ext_get/put() to work with the page extended information without which the page extended information may not be valid. Bug: 2129036 Change-Id: Ibfe036b9ecef0e2551b5d0da1011cacbb0a5c3e6 Signed-off-by: Charan Teja Kalla --- mm/page_pinner.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/mm/page_pinner.c b/mm/page_pinner.c index 8bccb54fbbd3..6a825777afac 100644 --- a/mm/page_pinner.c +++ b/mm/page_pinner.c @@ -162,7 +162,7 @@ void __reset_page_pinner(struct page *page, unsigned int order, bool free) struct page_ext *page_ext; int i; - page_ext = lookup_page_ext(page); + page_ext = page_ext_get(page); if (unlikely(!page_ext)) return; @@ -184,6 +184,7 @@ void __reset_page_pinner(struct page *page, unsigned int order, bool free) clear_bit(PAGE_EXT_GET, &page_ext->flags); page_ext = page_ext_next(page_ext); } + page_ext_put(page_ext); } static inline void __set_page_pinner_handle(struct page *page, @@ -206,14 +207,16 @@ static inline void __set_page_pinner_handle(struct page *page, noinline void __set_page_pinner(struct page *page, unsigned int order) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext; depot_stack_handle_t handle; + handle = save_stack(GFP_NOWAIT|__GFP_NOWARN); + + page_ext = page_ext_get(page); if (unlikely(!page_ext)) return; - - handle = save_stack(GFP_NOWAIT|__GFP_NOWARN); __set_page_pinner_handle(page, page_ext, handle, order); + page_ext_put(page_ext); } static ssize_t @@ -279,7 +282,7 @@ print_page_pinner(bool longterm, char __user *buf, size_t count, struct captured void __dump_page_pinner(struct page *page) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); struct page_pinner *page_pinner; depot_stack_handle_t handle; unsigned long *entries; @@ -300,6 +303,7 @@ void __dump_page_pinner(struct page *page) count = atomic_read(&page_pinner->count); if (!count) { pr_alert("page_pinner info is not present (never set?)\n"); + page_ext_put(page_ext); return; } @@ -323,11 +327,12 @@ void __dump_page_pinner(struct page *page) nr_entries = stack_depot_fetch(handle, &entries); stack_trace_print(entries, nr_entries, 0); } + page_ext_put(page_ext); } void __page_pinner_migration_failed(struct page *page) { - struct page_ext *page_ext = lookup_page_ext(page); + struct page_ext *page_ext = page_ext_get(page); struct captured_pinner record; unsigned long flags; unsigned int idx; @@ -335,9 +340,12 @@ void __page_pinner_migration_failed(struct page *page) if (unlikely(!page_ext)) return; - if (!test_bit(PAGE_EXT_PINNER_MIGRATION_FAILED, &page_ext->flags)) + if (!test_bit(PAGE_EXT_PINNER_MIGRATION_FAILED, &page_ext->flags)) { + page_ext_put(page_ext); return; + } + page_ext_put(page_ext); record.handle = save_stack(GFP_NOWAIT|__GFP_NOWARN); record.ts_usec = ktime_to_us(ktime_get_boottime()); capture_page_state(page, &record); @@ -359,10 +367,11 @@ void __page_pinner_mark_migration_failed_pages(struct list_head *page_list) /* The page will be freed by putback_movable_pages soon */ if (page_count(page) == 1) continue; - page_ext = lookup_page_ext(page); + page_ext = page_ext_get(page); if (unlikely(!page_ext)) continue; __set_bit(PAGE_EXT_PINNER_MIGRATION_FAILED, &page_ext->flags); + page_ext_put(page_ext); __page_pinner_migration_failed(page); } } From 2301307412708aaf86c64e048d57529b70f6e9c0 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Wed, 31 Aug 2022 14:08:56 +0800 Subject: [PATCH 41/52] BACKPORT: f2fs: invalidate META_MAPPING before IPU/DIO write Encrypted pages during GC are read and cached in META_MAPPING. However, due to cached pages in META_MAPPING, there is an issue where newly written pages are lost by IPU or DIO writes. Thread A - f2fs_gc() Thread B /* phase 3 */ down_write(i_gc_rwsem) ra_data_block() ---- (a) up_write(i_gc_rwsem) f2fs_direct_IO() : - down_read(i_gc_rwsem) - __blockdev_direct_io() - get_data_block_dio_write() - f2fs_dio_submit_bio() ---- (b) - up_read(i_gc_rwsem) /* phase 4 */ down_write(i_gc_rwsem) move_data_block() ---- (c) up_write(i_gc_rwsem) (a) In phase 3 of f2fs_gc(), up-to-date page is read from storage and cached in META_MAPPING. (b) In thread B, writing new data by IPU or DIO write on same blkaddr as read in (a). cached page in META_MAPPING become out-dated. (c) In phase 4 of f2fs_gc(), out-dated page in META_MAPPING is copied to new blkaddr. In conclusion, the newly written data in (b) is lost. To address this issue, invalidating pages in META_MAPPING before IPU or DIO write. Bug: 243874214 Fixes: 6aa58d8ad20a ("f2fs: readahead encrypted block during GC") Signed-off-by: Hyeong-Jun Kim Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Chao Yu (cherry picked from commit e3b49ea36802053f312013fd4ccb6e59920a9f76) Change-Id: I1c0af14c2d63c115b882bf38ba61ea7924a70bb1 --- fs/f2fs/data.c | 5 ++++- fs/f2fs/segment.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 653ab9564c56..3b61d6ff608d 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1669,9 +1669,12 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, sync_out: /* for hardware encryption, but to avoid potential issue in future */ - if (flag == F2FS_GET_BLOCK_DIO && map->m_flags & F2FS_MAP_MAPPED) + if (flag == F2FS_GET_BLOCK_DIO && map->m_flags & F2FS_MAP_MAPPED) { f2fs_wait_on_block_writeback_range(inode, map->m_pblk, map->m_len); + invalidate_mapping_pages(META_MAPPING(sbi), + map->m_pblk, map->m_pblk); + } if (flag == F2FS_GET_BLOCK_PRECACHE) { if (map->m_flags & F2FS_MAP_MAPPED) { diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index dfd418c97666..ba40a41986ff 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3568,6 +3568,9 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio) goto drop_bio; } + invalidate_mapping_pages(META_MAPPING(sbi), + fio->new_blkaddr, fio->new_blkaddr); + stat_inc_inplace_blocks(fio->sbi); if (fio->bio && !(SM_I(sbi)->ipu_policy & (1 << F2FS_IPU_NOCACHE))) From fa0cdb5b9d01e512f569dafdb9548eea043d9b41 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Wed, 31 Aug 2022 14:13:36 +0800 Subject: [PATCH 42/52] BACKPORT: f2fs: fix to invalidate META_MAPPING before DIO write Quoted from commit e3b49ea36802 ("f2fs: invalidate META_MAPPING before IPU/DIO write") " Encrypted pages during GC are read and cached in META_MAPPING. However, due to cached pages in META_MAPPING, there is an issue where newly written pages are lost by IPU or DIO writes. Thread A - f2fs_gc() Thread B /* phase 3 */ down_write(i_gc_rwsem) ra_data_block() ---- (a) up_write(i_gc_rwsem) f2fs_direct_IO() : - down_read(i_gc_rwsem) - __blockdev_direct_io() - get_data_block_dio_write() - f2fs_dio_submit_bio() ---- (b) - up_read(i_gc_rwsem) /* phase 4 */ down_write(i_gc_rwsem) move_data_block() ---- (c) up_write(i_gc_rwsem) (a) In phase 3 of f2fs_gc(), up-to-date page is read from storage and cached in META_MAPPING. (b) In thread B, writing new data by IPU or DIO write on same blkaddr as read in (a). cached page in META_MAPPING become out-dated. (c) In phase 4 of f2fs_gc(), out-dated page in META_MAPPING is copied to new blkaddr. In conclusion, the newly written data in (b) is lost. To address this issue, invalidating pages in META_MAPPING before IPU or DIO write. " In previous commit, we missed to cover extent cache hit case, and passed wrong value for parameter @end of invalidate_mapping_pages(), fix both issues. Bug: 243874214 Fixes: 6aa58d8ad20a ("f2fs: readahead encrypted block during GC") Fixes: e3b49ea36802 ("f2fs: invalidate META_MAPPING before IPU/DIO write") Cc: Hyeong-Jun Kim Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Chao Yu (cherry picked from commit 67ca06872eb02944b4c6f92cffa9242e92c63109) Change-Id: Icbfb0a0004172a0af9ab59ffabf92ee7c5f16791 --- fs/f2fs/data.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 3b61d6ff608d..38346b3a4800 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1490,9 +1490,12 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, *map->m_next_extent = pgofs + map->m_len; /* for hardware encryption, but to avoid potential issue in future */ - if (flag == F2FS_GET_BLOCK_DIO) + if (flag == F2FS_GET_BLOCK_DIO) { f2fs_wait_on_block_writeback_range(inode, map->m_pblk, map->m_len); + invalidate_mapping_pages(META_MAPPING(sbi), + map->m_pblk, map->m_pblk + map->m_len - 1); + } goto out; } @@ -1673,7 +1676,7 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, f2fs_wait_on_block_writeback_range(inode, map->m_pblk, map->m_len); invalidate_mapping_pages(META_MAPPING(sbi), - map->m_pblk, map->m_pblk); + map->m_pblk, map->m_pblk + map->m_len - 1); } if (flag == F2FS_GET_BLOCK_PRECACHE) { From 22b447e9bdb357e62fa1bfd85a2e8072e489b68a Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Wed, 31 Aug 2022 14:18:54 +0800 Subject: [PATCH 43/52] BACKPORT: f2fs: invalidate meta pages only for post_read required inode After commit e3b49ea36802 ("f2fs: invalidate META_MAPPING before IPU/DIO write"), invalidate_mapping_pages() will be called to avoid race condition in between IPU/DIO and readahead for GC. However, readahead flow is only used for post_read required inode, so this patch adds check condition to avoids unnecessary page cache invalidating for non-post_read inode. Bug: 243874214 Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Chao Yu (cherry picked from commit 0d5b9d8156396bbe1c982708b38ab9e188c45ec9) Change-Id: I39a8da4183b59b34522f445d25d8ab9fd2d6319c --- fs/f2fs/data.c | 11 +++-------- fs/f2fs/f2fs.h | 1 + fs/f2fs/segment.c | 9 ++++++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 38346b3a4800..267ad87fd1d8 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1490,12 +1490,9 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, *map->m_next_extent = pgofs + map->m_len; /* for hardware encryption, but to avoid potential issue in future */ - if (flag == F2FS_GET_BLOCK_DIO) { + if (flag == F2FS_GET_BLOCK_DIO) f2fs_wait_on_block_writeback_range(inode, map->m_pblk, map->m_len); - invalidate_mapping_pages(META_MAPPING(sbi), - map->m_pblk, map->m_pblk + map->m_len - 1); - } goto out; } @@ -1672,12 +1669,9 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, sync_out: /* for hardware encryption, but to avoid potential issue in future */ - if (flag == F2FS_GET_BLOCK_DIO && map->m_flags & F2FS_MAP_MAPPED) { + if (flag == F2FS_GET_BLOCK_DIO && map->m_flags & F2FS_MAP_MAPPED) f2fs_wait_on_block_writeback_range(inode, map->m_pblk, map->m_len); - invalidate_mapping_pages(META_MAPPING(sbi), - map->m_pblk, map->m_pblk + map->m_len - 1); - } if (flag == F2FS_GET_BLOCK_PRECACHE) { if (map->m_flags & F2FS_MAP_MAPPED) { @@ -2720,6 +2714,7 @@ int f2fs_write_single_data_page(struct page *page, int *submitted, .submitted = false, .compr_blocks = compr_blocks, .need_lock = LOCK_RETRY, + .post_read = f2fs_post_read_required(inode), .io_type = io_type, .io_wbc = wbc, .bio = bio, diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 88520c7c3a13..0d6923b009ba 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1161,6 +1161,7 @@ struct f2fs_io_info { bool retry; /* need to reallocate block address */ int compr_blocks; /* # of compressed block addresses */ bool encrypted; /* indicate file is encrypted */ + bool post_read; /* require post read */ enum iostat_type io_type; /* io type */ struct writeback_control *io_wbc; /* writeback control */ struct bio **bio; /* bio for ipu */ diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index ba40a41986ff..8fe7ea4489d3 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3568,7 +3568,8 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio) goto drop_bio; } - invalidate_mapping_pages(META_MAPPING(sbi), + if (fio->post_read) + invalidate_mapping_pages(META_MAPPING(sbi), fio->new_blkaddr, fio->new_blkaddr); stat_inc_inplace_blocks(fio->sbi); @@ -3750,10 +3751,16 @@ void f2fs_wait_on_block_writeback(struct inode *inode, block_t blkaddr) void f2fs_wait_on_block_writeback_range(struct inode *inode, block_t blkaddr, block_t len) { + struct f2fs_sb_info *sbi = F2FS_I_SB(inode); block_t i; + if (!f2fs_post_read_required(inode)) + return; + for (i = 0; i < len; i++) f2fs_wait_on_block_writeback(inode, blkaddr + i); + + invalidate_mapping_pages(META_MAPPING(sbi), blkaddr, blkaddr + len - 1); } static int read_compacted_summaries(struct f2fs_sb_info *sbi) From 85aff723298470f06985cc2075f9b176da3a2aaa Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 31 Aug 2022 18:59:49 +0200 Subject: [PATCH 44/52] Revert "ANDROID: GKI: signal: Export for __lock_task_sighand" This reverts commit a719abf03114cfc0b9f68937d9cd900d74d65cae. The symbol was never used by any external module, so remove the unneeded export. Bug: 158067689 Bug: 203756332 Cc: Abhilasha Rao Signed-off-by: Greg Kroah-Hartman Change-Id: I13b65fd0620faf08784dabc7130f199dfa5cf053 --- kernel/signal.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/signal.c b/kernel/signal.c index 6fff4a9788ac..71a550524bd7 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1400,7 +1400,6 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, return sighand; } -EXPORT_SYMBOL_GPL(__lock_task_sighand); /* * send signal info to all the members of a group From 594835143a7065dd474688640c06b4179a647826 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Fri, 4 Feb 2022 15:19:46 +0800 Subject: [PATCH 45/52] BACKPORT: f2fs: introduce F2FS_IPU_HONOR_OPU_WRITE ipu policy Once F2FS_IPU_FORCE policy is enabled in some cases: a) f2fs forces to use F2FS_IPU_FORCE in a small-sized volume b) user sets F2FS_IPU_FORCE policy via sysfs Then we may fail to defragment file due to IPU policy check, it doesn't make sense, let's introduce a new IPU policy to allow OPU during file defragmentation. In small-sized volume, let's enable F2FS_IPU_HONOR_OPU_WRITE policy by default. Bug: 244657983 Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim (cherry picked from commit 1018a5463a063715365784704c4e8cdf2eec4b04) Change-Id: I05dfa5a07a6a17dcda68f50a8f4a8260c2612dcc --- Documentation/ABI/testing/sysfs-fs-f2fs | 3 ++- fs/f2fs/data.c | 18 +++++++++++++----- fs/f2fs/f2fs.h | 3 ++- fs/f2fs/file.c | 18 +++++++++++------- fs/f2fs/segment.h | 5 ++++- fs/f2fs/super.c | 3 ++- 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs index 759a8291ff4a..cd503f42eda1 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -56,8 +56,9 @@ Description: Controls the in-place-update policy. 0x04 F2FS_IPU_UTIL 0x08 F2FS_IPU_SSR_UTIL 0x10 F2FS_IPU_FSYNC - 0x20 F2FS_IPU_ASYNC, + 0x20 F2FS_IPU_ASYNC 0x40 F2FS_IPU_NOCACHE + 0x80 F2FS_IPU_HONOR_OPU_WRITE ==== ================= Refer segment.h for details. diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 267ad87fd1d8..b0ad5f156619 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2479,6 +2479,9 @@ static inline bool check_inplace_update_policy(struct inode *inode, struct f2fs_sb_info *sbi = F2FS_I_SB(inode); unsigned int policy = SM_I(sbi)->ipu_policy; + if (policy & (0x1 << F2FS_IPU_HONOR_OPU_WRITE) && + is_inode_flag_set(inode, FI_OPU_WRITE)) + return false; if (policy & (0x1 << F2FS_IPU_FORCE)) return true; if (policy & (0x1 << F2FS_IPU_SSR) && f2fs_need_SSR(sbi)) @@ -2549,6 +2552,9 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio) if (is_inode_flag_set(inode, FI_ALIGNED_WRITE)) return true; + if (is_inode_flag_set(inode, FI_OPU_WRITE)) + return true; + if (fio) { if (page_private_gcing(fio->page)) return true; @@ -3173,8 +3179,8 @@ static int __f2fs_write_data_pages(struct address_space *mapping, f2fs_available_free_memory(sbi, DIRTY_DENTS)) goto skip_write; - /* skip writing during file defragment */ - if (is_inode_flag_set(inode, FI_DO_DEFRAG)) + /* skip writing in file defragment preparing stage */ + if (is_inode_flag_set(inode, FI_SKIP_WRITES)) goto skip_write; trace_f2fs_writepages(mapping->host, wbc, DATA); @@ -3956,6 +3962,7 @@ static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk, f2fs_down_write(&F2FS_I(inode)->i_mmap_sem); set_inode_flag(inode, FI_ALIGNED_WRITE); + set_inode_flag(inode, FI_OPU_WRITE); for (; secidx < end_sec; secidx++) { f2fs_down_write(&sbi->pin_sem); @@ -3964,7 +3971,7 @@ static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk, f2fs_allocate_new_section(sbi, CURSEG_COLD_DATA_PINNED, false); f2fs_unlock_op(sbi); - set_inode_flag(inode, FI_DO_DEFRAG); + set_inode_flag(inode, FI_SKIP_WRITES); for (blkofs = 0; blkofs < blk_per_sec; blkofs++) { struct page *page; @@ -3981,7 +3988,7 @@ static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk, f2fs_put_page(page, 1); } - clear_inode_flag(inode, FI_DO_DEFRAG); + clear_inode_flag(inode, FI_SKIP_WRITES); ret = filemap_fdatawrite(inode->i_mapping); @@ -3992,7 +3999,8 @@ static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk, } done: - clear_inode_flag(inode, FI_DO_DEFRAG); + clear_inode_flag(inode, FI_SKIP_WRITES); + clear_inode_flag(inode, FI_OPU_WRITE); clear_inode_flag(inode, FI_ALIGNED_WRITE); f2fs_up_write(&F2FS_I(inode)->i_mmap_sem); diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 0d6923b009ba..12f5b7e6a347 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -707,7 +707,8 @@ enum { FI_DROP_CACHE, /* drop dirty page cache */ FI_DATA_EXIST, /* indicate data exists */ FI_INLINE_DOTS, /* indicate inline dot dentries */ - FI_DO_DEFRAG, /* indicate defragment is running */ + FI_SKIP_WRITES, /* should skip data page writeback */ + FI_OPU_WRITE, /* used for opu per file */ FI_DIRTY_FILE, /* indicate regular/symlink has dirty pages */ FI_NO_PREALLOC, /* indicate skipped preallocated blocks */ FI_HOT_DATA, /* indicate file is hot */ diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 016a84ae1ec5..0d4820afca16 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2592,10 +2592,6 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, bool fragmented = false; int err; - /* if in-place-update policy is enabled, don't waste time here */ - if (f2fs_should_update_inplace(inode, NULL)) - return -EINVAL; - pg_start = range->start >> PAGE_SHIFT; pg_end = (range->start + range->len) >> PAGE_SHIFT; @@ -2603,6 +2599,13 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, inode_lock(inode); + /* if in-place-update policy is enabled, don't waste time here */ + set_inode_flag(inode, FI_OPU_WRITE); + if (f2fs_should_update_inplace(inode, NULL)) { + err = -EINVAL; + goto out; + } + /* writeback all dirty pages in the range */ err = filemap_write_and_wait_range(inode->i_mapping, range->start, range->start + range->len - 1); @@ -2684,7 +2687,7 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, goto check; } - set_inode_flag(inode, FI_DO_DEFRAG); + set_inode_flag(inode, FI_SKIP_WRITES); idx = map.m_lblk; while (idx < map.m_lblk + map.m_len && cnt < blk_per_seg) { @@ -2709,15 +2712,16 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, if (map.m_lblk < pg_end && cnt < blk_per_seg) goto do_map; - clear_inode_flag(inode, FI_DO_DEFRAG); + clear_inode_flag(inode, FI_SKIP_WRITES); err = filemap_fdatawrite(inode->i_mapping); if (err) goto out; } clear_out: - clear_inode_flag(inode, FI_DO_DEFRAG); + clear_inode_flag(inode, FI_SKIP_WRITES); out: + clear_inode_flag(inode, FI_OPU_WRITE); inode_unlock(inode); if (!err) range->len = (u64)total << PAGE_SHIFT; diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 7d9166a2ff41..10ddc2803ed0 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -650,7 +650,9 @@ static inline int utilization(struct f2fs_sb_info *sbi) * pages over min_fsync_blocks. (=default option) * F2FS_IPU_ASYNC - do IPU given by asynchronous write requests. * F2FS_IPU_NOCACHE - disable IPU bio cache. - * F2FS_IPUT_DISABLE - disable IPU. (=default option in LFS mode) + * F2FS_IPU_HONOR_OPU_WRITE - use OPU write prior to IPU write if inode has + * FI_OPU_WRITE flag. + * F2FS_IPU_DISABLE - disable IPU. (=default option in LFS mode) */ #define DEF_MIN_IPU_UTIL 70 #define DEF_MIN_FSYNC_BLOCKS 8 @@ -666,6 +668,7 @@ enum { F2FS_IPU_FSYNC, F2FS_IPU_ASYNC, F2FS_IPU_NOCACHE, + F2FS_IPU_HONOR_OPU_WRITE, }; static inline unsigned int curseg_segno(struct f2fs_sb_info *sbi, diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 532d2546b0a3..6dcdd007a3ec 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -3771,7 +3771,8 @@ static void f2fs_tuning_parameters(struct f2fs_sb_info *sbi) if (sm_i->main_segments <= SMALL_VOLUME_SEGMENTS) { F2FS_OPTION(sbi).alloc_mode = ALLOC_MODE_REUSE; sm_i->dcc_info->discard_granularity = 1; - sm_i->ipu_policy = 1 << F2FS_IPU_FORCE; + sm_i->ipu_policy = 1 << F2FS_IPU_FORCE | + 1 << F2FS_IPU_HONOR_OPU_WRITE; } sbi->readdir_ra = 1; From 604f2f5656f16b555284b486134a30d70b6a1d01 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Fri, 4 Mar 2022 09:40:05 -0800 Subject: [PATCH 46/52] BACKPORT: f2fs: don't get FREEZE lock in f2fs_evict_inode in frozen fs Let's purge inode cache in order to avoid the below deadlock. [freeze test] shrinkder freeze_super - pwercpu_down_write(SB_FREEZE_FS) - super_cache_scan - down_read(&sb->s_umount) - prune_icache_sb - dispose_list - evict - f2fs_evict_inode thaw_super - down_write(&sb->s_umount); - __percpu_down_read(SB_FREEZE_FS) Bug: 242127451 Signed-off-by: Jaegeuk Kim Change-Id: Ifa01aca90eab6968c5e511fb3819854121aa9b7c (cherry picked from commit e3d44a0028f58cd1dcba053120652e1a1ea6ce12) --- Documentation/ABI/testing/sysfs-fs-f2fs | 1 + fs/f2fs/f2fs.h | 1 + fs/f2fs/inode.c | 6 ++++-- fs/f2fs/super.c | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs index cd503f42eda1..163d38c0ba64 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -432,6 +432,7 @@ Description: Show status of f2fs superblock in real time. 0x800 SBI_QUOTA_SKIP_FLUSH skip flushing quota in current CP 0x1000 SBI_QUOTA_NEED_REPAIR quota file may be corrupted 0x2000 SBI_IS_RESIZEFS resizefs is in process + 0x4000 SBI_IS_FREEZING freefs is in process ====== ===================== ================================= What: /sys/fs/f2fs//ckpt_thread_ioprio diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 12f5b7e6a347..9241c2423bf5 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1247,6 +1247,7 @@ enum { SBI_QUOTA_SKIP_FLUSH, /* skip flushing quota in current CP */ SBI_QUOTA_NEED_REPAIR, /* quota file may be corrupted */ SBI_IS_RESIZEFS, /* resizefs is in process */ + SBI_IS_FREEZING, /* freezefs is in process */ }; enum { diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index f93fee11977b..30278af1cdd7 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -764,7 +764,8 @@ void f2fs_evict_inode(struct inode *inode) f2fs_remove_ino_entry(sbi, inode->i_ino, UPDATE_INO); f2fs_remove_ino_entry(sbi, inode->i_ino, FLUSH_INO); - sb_start_intwrite(inode->i_sb); + if (!is_sbi_flag_set(sbi, SBI_IS_FREEZING)) + sb_start_intwrite(inode->i_sb); set_inode_flag(inode, FI_NO_ALLOC); i_size_write(inode, 0); retry: @@ -795,7 +796,8 @@ void f2fs_evict_inode(struct inode *inode) if (dquot_initialize_needed(inode)) set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR); } - sb_end_intwrite(inode->i_sb); + if (!is_sbi_flag_set(sbi, SBI_IS_FREEZING)) + sb_end_intwrite(inode->i_sb); no_delete: dquot_drop(inode); diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 6dcdd007a3ec..90f8be1175e6 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1558,11 +1558,15 @@ static int f2fs_freeze(struct super_block *sb) /* ensure no checkpoint required */ if (!llist_empty(&F2FS_SB(sb)->cprc_info.issue_list)) return -EINVAL; + + /* to avoid deadlock on f2fs_evict_inode->SB_FREEZE_FS */ + set_sbi_flag(F2FS_SB(sb), SBI_IS_FREEZING); return 0; } static int f2fs_unfreeze(struct super_block *sb) { + clear_sbi_flag(F2FS_SB(sb), SBI_IS_FREEZING); return 0; } From 1c5313a9f76fc707a59610841323fc3304e7d3eb Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Fri, 19 Aug 2022 15:52:02 -0700 Subject: [PATCH 47/52] FROMGIT: f2fs: flush pending checkpoints when freezing super This avoids -EINVAL when trying to freeze f2fs. Bug: 242127451 Cc: stable@vger.kernel.org Signed-off-by: Jaegeuk Kim Change-Id: Id2939642e3b93b42cf1ca03831d6c5e4e54d57fd (cherry picked from commit a36fe7301268524ffa56ff8a9ad0edec6bd5b85a https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev) --- fs/f2fs/checkpoint.c | 24 ++++++++++++++++++------ fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 5 ++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 7bc120937874..2d4323218cb0 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -1863,15 +1863,27 @@ int f2fs_start_ckpt_thread(struct f2fs_sb_info *sbi) void f2fs_stop_ckpt_thread(struct f2fs_sb_info *sbi) { struct ckpt_req_control *cprc = &sbi->cprc_info; + struct task_struct *ckpt_task; - if (cprc->f2fs_issue_ckpt) { - struct task_struct *ckpt_task = cprc->f2fs_issue_ckpt; + if (!cprc->f2fs_issue_ckpt) + return; - cprc->f2fs_issue_ckpt = NULL; - kthread_stop(ckpt_task); + ckpt_task = cprc->f2fs_issue_ckpt; + cprc->f2fs_issue_ckpt = NULL; + kthread_stop(ckpt_task); - flush_remained_ckpt_reqs(sbi, NULL); - } + f2fs_flush_ckpt_thread(sbi); +} + +void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi) +{ + struct ckpt_req_control *cprc = &sbi->cprc_info; + + flush_remained_ckpt_reqs(sbi, NULL); + + /* Let's wait for the previous dispatched checkpoint. */ + while (atomic_read(&cprc->queued_ckpt)) + io_schedule_timeout(DEFAULT_IO_TIMEOUT); } void f2fs_init_ckpt_req_control(struct f2fs_sb_info *sbi) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 9241c2423bf5..42134a532de9 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3626,6 +3626,7 @@ unsigned int f2fs_usable_blks_in_seg(struct f2fs_sb_info *sbi, * checkpoint.c */ void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io); +void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi); struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index); struct page *f2fs_get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index); struct page *f2fs_get_meta_page_retry(struct f2fs_sb_info *sbi, pgoff_t index); diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 90f8be1175e6..dff6f5afdb27 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1555,9 +1555,8 @@ static int f2fs_freeze(struct super_block *sb) if (is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY)) return -EINVAL; - /* ensure no checkpoint required */ - if (!llist_empty(&F2FS_SB(sb)->cprc_info.issue_list)) - return -EINVAL; + /* Let's flush checkpoints and stop the thread. */ + f2fs_flush_ckpt_thread(F2FS_SB(sb)); /* to avoid deadlock on f2fs_evict_inode->SB_FREEZE_FS */ set_sbi_flag(F2FS_SB(sb), SBI_IS_FREEZING); From 42aa1955c2787306032418c3aee6959d192ea571 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Thu, 18 Aug 2022 22:40:09 -0700 Subject: [PATCH 48/52] FROMGIT: f2fs: complete checkpoints during remount Otherwise, pending checkpoints can contribute a race condition to give a quota warning. - Thread - checkpoint thread add checkpoints to the list do_remount() down_write(&sb->s_umount); f2fs_remount() block_operations() down_read_trylock(&sb->s_umount) = 0 up_write(&sb->s_umount); f2fs_quota_sync() dquot_writeback_dquots() WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount)); Or, do_remount() down_write(&sb->s_umount); f2fs_remount() create a ckpt thread f2fs_enable_checkpoint() adds checkpoints wait for f2fs_sync_fs() trigger another pending checkpoint block_operations() down_read_trylock(&sb->s_umount) = 0 up_write(&sb->s_umount); f2fs_quota_sync() dquot_writeback_dquots() WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount)); Bug: 242127451 Bug: 215554521 Cc: stable@vger.kernel.org Signed-off-by: Jaegeuk Kim Change-Id: I85926fe14245058e48bac5699a7b760d7700c653 (cherry picked from commit d14393c5bff2f0c163e6bb384618300e30d19754 https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev) --- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index dff6f5afdb27..454ceb6155d4 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2028,6 +2028,9 @@ static void f2fs_enable_checkpoint(struct f2fs_sb_info *sbi) f2fs_up_write(&sbi->gc_lock); f2fs_sync_fs(sbi->sb, 1); + + /* Let's ensure there's no pending checkpoint anymore */ + f2fs_flush_ckpt_thread(sbi); } static int f2fs_remount(struct super_block *sb, int *flags, char *data) @@ -2187,6 +2190,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) f2fs_stop_ckpt_thread(sbi); need_restart_ckpt = true; } else { + /* Flush if the prevous checkpoint, if exists. */ + f2fs_flush_ckpt_thread(sbi); + err = f2fs_start_ckpt_thread(sbi); if (err) { f2fs_err(sbi, From eaa7364bf7f86ce8f20810a1e806c4e48f0ca0b4 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Tue, 23 Aug 2022 10:18:42 -0700 Subject: [PATCH 49/52] FROMGIT: f2fs: increase the limit for reserve_root This patch increases the threshold that limits the reserved root space from 0.2% to 12.5% by using simple shift operation. Typically Android sets 128MB, but if the storage capacity is 32GB, 0.2% which is around 64MB becomes too small. Let's relax it. Bug: 243493735 Cc: stable@vger.kernel.org Reported-by: Aran Dalton Signed-off-by: Jaegeuk Kim Change-Id: Ia76ae8f9dd1c7a5f123a561f081bf5a4a29ac186 (cherry picked from commit cf42f1d7ab33ea2637f3c6b786a76302f719726b https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev) --- fs/f2fs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 454ceb6155d4..98f585000aa2 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -299,10 +299,10 @@ static void f2fs_destroy_casefold_cache(void) { } static inline void limit_reserve_root(struct f2fs_sb_info *sbi) { - block_t limit = min((sbi->user_block_count << 1) / 1000, + block_t limit = min((sbi->user_block_count >> 3), sbi->user_block_count - sbi->reserved_blocks); - /* limit is 0.2% */ + /* limit is 12.5% */ if (test_opt(sbi, RESERVE_ROOT) && F2FS_OPTION(sbi).root_reserved_blocks > limit) { F2FS_OPTION(sbi).root_reserved_blocks = limit; From eef3b6ff4179ff0b940a4afe693e25759a39dd13 Mon Sep 17 00:00:00 2001 From: Konstantin Vyshetsky Date: Wed, 20 Apr 2022 17:24:29 -0700 Subject: [PATCH 50/52] BACKPORT: scsi: ufs: core: Increase fDeviceInit poll frequency UFS devices are expected to clear fDeviceInit flag in single digit milliseconds. Current values of 5 to 10 millisecond sleep add to increased latency during the initialization and resume path. This CL lowers the sleep range to 500 to 1000 microseconds. Bug: 236993021 Link: https://lore.kernel.org/r/20220421002429.3136933-1-bvanassche@acm.org Acked-by: Avri Altman Signed-off-by: Konstantin Vyshetsky Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen (cherry picked from commit a4e6496fca3f32e997e8a3b5c44e2a1ae09d018e) Change-Id: I3a9a01853e89ea73ff5e355007db4730fa853ea0 --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 55cf3301de66..e83fbb4f0593 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4380,7 +4380,7 @@ static int ufshcd_complete_dev_init(struct ufs_hba *hba) QUERY_FLAG_IDN_FDEVICEINIT, 0, &flag_res); if (!flag_res) break; - usleep_range(5000, 10000); + usleep_range(500, 1000); } while (ktime_before(ktime_get(), timeout)); if (err) { From bda2986f13b290a6c8132839a0a90a8a1cee2434 Mon Sep 17 00:00:00 2001 From: Linyu Yuan Date: Tue, 26 Jul 2022 14:45:49 +0800 Subject: [PATCH 51/52] UPSTREAM: usb: typec: ucsi: Acknowledge the GET_ERROR_STATUS command completion We found PPM will not send any notification after it report error status and OPM issue GET_ERROR_STATUS command to read the details about error. According UCSI spec, PPM may clear the Error Status Data after the OPM has acknowledged the command completion. This change add operation to acknowledge the command completion from PPM. Fixes: bdc62f2bae8f (usb: typec: ucsi: Simplified registration and I/O API) Cc: # 5.10 Signed-off-by: Jack Pham Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1658817949-4632-1-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman Bug: 241140735 Change-Id: I8447d618200163c6819f93f8d8b5b7f2bece5e13 (cherry picked from commit a7dc438b5e446afcd1b3b6651da28271400722f2) Signed-off-by: Mayank Rana Signed-off-by: Prashanth K --- drivers/usb/typec/ucsi/ucsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 53a51a2602b1..18be14d51e02 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -76,6 +76,10 @@ static int ucsi_read_error(struct ucsi *ucsi) if (ret) return ret; + ret = ucsi_acknowledge_command(ucsi); + if (ret) + return ret; + switch (error) { case UCSI_ERROR_INCOMPATIBLE_PARTNER: return -EOPNOTSUPP; From 95279078149abf6684fadbc7bb6a2ab49efeea18 Mon Sep 17 00:00:00 2001 From: Wesley Cheng Date: Fri, 12 Aug 2022 11:19:56 -0700 Subject: [PATCH 52/52] UPSTREAM: usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop Relocate the pullups_connected check until after it is ensured that there are no runtime PM transitions. If another context triggered the DWC3 core's runtime resume, it may have already enabled the Run/Stop. Do not re-run the entire pullup sequence again, as it may issue a core soft reset while Run/Stop is already set. This patch depends on commit 69e131d1ac4e ("usb: dwc3: gadget: Prevent repeat pullup()") Fixes: 77adb8bdf422 ("usb: dwc3: gadget: Allow runtime suspend if UDC unbinded") Cc: stable Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220728020647.9377-1-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman Bug: 245440430 Change-Id: I8b819b4773420fbca3bd7a284d715401dcdd00c3 (cherry picked from commit 040f2dbd2010c43f33ad27249e6dac48456f4d99) Signed-off-by: Prashanth K --- drivers/usb/dwc3/gadget.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index d988ba9b192e..016050adf800 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2472,9 +2472,6 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) is_on = !!is_on; - if (dwc->pullups_connected == is_on) - return 0; - vdwc->softconnect = is_on; /* @@ -2512,6 +2509,11 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) return 0; } + if (dwc->pullups_connected == is_on) { + pm_runtime_put(dwc->dev); + return 0; + } + /* * Synchronize and disable any further event handling while controller * is being enabled/disabled.