WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] [linux-2.6.39.x for xen] tmem: self-ballooning a

To: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] [linux-2.6.39.x for xen] tmem: self-ballooning and frontswap-selfshrinking
From: Daniel Kiper <dkiper@xxxxxxxxxxxx>
Date: Fri, 10 Jun 2011 13:53:05 +0200
Cc: jeremy@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, Konrad Wilk <konrad.wilk@xxxxxxxxxx>, JBeulich@xxxxxxxxxx, Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, Dushmanta Mohapatra <dmpatra@xxxxxxxxx>, Daniel Kiper <dkiper@xxxxxxxxxxxx>
Delivery-date: Fri, 10 Jun 2011 04:54:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <6713d588-a1a9-4673-8265-65a0f163fe2a@default>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110609172157.GA23592@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <6713d588-a1a9-4673-8265-65a0f163fe2a@default>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.3.28i
On Thu, Jun 09, 2011 at 02:12:48PM -0700, Dan Magenheimer wrote:
> > From: Daniel Kiper [mailto:dkiper@xxxxxxxxxxxx]
> > Subject: Re: [Xen-devel] [PATCH] [linux-2.6.39.x for xen] tmem: 
> > self-ballooning and frontswap-
> > selfshrinking
>
> > goal_pages = percpu_counter_read_positive(&vm_committed_as) +
>
> !!! (Ian cc'ed)
>
> Thanks for catching this!  I had thought vm_committed_as
> was not exported (and may not have been when I first
> coded this).  Now that it is, the "core kernel" change
> that was part of the changeset is no longer required, thus
> removing the dependency on core kernel/mm review!  Yay!
>
> > On Mon, Jun 06, 2011 at 03:12:28PM -0700, Dan Magenheimer wrote:
> >
> > [...]
> >
> > > +static void selfballoon_process(struct work_struct *work)
> > > +{
> > > + extern unsigned long vm_get_committed_as(void);
> > > + unsigned long cur_pages, goal_pages, tgt_pages;
> > > + int reset_timer = 0;
> > > +
> > > + if (balloon_stats.selfballooning_enabled) {
> > > +         tgt_pages = cur_pages = totalram_pages;
> >
> > tgt_pages = cur_pages = balloon_stats.current_pages;
> >
> > > +         goal_pages = vm_get_committed_as();
> >
> > goal_pages = percpu_counter_read_positive(&vm_committed_as) +
> >             balloon_stats.current_pages - totalram_pages;
> >
> > > +         if (cur_pages > goal_pages)
> > > +                 tgt_pages = cur_pages -
> > > +                         (cur_pages - goal_pages) / 
> > > balloon_stats.selfballoon_downhysteresis;
> > > +         else if (cur_pages < goal_pages)
> > > +                 tgt_pages = cur_pages +
> > > +                         (goal_pages - cur_pages) / 
> > > balloon_stats.selfballoon_uphysteresis;
> > > +         balloon_set_new_target(tgt_pages);
> > > +         reset_timer = 1;
> > > + }
> > > + if (frontswap_selfshrinking_enabled) {
> > > +         frontswap_selfshrink();
> > > +         reset_timer = 1;
> > > + }
> > > + if (reset_timer)
> > > +         schedule_delayed_work(&selfballoon_worker,
> > > +                 balloon_stats.selfballoon_interval * HZ);
> > > +}
>
> Thanks for the review Daniel!  Do these changes make it compatible
> with your hotplug work?

Eariler versions of memory hotplug worked fine with tmem.
I did not test latest one with tmem, however, it should
work without significant changes. If you wish I could help
you to intergrate tmem with memory hotplug.

> In your second correction (goal_pages), is it possible that
> balloon_stats.current_pages is less then totalram_pages?

balloon_stats.current_pages is always greater than totalram_pages.
balloon_stats.current_pages counts all pages currently available to
the system. totalram_pages counts only pages which could be allocated
for user space processes (more or less). It means that
balloon_stats.current_pages - totalram_pages represents
all pages allocated by kernel (more or less).

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>