ANDROID: vendor hook to control blk_plug for shrink_lruvec
Add vendor hook to contorl blk plugging for shrink_lruvec. Merged CL bcf1e503f5ed774dc28126a0f1a8c839717eafac: ANDROID: adjust vendor hook to control blk_plug Bug: 255471591 Bug: 238728493 Change-Id: Iba2603ff2e1b62cf2ee8fd6969d8ccd71416a288 Signed-off-by: Minchan Kim <minchan@google.com> Signed-off-by: Richard Chang <richardycc@google.com> (cherry picked from commit 89fed37332fd48e0cd13b256cd85d6929d5da319)
This commit is contained in:
committed by
Richard Chang
parent
7df45e50a5
commit
a8962f626f
@@ -287,4 +287,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_bh_lru_install);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_skip_lru_disable);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_madvise_blk_plug);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_inactive_list_blk_plug);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_lruvec_blk_plug);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_reclaim_pages_plug);
|
||||
|
||||
@@ -98,6 +98,9 @@ DECLARE_HOOK(android_vh_do_madvise_blk_plug,
|
||||
DECLARE_HOOK(android_vh_shrink_inactive_list_blk_plug,
|
||||
TP_PROTO(bool *do_plug),
|
||||
TP_ARGS(do_plug));
|
||||
DECLARE_HOOK(android_vh_shrink_lruvec_blk_plug,
|
||||
TP_PROTO(bool *do_plug),
|
||||
TP_ARGS(do_plug));
|
||||
DECLARE_HOOK(android_vh_reclaim_pages_plug,
|
||||
TP_PROTO(bool *do_plug),
|
||||
TP_ARGS(do_plug));
|
||||
|
||||
@@ -5647,6 +5647,7 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
unsigned long nr_to_reclaim = sc->nr_to_reclaim;
|
||||
bool proportional_reclaim;
|
||||
struct blk_plug plug;
|
||||
bool do_plug = true;
|
||||
|
||||
if (lru_gen_enabled()) {
|
||||
lru_gen_shrink_lruvec(lruvec, sc);
|
||||
@@ -5672,6 +5673,8 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
proportional_reclaim = (!cgroup_reclaim(sc) && !current_is_kswapd() &&
|
||||
sc->priority == DEF_PRIORITY);
|
||||
|
||||
trace_android_vh_shrink_lruvec_blk_plug(&do_plug);
|
||||
if (do_plug)
|
||||
blk_start_plug(&plug);
|
||||
while (nr[LRU_INACTIVE_ANON] || nr[LRU_ACTIVE_FILE] ||
|
||||
nr[LRU_INACTIVE_FILE]) {
|
||||
@@ -5742,6 +5745,7 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
|
||||
nr[lru] = targets[lru] * (100 - percentage) / 100;
|
||||
nr[lru] -= min(nr[lru], nr_scanned);
|
||||
}
|
||||
if (do_plug)
|
||||
blk_finish_plug(&plug);
|
||||
sc->nr_reclaimed += nr_reclaimed;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user