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


Groups > linux.kernel > #1303477 > unrolled thread

Re: [PATCH v3 12/14] mm, page_owner: track and print last migrate reason

Started byMichal Hocko <mhocko@kernel.org>
First post2016-01-07 12:00 +0100
Last post2016-01-07 14:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v3 12/14] mm, page_owner: track and print last migrate  reason Michal Hocko <mhocko@kernel.org> - 2016-01-07 12:00 +0100
    Re: [PATCH v3 12/14] mm, page_owner: track and print last migrate  reason Vlastimil Babka <vbabka@suse.cz> - 2016-01-07 14:20 +0100

#1303477 — Re: [PATCH v3 12/14] mm, page_owner: track and print last migrate reason

FromMichal Hocko <mhocko@kernel.org>
Date2016-01-07 12:00 +0100
SubjectRe: [PATCH v3 12/14] mm, page_owner: track and print last migrate reason
Message-ID<qOgsp-6Yo-1@gated-at.bofh.it>
On Fri 18-12-15 10:03:24, Vlastimil Babka wrote:
> During migration, page_owner info is now copied with the rest of the page, so
> the stacktrace leading to free page allocation during migration is overwritten.
> For debugging purposes, it might be however useful to know that the page has
> been migrated since its initial allocation. This might happen many times during
> the lifetime for different reasons and fully tracking this, especially with
> stacktraces would incur extra memory costs. As a compromise, store and print
> the migrate_reason of the last migration that occurred to the page. This is
> enough to distinguish compaction, numa balancing etc.

So you know that the page has been migrated because of compaction the
last time. You do not know anything about the previous migrations
though. How would you use that information during debugging? Wouldn't it
be sufficient to know that the page has been migrated (or count how many
times) instead? That would lead to less code and it might be sufficient
for practical use.

> Example page_owner entry after the patch:
> 
> Page allocated via order 0, mask 0x24213ca(GFP_HIGHUSER_MOVABLE|GFP_COLD|GFP_NOWARN|GFP_NORETRY)
> PFN 674308 type Movable Block 1317 type Movable Flags 0x1fffff80010068(uptodate|lru|active|mappedtodisk)
>  [<ffffffff81164e9a>] __alloc_pages_nodemask+0x15a/0xa30
>  [<ffffffff811ab938>] alloc_pages_current+0x88/0x120
>  [<ffffffff8115bc46>] __page_cache_alloc+0xe6/0x120
>  [<ffffffff81168b9b>] __do_page_cache_readahead+0xdb/0x200
>  [<ffffffff81168df5>] ondemand_readahead+0x135/0x260
>  [<ffffffff81168f8c>] page_cache_async_readahead+0x6c/0x70
>  [<ffffffff8115d5f8>] generic_file_read_iter+0x378/0x590
>  [<ffffffff811d12a7>] __vfs_read+0xa7/0xd0
> Page has been migrated, last migrate reason: compaction
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Sasha Levin <sasha.levin@oracle.com>
> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Michal Hocko <mhocko@suse.cz>
> Cc: Hugh Dickins <hughd@google.com>
> ---
>  include/linux/migrate.h    |  6 +++++-
>  include/linux/page_ext.h   |  1 +
>  include/linux/page_owner.h |  9 +++++++++
>  mm/debug.c                 | 11 +++++++++++
>  mm/migrate.c               | 10 +++++++---
>  mm/page_owner.c            | 17 +++++++++++++++++
>  6 files changed, 50 insertions(+), 4 deletions(-)
[...]
-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1303583

FromVlastimil Babka <vbabka@suse.cz>
Date2016-01-07 14:20 +0100
Message-ID<qOiDU-9B-13@gated-at.bofh.it>
In reply to#1303477
On 01/07/2016 11:54 AM, Michal Hocko wrote:
> On Fri 18-12-15 10:03:24, Vlastimil Babka wrote:
>> During migration, page_owner info is now copied with the rest of the page, so
>> the stacktrace leading to free page allocation during migration is overwritten.
>> For debugging purposes, it might be however useful to know that the page has
>> been migrated since its initial allocation. This might happen many times during
>> the lifetime for different reasons and fully tracking this, especially with
>> stacktraces would incur extra memory costs. As a compromise, store and print
>> the migrate_reason of the last migration that occurred to the page. This is
>> enough to distinguish compaction, numa balancing etc.
>
> So you know that the page has been migrated because of compaction the
> last time. You do not know anything about the previous migrations
> though. How would you use that information during debugging? Wouldn't it

The assumption is that if a migration does something bad, chances are it 
will manifest before another migration happens. I.e. the last migration 
is probably more related to the bug (e.g. catched by VM_BUG_ON_PAGE()) 
than the previous ones. Statistically if trinity sees more errors 
implying compaction than numa balancing, we should look for bugs in 
compaction, etc.

> be sufficient to know that the page has been migrated (or count how many
> times) instead? That would lead to less code and it might be sufficient
> for practical use.

Yeah it's hard to predict how useful/sufficient this patch would be. The 
fact that migration happened should be definitely noted. How many times 
is not that useful IMHO. Migrate reason seemed appropriate and useful 
enough and we already distinguish them for tracepoints.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web