All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thp, vmstats: count deferred split events
@ 2016-02-09  9:15 Kirill A. Shutemov
  2016-02-09 21:20 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Kirill A. Shutemov @ 2016-02-09  9:15 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andrea Arcangeli, linux-mm, Kirill A. Shutemov

Counts how many times we put a THP in split queue. Currently, it happens
on partial unmap of a THP.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 include/linux/vm_event_item.h | 1 +
 mm/huge_memory.c              | 1 +
 mm/vmstat.c                   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 67c1dbd19c6d..b79e831006b0 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -71,6 +71,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
 		THP_COLLAPSE_ALLOC_FAILED,
 		THP_SPLIT_PAGE,
 		THP_SPLIT_PAGE_FAILED,
+		THP_DEFERRED_SPLIT_PAGE,
 		THP_SPLIT_PMD,
 		THP_ZERO_PAGE_ALLOC,
 		THP_ZERO_PAGE_ALLOC_FAILED,
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index c13ced03a2c5..db244d6a6feb 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3403,6 +3403,7 @@ void deferred_split_huge_page(struct page *page)
 
 	spin_lock_irqsave(&pgdata->split_queue_lock, flags);
 	if (list_empty(page_deferred_list(page))) {
+		count_vm_event(THP_DEFERRED_SPLIT_PAGE);
 		list_add_tail(page_deferred_list(page), &pgdata->split_queue);
 		pgdata->split_queue_len++;
 	}
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 69ce64f7b8d7..05c6ba2534fe 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -847,6 +847,7 @@ const char * const vmstat_text[] = {
 	"thp_collapse_alloc_failed",
 	"thp_split_page",
 	"thp_split_page_failed",
+	"thp_deferred_split_page",
 	"thp_split_pmd",
 	"thp_zero_page_alloc",
 	"thp_zero_page_alloc_failed",
-- 
2.7.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] thp, vmstats: count deferred split events
  2016-02-09  9:15 [PATCH] thp, vmstats: count deferred split events Kirill A. Shutemov
@ 2016-02-09 21:20 ` Andrew Morton
  2016-02-10 11:22   ` Kirill A. Shutemov
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2016-02-09 21:20 UTC (permalink / raw)
  To: Kirill A. Shutemov; +Cc: Andrea Arcangeli, linux-mm

On Tue,  9 Feb 2016 12:15:02 +0300 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:

> Counts how many times we put a THP in split queue. Currently, it happens
> on partial unmap of a THP.

Why do we need this?

> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -847,6 +847,7 @@ const char * const vmstat_text[] = {
>  	"thp_collapse_alloc_failed",
>  	"thp_split_page",
>  	"thp_split_page_failed",
> +	"thp_deferred_split_page",
>  	"thp_split_pmd",
>  	"thp_zero_page_alloc",
>  	"thp_zero_page_alloc_failed",

Documentation/vm/transhuge.txt, please.  While you're in there please
check that we haven't missed anything else.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] thp, vmstats: count deferred split events
  2016-02-09 21:20 ` Andrew Morton
@ 2016-02-10 11:22   ` Kirill A. Shutemov
  0 siblings, 0 replies; 3+ messages in thread
From: Kirill A. Shutemov @ 2016-02-10 11:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Kirill A. Shutemov, Andrea Arcangeli, linux-mm

On Tue, Feb 09, 2016 at 01:20:12PM -0800, Andrew Morton wrote:
> On Tue,  9 Feb 2016 12:15:02 +0300 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:
> 
> > Counts how many times we put a THP in split queue. Currently, it happens
> > on partial unmap of a THP.
> 
> Why do we need this?

Rapidly growing value can indicate that an application behaves
unfriendly wrt THP: often fault in huge page and then unmap part of it.
This leads to unnecessary memory fragmentation and the application may
require tuning.

Before refcouting rework thp_split_page would indicate the same. Not so much
now as we don't split huge pages that often.
 
The event also can help with debugging kernel [mis-]behaviour.

> > --- a/mm/vmstat.c
> > +++ b/mm/vmstat.c
> > @@ -847,6 +847,7 @@ const char * const vmstat_text[] = {
> >  	"thp_collapse_alloc_failed",
> >  	"thp_split_page",
> >  	"thp_split_page_failed",
> > +	"thp_deferred_split_page",
> >  	"thp_split_pmd",
> >  	"thp_zero_page_alloc",
> >  	"thp_zero_page_alloc_failed",
> 
> Documentation/vm/transhuge.txt, please. 

Updated patch is below.

> While you're in there please > check that we haven't missed anything else.

The rest of the documents is up-to-date.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-10 11:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-09  9:15 [PATCH] thp, vmstats: count deferred split events Kirill A. Shutemov
2016-02-09 21:20 ` Andrew Morton
2016-02-10 11:22   ` Kirill A. Shutemov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.