[Devel] [PATCH RHEL7 COMMIT] tcache: Delete duplicate cycle iteration variable
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Aug 11 17:25:05 MSK 2017
The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.35.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.26.1.vz7.35.3
------>
commit 3d4cf4c7240edad3baa86d25c137f02249e3c699
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Fri Aug 11 18:25:05 2017 +0400
tcache: Delete duplicate cycle iteration variable
Initially, nr_scanned == nr_to_isolate, but in futher
nr_scanned may decreese faster, i.e., in any time
nr_scanned <= nr_to_isolate.
The check, we do in while (), is:
nr_scanned > 0 && nr_to_isolate > 0
and it may be reduced to nr_scanned > 0 because of above.
So, do that, and rename nr_scanned in nr_to_scan, because
it better fits to its physical sence.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
mm/tcache.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/mm/tcache.c b/mm/tcache.c
index 0835e29..0bfbb69 100644
--- a/mm/tcache.c
+++ b/mm/tcache.c
@@ -990,14 +990,13 @@ __tcache_insert_reclaim_node(struct tcache_nodeinfo *ni,
static noinline_for_stack int
__tcache_lru_isolate(struct tcache_nodeinfo *ni,
struct tcache_pool_nodeinfo *pni,
- struct page **pages, int nr_to_isolate)
+ struct page **pages, int nr_to_scan)
{
struct tcache_node *node;
struct page *page;
int nr_isolated = 0;
- int nr_scanned = nr_to_isolate;
- while (nr_to_isolate > 0 && !list_empty(&pni->lru) && nr_scanned--) {
+ while (nr_to_scan-- > 0 && !list_empty(&pni->lru)) {
page = list_first_entry(&pni->lru, struct page, lru);
if (unlikely(!page_cache_get_speculative(page)))
@@ -1017,7 +1016,6 @@ __tcache_lru_isolate(struct tcache_nodeinfo *ni,
tcache_hold_pool(node->pool);
pages[nr_isolated++] = page;
- nr_to_isolate--;
}
return nr_isolated;
}
More information about the Devel
mailing list