mm/page: remove the stupid
This commit is contained in:
parent
c6c92ac39f
commit
21798e1396
1 changed files with 4 additions and 4 deletions
|
@ -372,7 +372,7 @@ static __always_inline bool can_merge(vm_page_t page, vm_page_t buddy)
|
||||||
/* we know that `page' is not reserved, because we
|
/* we know that `page' is not reserved, because we
|
||||||
* check that flag before we even attempt coalition */
|
* check that flag before we even attempt coalition */
|
||||||
const unsigned mask = _PGA_RSVD_MASK | _PGA_ZONE_MASK;
|
const unsigned mask = _PGA_RSVD_MASK | _PGA_ZONE_MASK;
|
||||||
merge &= (atom_read(&page->attr) & mask) == (atom_read(&page->attr) & mask);
|
merge &= (atom_read(&page->attr) & mask) == (atom_read(&buddy->attr) & mask);
|
||||||
|
|
||||||
return merge;
|
return merge;
|
||||||
}
|
}
|
||||||
|
@ -398,13 +398,13 @@ void free_pages(void *ptr)
|
||||||
init_pages(ptr, PAGE_POISON_FREE, order);
|
init_pages(ptr, PAGE_POISON_FREE, order);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int old_count = atom_sub(&page->count, 1);
|
|
||||||
PAGE_DEBUG_BLOCK {
|
PAGE_DEBUG_BLOCK {
|
||||||
|
int old_count = atom_sub(&page->count, 1);
|
||||||
if (old_count != 1) {
|
if (old_count != 1) {
|
||||||
if (old_count == 0)
|
if (old_count == 0)
|
||||||
page_debug("double free of page %p", ptr);
|
page_debug("double free of %p", ptr);
|
||||||
else
|
else
|
||||||
page_debug("attempted to free page %p with references", ptr);
|
page_debug("attempted to free %p with references", ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue