Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Graceful failure instead of panicking in kmem_malloc
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joshua Isom  
View profile  
 More options Jan 9 2008, 4:53 am
Newsgroups: fa.freebsd.hackers
From: Joshua Isom <jri...@gmail.com>
Date: Wed, 09 Jan 2008 09:53:53 UTC
Local: Wed, Jan 9 2008 4:53 am
Subject: Re: Graceful failure instead of panicking in kmem_malloc

On Jan 8, 2008, at 9:25 PM, Bharma Ji wrote:

> Thanks for the response. I am hoping to keep some memory aside  
> specifically
> for handling out of memory allocation situations. Yes the real fix is  
> to
> avoid out of memory allocation. Thanks for the patch. Will try that.  
> As a
> first cut I am just trying to handle failure gracefully.

> So asking again - if there is any way already discussed or  
> standardized to
> make the system handle failures gracefully

> On Jan 8, 2008 4:30 PM, Kris Kennaway <k...@freebsd.org> wrote:

>> Bharma Ji wrote:
>>> In FreeBSD 6_2, if kmem_malloc is unable to find space it panics. The
>>> relevant code is in vm_kern.c
>>>   if ((flags & M_NOWAIT) == 0)
>>>                          panic("kmem_malloc(%ld): kmem_map too small:
>> %ld
>>> total allocated",
>>>                                 (long)size, (long)map->size);

>>> Is there any way to make the system log and then gracefully shut off
>> instead
>>> of panicking?

>> Not really, because those actions require memory allocation.  The real
>> fix is to either

>> a) avoid running out of memory in the first place by tuning  
>> vm.kmem_size

>> b) perhaps trying harder to avoid panicking by first trying to more
>> aggressively reclaim memory.

>> You can try

>> http://www.freebsd.org/~pjd/patches/vm_kern.c.2.patch<http://
>> www.freebsd.org/%7Epjd/patches/vm_kern.c.2.patch>

>> which implements b) (patch against 7.0, but might apply to 6.2  
>> unchanged).

>> Kris

> _______________________________________________
> freebsd-hack...@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to  
> "freebsd-hackers-unsubscr...@freebsd.org"

Why not try to take out some user processes?  Going with a combination  
of process priority and memory usage, it should at least be more  
tolerable than a panic.

_______________________________________________
freebsd-hack...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.