From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-patches-bounces+larch=yhetil.org@gnu.org>
Received: from mp12.migadu.com ([2001:41d0:2:bcc0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id iG4nMtnvnGNUfwAAbAwnHQ
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Fri, 16 Dec 2022 23:23:21 +0100
Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp12.migadu.com with LMTPS
	id UCsRMtnvnGMKNQEAauVa8A
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Fri, 16 Dec 2022 23:23:21 +0100
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 4B41D3466E
	for <larch@yhetil.org>; Fri, 16 Dec 2022 23:23:21 +0100 (CET)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-patches-bounces@gnu.org>)
	id 1p6Iw1-000796-8p; Fri, 16 Dec 2022 17:12:05 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1p6Ivz-00074V-6I
 for guix-patches@gnu.org; Fri, 16 Dec 2022 17:12:03 -0500
Received: from debbugs.gnu.org ([209.51.188.43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1p6Ivy-0006wT-UF
 for guix-patches@gnu.org; Fri, 16 Dec 2022 17:12:02 -0500
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1p6Ivy-0007OR-AV
 for guix-patches@gnu.org; Fri, 16 Dec 2022 17:12:02 -0500
X-Loop: help-debbugs@gnu.org
Subject: [bug#60129] [PATCH 0/2] VM-optimized Linux-Libre variant
Resent-From: Marius Bakke <marius@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: guix-patches@gnu.org
Resent-Date: Fri, 16 Dec 2022 22:12:02 +0000
Resent-Message-ID: <handler.60129.B.167122871828411@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: report 60129
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 60129@debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@gnu.org
Received: via spool by submit@debbugs.gnu.org id=B.167122871828411
 (code B ref -1); Fri, 16 Dec 2022 22:12:02 +0000
Received: (at submit) by debbugs.gnu.org; 16 Dec 2022 22:11:58 +0000
Received: from localhost ([127.0.0.1]:51814 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1p6Ivt-0007OB-I5
 for submit@debbugs.gnu.org; Fri, 16 Dec 2022 17:11:57 -0500
Received: from lists.gnu.org ([209.51.188.17]:52834)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <marius@gnu.org>) id 1p6Ivr-0007O5-6O
 for submit@debbugs.gnu.org; Fri, 16 Dec 2022 17:11:56 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <marius@gnu.org>) id 1p6Ivp-0006rn-CF
 for guix-patches@gnu.org; Fri, 16 Dec 2022 17:11:54 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <marius@gnu.org>) id 1p6Ivn-0006tC-NT
 for guix-patches@gnu.org; Fri, 16 Dec 2022 17:11:52 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to:
 references; bh=k1kr2U+Jb7KAFuchqU/1fxUopmjVKyjcvhBGmlCMmJQ=; b=r4t8xt+i2F93oO
 PHTI8ynWBZ1p/qW4iFIzyWaAV05cKMHcP6YZXz+XZerbWGCfq+hiNf9+xG0QGk8A1/uTAcnuNAPED
 LC7lzWLA7PhULBhErTqTnPNCgndYstJSB5RMU1KRX0l6IYGkVIjOOPIfk9tNK1qzOafj+Oii2PT/H
 NlldY2P7sNEw8RSLRIxXqgPxRoEf3PQtnv8dF1OAeHQvu221YB9wLEOn62BLsCEzPZT2YTqa3ViC9
 ll1VYhw8cEiwjuOWitydmX3gmVggbN3t1IeV5ZopNnx2TLbdc9/m35j4hBBGTVaoR93Z7WtOR/aRq
 CVSx4N8irYfAhulM/cdA==;
Received: from [188.113.115.135] (helo=localhost)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <marius@gnu.org>) id 1p6Ivl-0004ec-OV
 for guix-patches@gnu.org; Fri, 16 Dec 2022 17:11:50 -0500
From: Marius Bakke <marius@gnu.org>
Date: Fri, 16 Dec 2022 23:11:47 +0100
Message-Id: <20221216221147.13945-1-marius@gnu.org>
X-Mailer: git-send-email 2.38.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: guix-patches@gnu.org
List-Id: <guix-patches.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-patches>
List-Post: <mailto:guix-patches@gnu.org>
List-Help: <mailto:guix-patches-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=subscribe>
Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org
Sender: guix-patches-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671229401; a=rsa-sha256; cv=none;
	b=cj25j8NK5mCOufsXoCj17kP0yhiHlN1XmZzvBdo/3t/ibnPc7RH9VsGxRIcrrfBmidvjtC
	W1X6SYsQS251ernD/EWFM9VktetBWFTmd7rTEvwwRKNkpd2EsAfeUCjOyBATJxu4rbBVoN
	1OjR+MYt4MasRhYJg14z6NoPk+Te02oDTnsv7l41lbpZwrpI8wLbu4IqQ5FUMyc4/SRkYS
	HK9HpkKtFxOVMjzaXsFPa7PosR6IgqkjqpNqWieG35O2oaKUideCXW6pkTFExtsn7+RPGF
	iXQ45Ij/G64iiYZgQA9J/FxIpDUGuQMGTALdAUE5QkATFWz5xmR4y8cj+fmQDw==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=r4t8xt+i;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=gnu.org
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1671229401;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:resent-cc:
	 resent-from:resent-sender:resent-message-id:list-id:list-help:
	 list-unsubscribe:list-subscribe:list-post:dkim-signature;
	bh=k1kr2U+Jb7KAFuchqU/1fxUopmjVKyjcvhBGmlCMmJQ=;
	b=HtFJEp6DG9hHC2tN8hbgTcFX869fQKhZpC0/ZxOEHih1GSwU2G0IcDyuHqP5qn4BoFrhIJ
	nKki9zb1sAzF8MuV5rrsTUewGcppLQ6z2M3CMo1p6zRIEljnd4HdYdhowMY5iRUxuwcV5d
	7LWCr1Rh3KblD5AKQ+LE0e/QMUHN+/Pt6Q+Ih5MBlUOG/pepEB2vyvZUd3WrDngv55um/N
	t6/ISAMHOh6k5UKLVwNUcIazxXKCE6FczQ1Itk0pm1WBGrBbCfmNL5aZ6aqtKHyxtITT2Z
	Hlv5X7xsAGKvIqE5l49eZlCFyCq7Q8jHkIWw/y5DvagZhSA0i9auKRb84IdEaQ==
X-Migadu-Spam-Score: -2.38
X-Spam-Score: -2.38
X-Migadu-Queue-Id: 4B41D3466E
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=r4t8xt+i;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=gnu.org
X-Migadu-Scanner: scn1.migadu.com
X-TUID: M8Vm6SVZn1v8

Hello Guix!

This patch adds a kernel optimized for running inside a VM.

It includes drivers for the popular hypervisors and not much else.
Building it takes ~9 minutes on my machine (7,5 if we disable
CONFIG_TRIM_UNUSED_KSYMS).

The config was created by taking the linux-libre config and removing
things that are generally useless in VMs: hardware drivers, firmware
loading, sleep/hibernate, etc.

The only drivers included are for various hypervisors, the ones required
by our initrd[*], as well as popular emulated hardware (e1000, rtl8169,
sound hardware supported by QEMU, etc).  It's possible some things need
to be re-added to support all the different VPS providers out there.

The kernel is tailored towards server workloads running on a VPS, but
should work fine as a default for "guix system vm", etc.

Some statistics:

  | benchmark               | linux-libre   | linux-libre-virtual |
  |-------------------------|---------------|---------------------|
  | guix size               | 101.4 MiB     | 36.2 MiB            |
  | cpu events/s            | 2707.92       | 2709.19             |
  | 200GiB random mem wr    | 1203.26 MiB/s | 1204.26 MiB/s       |
  | avg thread latency      | 0.89ms        | 0.86ms              |

These numbers were obtained by running two identical VMs mapped to the
same physical cores on an idle host (with static CPU frequency).

(the benchmarks in question were taken with 'sysbench', with the
best out of 3 runs.  Generally -virtual is marginally ahead.)

Thoughts?  Is this useful at all?  Any more interesting benchmarks?

[*] I considered making it module-less; i.e. everything built-in, but
most of our tooling expects an initrd, so maybe not worth the trouble.

Marius Bakke (2):
  activation: Firmware activation handles missing support in kernel.
  gnu: Add linux-libre-virtual.

 Makefile.am                                   |    1 +
 gnu/build/activation.scm                      |    9 +-
 .../linux-libre/6.0-x86_64-virtual.conf       | 5881 +++++++++++++++++
 gnu/packages/linux.scm                        |   11 +
 4 files changed, 5899 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/aux-files/linux-libre/6.0-x86_64-virtual.conf

-- 
2.38.0