mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Oeser <ioe-lkml@rameria.de>
To: linux-kernel@vger.kernel.org
Cc: Anton Blanchard <anton@samba.org>, akpm@osdl.org, rusty@rustcorp.com.au
Subject: Re: [PATCH] __alloc_bootmem_node should not panic when it fails
Date: Sun, 27 Jun 2004 08:27:26 +0200	[thread overview]
Message-ID: <200406270827.28310.ioe-lkml@rameria.de> (raw)
In-Reply-To: <20040627052747.GG23589@krispykreme>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 27 June 2004 07:27, Anton Blanchard wrote:
> The following patch does that. We fall back to the regular
> __alloc_bootmem when __alloc_bootmem_node fails, which means all other
> nodes are checked for available memory.
 
But allocating from other nodes has performance implications, which
might be quite big, depending on the specific architecture. So you
should at least print an KERN_INFO or even KERN_WARNING message, 
if this happens.

> Signed-off-by: Anton Blanchard <anton@samba.org>
> 
> diff -puN mm/bootmem.c~debugit mm/bootmem.c
> --- gr_work/mm/bootmem.c~debugit	2004-06-06 21:49:20.729826223 -0500
> +++ gr_work-anton/mm/bootmem.c	2004-06-06 22:07:16.840243987 -0500
> @@ -371,11 +371,6 @@ void * __init __alloc_bootmem_node (pg_d
>  	if (ptr)
>  		return (ptr);
>  
> -	/*
> -	 * Whoops, we cannot satisfy the allocation request.
> -	 */
> -	printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size);
Maybe changing this message to:
	printk(KERN_WARNING "Failed to alloc %lu bytes from local node.\n"
	" Allocating from distant node instead. Performance may drop!\n", size);

> -	panic("Out of memory");
> -	return NULL;
> +	return __alloc_bootmem(size, align, goal);
>  }

So now the user knows what is going on and that this node might need
more memory ;-)

Regards

Ingo Oeser

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA3mjOU56oYWuOrkARAuQGAJ9lasSDYLgMDzAGnGYxnH4OpSHXNQCg0uy3
12GFsxYaaptUIZkYHYUw9Is=
=1ydw
-----END PGP SIGNATURE-----

  reply	other threads:[~2004-06-27 16:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-27  5:27 Anton Blanchard
2004-06-27  6:27 ` Ingo Oeser [this message]
2004-06-27 22:28   ` Anton Blanchard
2004-06-28  6:29     ` Chris Wedgwood
2004-06-28 12:04       ` Robert Picco
2004-06-28 18:26       ` Martin Hicks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200406270827.28310.ioe-lkml@rameria.de \
    --to=ioe-lkml@rameria.de \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®