lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 25 Feb 2015 22:29:04 +0000
From:	KY Srinivasan <kys@...rosoft.com>
To:	Vitaly Kuznetsov <vkuznets@...hat.com>
CC:	"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
	"Haiyang Zhang" <haiyangz@...rosoft.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Dexuan Cui <decui@...rosoft.com>
Subject: RE: [PATCH 1/2] Drivers: hv: hv_balloon: report offline pages as
 being used



> -----Original Message-----
> From: Vitaly Kuznetsov [mailto:vkuznets@...hat.com]
> Sent: Wednesday, February 25, 2015 8:56 AM
> To: KY Srinivasan
> Cc: devel@...uxdriverproject.org; Haiyang Zhang; linux-
> kernel@...r.kernel.org; Dexuan Cui
> Subject: Re: [PATCH 1/2] Drivers: hv: hv_balloon: report offline pages as
> being used
> 
> KY Srinivasan <kys@...rosoft.com> writes:
> 
> >> -----Original Message-----
> >> From: Vitaly Kuznetsov [mailto:vkuznets@...hat.com]
> >> Sent: Thursday, February 19, 2015 8:27 AM
> >> To: KY Srinivasan; devel@...uxdriverproject.org
> >> Cc: Haiyang Zhang; linux-kernel@...r.kernel.org; Dexuan Cui
> >> Subject: [PATCH 1/2] Drivers: hv: hv_balloon: report offline pages as
> >> being used
> >>
> >> When hot-added memory pages are not brought online or when some
> >> memory blocks are sent offline the subsequent ballooning process
> >> kills the guest with OOM killer. This happens as we don't report
> >> these pages as neither used nor free and apparently host algorythm
> >> considers them as being unused. Keep track of all online/offline
> >> operations and report all currently offline pages as being used so
> >> host won't try to balloon them out.
> >>
> >> Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
> >> ---
> >>  drivers/hv/hv_balloon.c | 33 ++++++++++++++++++++++++---------
> >>  1 file changed, 24 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index
> >> a095b70..e4b4454 100644
> >> --- a/drivers/hv/hv_balloon.c
> >> +++ b/drivers/hv/hv_balloon.c
> >> @@ -503,6 +503,8 @@ struct hv_dynmem_device {
> >>  	 * Number of pages we have currently ballooned out.
> >>  	 */
> >>  	unsigned int num_pages_ballooned;
> >> +	unsigned int num_pages_onlined;
> >> +	unsigned int num_pages_added;
> >>
> >>  	/*
> >>  	 * State to manage the ballooning (up) operation.
> >> @@ -556,12 +558,15 @@ static void post_status(struct
> hv_dynmem_device
> >> *dm);  static int hv_memory_notifier(struct notifier_block *nb,
> >> unsigned long val,
> >>  			      void *v)
> >>  {
> >> +	struct memory_notify *mem = (struct memory_notify *)v;
> >> +
> >>  	switch (val) {
> >>  	case MEM_GOING_ONLINE:
> >>  		mutex_lock(&dm_device.ha_region_mutex);
> >>  		break;
> >>
> >>  	case MEM_ONLINE:
> >> +		dm_device.num_pages_onlined += mem->nr_pages;
> >>  	case MEM_CANCEL_ONLINE:
> >
> > Why are we not adjusting num_pages_onlined when we cancel the online
> > Operation.
> 
> Because we didn't increase the number yet.

Thanks; my mistake.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ