Changeset d3dfa42 in mainline


Ignore:
Timestamp:
2006-03-12T22:15:13Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9bda3af6
Parents:
2cc5e050
Message:

Fix frame deallocation.
Zone state is to be upadated only when the frame refcount reaches zero.

Location:
generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • generic/include/mm/frame.h

    r2cc5e050 rd3dfa42  
    9999
    100100extern void frame_init(void);
    101 __address frame_alloc_generic(__u8 order, int flags, int * status, int *pzone);
    102 extern void frame_free(__address addr);
     101extern pfn_t frame_alloc_generic(__u8 order, int flags, int * status, int *pzone);
     102extern void frame_free(pfn_t pfn);
    103103
    104104extern int zone_create(pfn_t start, count_t count, pfn_t confframe, int flags);
  • generic/src/mm/frame.c

    r2cc5e050 rd3dfa42  
    311311        }
    312312       
    313 
    314313        if (frame_index_valid(zone, index)) {
    315314                if (zone->frames[index].buddy_order == frame->buddy_order &&
     
    470469        if (!--frame->refcount) {
    471470                buddy_system_free(zone->buddy_system, &frame->buddy_link);
    472         }
    473 
    474         /* Update zone information. */
    475         zone->free_count += (1 << order);
    476         zone->busy_count -= (1 << order);
     471       
     472                /* Update zone information. */
     473                zone->free_count += (1 << order);
     474                zone->busy_count -= (1 << order);
     475        }
    477476}
    478477
     
    601600        }
    602601}
    603 
    604602
    605603/** Reduce allocated block to count of order 0 frames
     
    709707}
    710708
    711 
    712709/**
    713710 * Merge all zones into one big zone
     
    773770}
    774771
    775 
    776772/** Compute configuration data size for zone */
    777773__address zone_conf_size(count_t count)
     
    784780        return size;
    785781}
    786 
    787782
    788783/** Create and add zone to system
Note: See TracChangeset for help on using the changeset viewer.