From: Jeff Dike <jdike@addtoit.com>
To: blaisorblade_spam@yahoo.it
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Re: [patch 1/1] Fix malloc-use-vmalloc
Date: Tue, 13 Jul 2004 13:57:35 -0400 [thread overview]
Message-ID: <200407131757.i6DHvZGu003047@ccure.user-mode-linux.org> (raw)
In-Reply-To: Your message of "Sun, 04 Jul 2004 12:56:32 +0200." <20040704105632.DC0B378A@zion.localdomain>
blaisorblade_spam@yahoo.it said:
> * Avoid allocating more than one page at once: that can require moving
> pages around to have two contiguos pages, so we're better with
> vmalloc.
Yup, makes sense.
> * Make sure we free() someway, inside __wrap_free.
This isn't exactly right. In the case that a buffer was allocated by kmalloc
(through malloc), but freed when the system is coming down, and kmalloc is no
longer operating, then you just want to do nothing. It would be very bad to
try to free it using libc free.
So, what I did is this:
if((addr >= uml_physmem) && (addr <= high_physmem)){
if(CAN_KMALLOC())
kfree(ptr);
}
else if((addr >= start_vm) && (addr <= end_vm)){
if(CAN_KMALLOC())
vfree(ptr);
}
else __real_free(ptr);
Jeff
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2004-07-13 17:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-04 10:56 [uml-devel] [patch 1/1] Fix malloc-use-vmalloc blaisorblade_spam
2004-07-13 17:57 ` Jeff Dike [this message]
2004-07-22 15:55 ` [uml-devel] " BlaisorBlade
2004-07-26 18:18 ` Jeff Dike
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=200407131757.i6DHvZGu003047@ccure.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=blaisorblade_spam@yahoo.it \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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