Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1314142

[PATCH 2/3] thp: change deferred_split_count() to return number of THP in queue

From "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] thp: change deferred_split_count() to return number of THP in queue
Date 2016-01-21 13:10 +0100
Message-ID <qTmdR-545-23@gated-at.bofh.it> (permalink)
References <qTceu-6lk-5@gated-at.bofh.it> <qTmdQ-545-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


I've got meaning of shrinker::count_objects() wrong: it should return
number of potentially freeable objects, which is not necessary correlate
with freeable memory.

Returning 256 per THP in queue is not reasonable:
shrinker::scan_objects() never called with nr_to_scan > 128 in my setup.

Let's return 1 per THP and correct scan_object accordingly.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 mm/huge_memory.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 769ea8db5771..36f98459f854 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3465,12 +3465,7 @@ static unsigned long deferred_split_count(struct shrinker *shrink,
 		struct shrink_control *sc)
 {
 	struct pglist_data *pgdata = NODE_DATA(sc->nid);
-	/*
-	 * Split a page from split_queue will free up at least one page,
-	 * at most HPAGE_PMD_NR - 1. We don't track exact number.
-	 * Let's use HPAGE_PMD_NR / 2 as ballpark.
-	 */
-	return ACCESS_ONCE(pgdata->split_queue_len) * HPAGE_PMD_NR / 2;
+	return ACCESS_ONCE(pgdata->split_queue_len);
 }
 
 static unsigned long deferred_split_scan(struct shrinker *shrink,
@@ -3511,7 +3506,7 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
 	list_splice_tail(&list, &pgdata->split_queue);
 	spin_unlock_irqrestore(&pgdata->split_queue_lock, flags);
 
-	return split * HPAGE_PMD_NR / 2;
+	return split;
 }
 
 static struct shrinker deferred_split_shrinker = {
-- 
2.7.0.rc3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCHv12 34/37] thp: introduce deferred_split_huge_page() Andrea Arcangeli <aarcange@redhat.com> - 2016-01-21 02:30 +0100
  [PATCH 1/3] thp: make split_queue per-node "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-01-21 13:10 +0100
  [PATCH 2/3] thp: change deferred_split_count() to return number of THP in queue "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-01-21 13:10 +0100
    Re: [PATCH 2/3] thp: change deferred_split_count() to return number  of THP in queue Andrea Arcangeli <aarcange@redhat.com> - 2016-01-22 15:40 +0100
      Re: [PATCH 2/3] thp: change deferred_split_count() to return number  of THP in queue "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-01-22 16:30 +0100
  [PATCH 3/3] thp: limit number of object to scan on deferred_split_scan() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-01-21 13:10 +0100
  [PATCH 0/3] Couple of fixes for deferred_split_huge_page() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-01-21 13:20 +0100
    Re: [PATCH 0/3] Couple of fixes for deferred_split_huge_page() Andrea Arcangeli <aarcange@redhat.com> - 2016-01-22 00:00 +0100

csiph-web