From nobody Wed Jul 21 20:56:58 2021 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E7864127D0E6 for ; Wed, 21 Jul 2021 20:57:13 +0000 (UTC) (envelope-from freebsd-stable@m.gmane-mx.org) Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVSZJ4sGGz4vph for ; Wed, 21 Jul 2021 20:57:12 +0000 (UTC) (envelope-from freebsd-stable@m.gmane-mx.org) Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1m6JH5-0005pq-JH for freebsd-stable@freebsd.org; Wed, 21 Jul 2021 22:57:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-stable@freebsd.org From: Johannes Totz Subject: Re: CPU hot-plug and RAM hot-add in virtual machines Date: Wed, 21 Jul 2021 21:56:58 +0100 Message-ID: References: <4336a1bf-d826-dba3-9ec1-9b48cf7cd177@quip.cz> <70033628-bc3a-24d2-4c65-9a3b9c1c66d5@FreeBSD.org> <14d647fe-5bc3-b69e-e074-6202b2418d22@FreeBSD.org> List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 In-Reply-To: Content-Language: en-GB X-Rspamd-Queue-Id: 4GVSZJ4sGGz4vph X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=jo-t.de (policy=none); spf=pass (mx1.freebsd.org: domain of freebsd-stable@m.gmane-mx.org designates 116.202.254.214 as permitted sender) smtp.mailfrom=freebsd-stable@m.gmane-mx.org X-Spamd-Result: default: False [0.11 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[116.202.254.214:from]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.993]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[116.202.254.214:from:127.0.2.255]; DMARC_POLICY_SOFTFAIL(0.10)[jo-t.de : SPF not aligned (relaxed), No valid DKIM,none]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_SHORT(-1.00)[-0.999]; FORGED_SENDER(0.30)[johannes@jo-t.de,freebsd-stable@m.gmane-mx.org]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:116.202.0.0/16, country:DE]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; FROM_NEQ_ENVFROM(0.00)[johannes@jo-t.de,freebsd-stable@m.gmane-mx.org]; MAILMAN_DEST(0.00)[freebsd-stable] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On 21/07/2021 13:07, Miroslav Lachman wrote: > On 21/07/2021 12:45, Andriy Gapon wrote: >> On 21/07/2021 11:53, Miroslav Lachman wrote: >>> On 09/07/2021 13:16, Andriy Gapon wrote: > > [..] > >>> Thank you for your reply. I know nothing about system internals. Is >>> it too much work to implement it or just nobody from developers need >>> it thus nobody write the code? Virtualization is more and more >>> popular these days so I think it will be useful for many users. >> >> In my opinion, both would be big changes. >> At the moment we do not have any support for offlining / onlining CPUs >> and that would involve a lot of careful changes like safely updating >> CPU sets, various CPU masks, etc. >> >> Ditto for the memory.  Updating page arrays, free memory accounting >> structures, possibly some memory maps, etc. >> >> Definitely not a weekend project. > > Thank you again. It really seems too complicated. Have you tried messing around with virtio_balloon(4)? It's the other way around though. You'd overprovision the VM, then balloon memory away and later on give it back, if needed.