@@ -84,6 +84,7 @@ struct rxe_type_info rxe_type_info[RXE_NUM_TYPES] = {
.name = "rxe-mc_elem",
.size = sizeof(struct rxe_mc_elem),
.elem_offset = offsetof(struct rxe_mc_elem, pelem),
+ /* is created at interrupt level so avoid sleeps */
.flags = RXE_POOL_ATOMIC,
},
};
@@ -337,14 +338,13 @@ void __rxe_drop_index(struct rxe_pool_entry *elem)
write_unlock_irqrestore(&pool->pool_lock, flags); }
+/* only called while holding pool->pool_lock so must use GFP_ATOMIC */
void *rxe_alloc_nl(struct rxe_pool *pool) {
struct rxe_type_info *info = &rxe_type_info[pool->type];
struct rxe_pool_entry *elem;
u8 *obj;
- might_sleep_if(!(pool->flags & RXE_POOL_ATOMIC));
-
if (pool->state != RXE_POOL_STATE_VALID)
return NULL;
@@ -356,8 +356,7 @@ void *rxe_alloc_nl(struct rxe_pool *pool)
if (atomic_inc_return(&pool->num_elem) > pool->max_elem)