Re: buddy system
From: chrismiceli (chrismiceli_at_excite.com)
Date: 03/17/04
- Next message: P.T. Breuer: "Re: buddy system"
- Previous message: Josef Möllers: "Re: PCI device driver vs SCSI device driver"
- In reply to: Kasper Dupont: "Re: buddy system"
- Next in thread: P.T. Breuer: "Re: buddy system"
- Reply: P.T. Breuer: "Re: buddy system"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 17 Mar 2004 05:57:02 -0800
Kasper Dupont <kasperd@daimi.au.dk> wrote in message news:<4057F932.865F8398@daimi.au.dk>...
> chrismiceli wrote:
> >
> > I am reading "Understanding the Linux Kernel" (2nd edition) and they
> > are describing the buddy system for allocating contiguous blocks of
> > memory. I mustn't be grasping the system, could someone explain it to
> > me. A good resource would be nice as well describing the buddy system.
> > Thanx in advanced.
>
> It is quite simple. Memory allocation is done in
> chunks of 2^n pages of alligned memory. Where n
> can be anything from 0 to some upper limit.
>
> There is a free list for each n, and each time a
> chunk has been released, there is exactly one
> possible other chunk of the same size it could be
> joined with.
>
> In case there is no free chunks of a specific size,
> a larger allocation can be split in two.
I get the concept, but when I look at the code given in the book, I
can't follow it. Particularly the rmqueue function. I understand the
alloc_pages function. Now that I look at the 2.4.26 src, I see the
code is different than the book, I will try to understand this one,
but any further explanation on these functions could be helpful.
Thanx.
- Next message: P.T. Breuer: "Re: buddy system"
- Previous message: Josef Möllers: "Re: PCI device driver vs SCSI device driver"
- In reply to: Kasper Dupont: "Re: buddy system"
- Next in thread: P.T. Breuer: "Re: buddy system"
- Reply: P.T. Breuer: "Re: buddy system"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|