Changeset ad64a2d in mainline for generic/src/mm/frame.c


Ignore:
Timestamp:
2006-03-19T21:51:31Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d25b44
Parents:
7c7aae16
Message:

Fix bug with refcounts in frame allocator after zone_merge. (it caused some
frames not to be coalesced).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/mm/frame.c

    r7c7aae16 rad64a2d  
    538538        }
    539539        /* Copy frames from both zones to preserve full frame orders,
    540          * parents etc. Set all frames with refcount=0 to 1, because
     540         * parents etc. Set all free frames with refcount=0 to 1, because
    541541         * we add all free frames to buddy allocator later again, clear
    542          * order to 0.
     542         * order to 0. Don't set busy frames with refcount=0, as they
     543         * will not be reallocated during merge and it would make later
     544         * problems with allocation/free.
    543545         */
    544546        for (i=0; i<z1->count; i++)
     
    548550                z->frames[z2idx] = z2->frames[i];
    549551        }
    550         for (i=0; i < z->count; i++) {
    551                 if (!z->frames[i].refcount) {
     552        i = 0;
     553        while (i < z->count) {
     554                if (z->frames[i].refcount) {
     555                        /* skip busy frames */
     556                        i += 1 << z->frames[i].buddy_order;
     557                } else { /* Free frames, set refcount=1 */
     558                        /* All free frames have refcount=0, we need not
     559                         * to check the order */
    552560                        z->frames[i].refcount = 1;
    553561                        z->frames[i].buddy_order = 0;
     562                        i++;
    554563                }
    555564        }
Note: See TracChangeset for help on using the changeset viewer.