patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [PATCH] host: use a bigger kernel buffer for mdevd
@ 2022-04-23 12:46 Alyssa Ross
  2022-04-23 14:39 ` Alyssa Ross
  0 siblings, 1 reply; 2+ messages in thread
From: Alyssa Ross @ 2022-04-23 12:46 UTC (permalink / raw)
  To: devel

This should fix a boot error on a Thinkpad P51s:

> mdevd: fatal: unable to receive netlink message: No buffer space available

>From the mdevd documentation:

> • -b kbufsz : try and reserve a kernel buffer of kbufsz bytes for
>   the netlink queue. Too large a buffer wastes kernel memory; too
>   small a buffer risks losing events. The default is 500 kB, which
>   should be enough for most systems; if you're getting "No buffer
>   space available" errors from mdevd at coldplug time, try
>   increasing this number.

The new value of 128MiB is used by default by both udev and Busybox's mdev.
---
I'm hoping this will fix the problem reported by terwiz in #spectrum.

 host/initramfs/etc/init         | 2 +-
 host/rootfs/etc/s6-rc/mdevd/run | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/host/initramfs/etc/init b/host/initramfs/etc/init
index bb58c84..e6236bc 100755
--- a/host/initramfs/etc/init
+++ b/host/initramfs/etc/init
@@ -19,7 +19,7 @@ if { mkfifo /dev/rootfs.poll }
 
 background {
   fdclose 3
-  mdevd -C
+  mdevd -C -b134217728
 }
 importas -iu mdevd_pid !
 
diff --git a/host/rootfs/etc/s6-rc/mdevd/run b/host/rootfs/etc/s6-rc/mdevd/run
index 03ad5e3..22f0127 100644
--- a/host/rootfs/etc/s6-rc/mdevd/run
+++ b/host/rootfs/etc/s6-rc/mdevd/run
@@ -2,4 +2,4 @@
 # SPDX-License-Identifier: EUPL-1.2
 # SPDX-FileCopyrightText: 2020-2021 Alyssa Ross <hi@alyssa.is>
 
-mdevd -D3
+mdevd -D3 -b134217728

base-commit: 92e918a477dc7a16460a73d466fc2d42f7e7c421
-- 
2.35.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] host: use a bigger kernel buffer for mdevd
  2022-04-23 12:46 [PATCH] host: use a bigger kernel buffer for mdevd Alyssa Ross
@ 2022-04-23 14:39 ` Alyssa Ross
  0 siblings, 0 replies; 2+ messages in thread
From: Alyssa Ross @ 2022-04-23 14:39 UTC (permalink / raw)
  To: Alyssa Ross, devel

This patch has been committed as 0b3b366653030de498e73e51b1c12a6f4c5f4d3b,
which can be viewed online at
https://spectrum-os.org/git/spectrum/commit/?id=0b3b366653030de498e73e51b1c12a6f4c5f4d3b.

This is an automated message.  Send comments/questions/requests to:
Alyssa Ross <hi@alyssa.is>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-23 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-23 12:46 [PATCH] host: use a bigger kernel buffer for mdevd Alyssa Ross
2022-04-23 14:39 ` Alyssa Ross

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).