There is a race during page offline that can lead to infinite loop:
a page never ends up on a buddy list and __offline_pages() keeps
retrying infinitely or until a termination signal is received.
Thread#1 - a new process:
load_elf_binary
begin_new_exec
exec_mmap
mmput
exit_mmap
tlb_finish_mmu
tlb_flush_mmu
release_pages
free_unref_page_list
free_unref_page_prepare
set_pcppage_migratetype(page, migratetype);
// Set page->index migration type below MIGRATE_PCPTYPES
Thread#2 - hot-removes memory
__offline_pages
start_isolate_page_range
set_migratetype_isolate
set_pageblock_migratetype(page, MIGRATE_ISOLATE);
Set migration type to MIGRATE_ISOLATE-> set
drain_all_pages(zone);
// drain per-cpu page lists to buddy allocator.
Thread#1 - continue
free_unref_page_commit
migratetype = get_pcppage_migratetype(page);
// get old migration type
list_add(&page->lru, &pcp->lists[migratetype]);
// add new page to already drained pcp list
Thread#2
Never drains pcp again, and therefore gets stuck in the loop.
The fix is to try to drain per-cpu lists again after
check_pages_isolated_cb() fails.
Change-Id: I7d9b42fdbf436458242385f795126e42294562b1
Fixes: c52e75935f ("mm: remove extra drain pages on pcp list")
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Wei Yang <richard.weiyang@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20200903140032.380431-1-pasha.tatashin@soleen.com
Link: https://lkml.kernel.org/r/20200904151448.100489-2-pasha.tatashin@soleen.com
Link: http://lkml.kernel.org/r/20200904070235.GA15277@dhcp22.suse.cz
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-Commit: 9683182612214aa5f5e709fad49444b847cd866a
Git-Repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
WALT requires both src and dst runqueue locks to be held
during migration. So a double_lock_balance() is added
in move_queued_task() before calling set_task_cpu(). However,
releasing the src rq lock, which is pinned is giving a
lockdep warning. Fix this by unpinning the lock before
calling double_lock_balance.
Change-Id: I64dec0701b3467185cf53f311ebb521c6a822e88
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Enable setting trip thresholds in thermal zones for debug purposes.
Change-Id: Ifbd154ba343a319cbd9ddca24efe539db557abbd
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
when gadget pullup, add this event allow redriver
do some operation according to the pullup state.
Change-Id: I9cbd3f9e95aae327e1f872aff7ebff7a8926e5a5
Signed-off-by: Linyu Yuan <linyyuan@codeaurora.org>
when redriver connect to a USB hub, and do adb root operation,
due to redriver rx termination detection issue,
hub will not detct device logical removal.
workaround to temp disable/enable redriver when usb pullup operation.
Change-Id: Ia3b0c99a28dd7d0601e7c5bcc612c4c48447c165
Signed-off-by: Linyu Yuan <linyyuan@codeaurora.org>
Add support for qcom_clk_dump and qcom_clk_bulk_dump API's
which can be used by the clients to dump the registers
associated with the clock and it's parents.
Change-Id: Iea7f30bb4e789e41dbae41b88514ffd53c136174
Signed-off-by: Jagadeesh Kona <jkona@codeaurora.org>