From 06cc7bf916cd562bf23b3929ca607f66a20850f0 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 22 Dec 2022 21:20:17 +0100 Subject: Warn only once about not being able to recycle pages --- ipc/mach_port.c | 2 +- linux/dev/glue/block.c | 5 ++++- linux/src/drivers/block/ide.c | 5 ++++- vm/vm_page.c | 10 +++++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ipc/mach_port.c b/ipc/mach_port.c index db6e05dc..3b00f387 100644 --- a/ipc/mach_port.c +++ b/ipc/mach_port.c @@ -534,7 +534,7 @@ mach_port_allocate( * KERN_INVALID_NAME The name doesn't denote a right. */ -static volatile boolean_t mach_port_deallocate_debug = FALSE; +static volatile boolean_t mach_port_deallocate_debug = TRUE; kern_return_t mach_port_destroy( diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c index 6730c5ec..950413df 100644 --- a/linux/dev/glue/block.c +++ b/linux/dev/glue/block.c @@ -207,7 +207,10 @@ int blk_dev_init () { #ifdef CONFIG_BLK_DEV_IDE - ide_init (); + extern char *kernel_cmdline; + if (strncmp(kernel_cmdline, "noide", 5) && + !strstr(kernel_cmdline, " noide")) + ide_init (); #endif #ifdef CONFIG_BLK_DEV_FD floppy_init (); diff --git a/linux/src/drivers/block/ide.c b/linux/src/drivers/block/ide.c index 2d0fc77e..f3b78831 100644 --- a/linux/src/drivers/block/ide.c +++ b/linux/src/drivers/block/ide.c @@ -3725,7 +3725,10 @@ static void probe_for_hwifs (void) #ifdef CONFIG_BLK_DEV_PROMISE init_dc4030(); #endif - ahci_probe_pci(); + extern char *kernel_cmdline; + if (strncmp(kernel_cmdline, "noahci", 6) && + !strstr(kernel_cmdline, " noahci")) + ahci_probe_pci(); } static int hwif_init (int h) diff --git a/vm/vm_page.c b/vm/vm_page.c index 87185c15..707be4bb 100644 --- a/vm/vm_page.c +++ b/vm/vm_page.c @@ -2040,7 +2040,15 @@ again: * TODO Find out what could cause this and how to deal with it. * This will likely require an out-of-memory killer. */ - printf("vm_page warning: unable to recycle any page"); + + { + static boolean_t warned = FALSE; + + if (!warned) { + printf("vm_page warning: unable to recycle any page\n"); + warned = 1; + } + } } simple_unlock(&vm_page_queue_free_lock); -- cgit v1.2.3