From: Martin Maletinsky <maletinsky@scs.ch>
To: linux-mm@kvack.org
Cc: paul@scs.ch
Subject: Question concerning the buddy allocator
Date: Mon, 23 Jul 2001 12:23:27 +0200 [thread overview]
Message-ID: <3B5BFB1F.F2967398@scs.ch> (raw)
Hello,
I am interested, if physically contiguous memory allocated from the buddy allocator may be freed in a different way than it was allocated. I.e. if a memory blocks of size
(2^x)*PAGE_SIZE allocated by one call to the buddy allocator can be freed in fragments of (2^y)*PAGE_SIZE, with 2^(x-y) successive calls to the buddy allocator, where y < x
and the fragments start at an address which is a multiple of (2^y)*PAGE_SIZE.
I looked it up in the 2.2.x and 2.4.x code, and performed some experiments with the 2.4.x code, and I found that freeing the memory blocks in multiple fragments was
possible. However, in order to free the fragments, the count field in the descriptor of the first page in each fragment needs to be set to 1. (This is because
__free_pages() checks the count field of the first pages descriptor before calling __free_pages_ok(), if the count field is not zero, no further action is taken and the
__free_pages() returns, i.e. no pages are re-inserted into the buddy allocation system.).
Can anyone tell me:
- If the proceeding I described (i.e. setting the count field to 1) is a 'legal' way to free fragments, and if not if there is another 'legal' way to do so. May the
modification of the page descriptor's count field have any undesired side-effects?
- What is the reason behind the check of the count field of the first page's descriptor in __free_pages().
Thank's for your help
regards
Martin
--
Supercomputing System AG email: maletinsky@scs.ch
Martin Maletinsky phone: +41 (0)1 445 16 05
Technoparkstrasse 1 fax: +41 (0)1 445 16 10
CH-8005 Zurich
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/
reply other threads:[~2001-07-23 10:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3B5BFB1F.F2967398@scs.ch \
--to=maletinsky@scs.ch \
--cc=linux-mm@kvack.org \
--cc=paul@scs.ch \
/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