Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 9 years ago

Closed 9 years ago

#234 closed defect (fixed)

make_magcache() uses blocking malloc() while holding slab_cache_lock spinlock

Reported by: Jakub Jermář Owned by:
Priority: major Milestone: 0.4.3
Component: helenos/kernel/generic Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

When called from slab_enable_cpucache(), make_magcache() uses blocking malloc() while holding slab_cache_lock spinlock.

Change History (2)

comment:1 Changed 9 years ago by Jakub Jermář

slab_enable_cpucache() is called only once during system start-up and since magazines are just an optimization, we can probably afford to call malloc() from make_magcache() in a non-blocking mode and gracefully fail make_magcache() if no memory is allocated.

make_magcache() is called also from slab_cache_create() and since all caches are created during system startup, we can apply the same strategy as above, print a warning and possibly modify make_magcache() to signal the failure via a return value.

Note that if we cannot allocate memory this early during system startup, there is already something wrong with the system and the system will hardly boot successfully anyway.

comment:2 Changed 9 years ago by Jakub Jermář

Resolution: fixed
Status: newclosed

Fixed in changeset:head,416.

Note: See TracTickets for help on using tickets.