[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] xen/balloon: add late_initcall_sync() for initial ballooning done
- To: Juergen Gross <jgross@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
- Date: Fri, 29 Oct 2021 17:46:18 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xjh3VCLoupmxIzgdO5BP3ClEi4fylUi0ij0RRkludyQ=; b=AI3a45GK2ikizd/bdYzKsCDj+i8S6AO/KU/morV6KQ5efzZP3/vV5sK7zlT/TKnmtptHrADJpGV6d7p0MzIszfafJa0SL7YIjpA24rygGk/CLMUfJPw0UkFqeZ8g0C+azqk11OfUZofNcPFO/kq9PZ2TQGaIyaZ0jr172wwut8uhWXT3vTCNvY2kY3nwu8WB+fFLZVz8S0FXq9s8ZNVaVfqHPukyQcZALzT3iqCgY5vz9OWA+RSMlQO9gt/XZ3SfSuzpKd5a+gMRysu5spzwwMlpgiZibgZypDCnp0hFgek7IucCQWIIzWTcbYfx7GpgVnS0IpEuHqf5G8C4/+sqVQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bbl6W8qXkjHACMMgc+vQoBdnDOQoOAEQb3ODicDzs2QRn2Q7H8JWBzLRauMLL+rHLcyZT+5K6+lHeR9jdX7Vq3r/ftDJzox4SxtSMrFhljbvNOx7xztFzIANaUtC4ptCo0OnHXQ8VpNk9b8uMzZ5JawfB/46/H2tgjnjTI+LbzEDEkzytXGxlobqy4Ueg2XK7XJ65KQTINDXgaQF87CcEqt90AiwMfAKThtNbpSFcBGHO6xmn+UcRodqOE+DYjqyK1ZPpps1crL7/bm9zDBvbXr7vdqou3ELctPfLTwfu28d+C1tfNgxRwQinwPxsL+Epew3Yie7cXk5OBL1fNRuiA==
- Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=oracle.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, stable@xxxxxxxxxxxxxxx, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 29 Oct 2021 21:47:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 10/29/21 10:20 AM, Juergen Gross wrote:
--- a/Documentation/ABI/stable/sysfs-devices-system-xen_memory
+++ b/Documentation/ABI/stable/sysfs-devices-system-xen_memory
@@ -84,3 +84,13 @@ Description:
Control scrubbing pages before returning them to Xen for others
domains
use. Can be set with xen_scrub_pages cmdline
parameter. Default value controlled with
CONFIG_XEN_SCRUB_PAGES_DEFAULT.
+
+What: /sys/devices/system/xen_memory/xen_memory0/boot_timeout
+Date: November 2021
+KernelVersion: 5.16
+Contact: xen-devel@xxxxxxxxxxxxxxxxxxxx
+Description:
+ The time (in seconds) to wait before giving up to boot in case
+ initial ballooning fails to free enough memory. Applies only
+ when running as HVM or PVH guest and started with less memory
+ configured than allowed at max.
How is this going to be used? We only need this during boot.
- state = update_schedule(state);
+ balloon_state = update_schedule(balloon_state);
Now that balloon_state has whole file scope it can probably be updated inside
update_schedule().
+ while ((credit = current_credit()) < 0) {
+ if (credit != last_credit) {
+ last_changed = jiffies;
+ last_credit = credit;
+ }
+ if (balloon_state == BP_ECANCELED) {
What about other states? We are really waiting for BP_DONE, aren't we?
-boris
+ pr_warn_once("Initial ballooning failed, %ld pages need to
be freed.\n",
+ -credit);
+ if (jiffies - last_changed >=
+ HZ * balloon_stats.boot_timeout)
+ panic("Initial ballooning failed!\n");
+ }
+
|