lkml.org 
[lkml]   [2016]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 0/6] Reduce memory waste by page extension user
On Tue 16-08-16 11:53:00, Michal Hocko wrote:
> On Tue 16-08-16 11:51:13, Joonsoo Kim wrote:
> > From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> >
> > v2:
> > Fix rebase mistake (per Vlastimil)
> > Rename some variable/function to prevent confusion (per Vlastimil)
> > Fix header dependency (per Sergey)
> >
> > This patchset tries to reduce memory waste by page extension user.
> >
> > First case is architecture supported debug_pagealloc. It doesn't
> > requires additional memory if guard page isn't used. 8 bytes per
> > page will be saved in this case.
> >
> > Second case is related to page owner feature. Until now, if page_ext
> > users want to use it's own fields on page_ext, fields should be
> > defined in struct page_ext by hard-coding. It has a following problem.
> >
> > struct page_ext {
> > #ifdef CONFIG_A
> > int a;
> > #endif
> > #ifdef CONFIG_B
> > int b;
> > #endif
> > };
> >
> > Assume that kernel is built with both CONFIG_A and CONFIG_B.
> > Even if we enable feature A and doesn't enable feature B at runtime,
> > each entry of struct page_ext takes two int rather than one int.
> > It's undesirable waste so this patch tries to reduce it. By this patchset,
> > we can save 20 bytes per page dedicated for page owner feature
> > in some configurations.
>
> FWIW I like this. I have only glanced over those patches so I do not
> feel comfortable to give my a-b but the approach is sensible and the
> memory savings are really attractive. Page owner is a really great
> debugging feauture so enabling it makes a lot of sense on production
> servers where the memory wasting is a no-go.

OK, I have missed that page_ext is only allocated if there is at least
one feature which requires it enabled. So normally there shouldn't be
too much of wasted memory. Anyway allocating per feature makes a lot of
sense regardless.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2016-09-17 09:57    [W:0.071 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site