* runtime/stp_utrace.stp (utrace_init): Don't SLAB_PANIC on duplicate
kmem_cache names, as is sadly likely for concurrent inode-uprobes
scripts running on CONFIG_DEBUG_VM kernels.
* runtime/linux/task_finder2.c (stap_start_task_finder): Deign to check
the utrace_init return code, and fail with a touch of grey grace.
return EBUSY;
}
- utrace_init();
+ rc = utrace_init();
+ if (rc != 0) { /* PR14781, handle utrace alloc failure. */
+ /* Decrement this back down to UNITIALIZED, to keep
+ a stap_stop_task_finder() from trying to clean up. */
+ atomic_dec(&__stp_task_finder_state);
+ _stp_error("Failed to initialize utrace hooks");
+ return ENOMEM; /* XXX: or some other one. */
+ }
mmpath_buf = _stp_kmalloc(PATH_MAX);
if (mmpath_buf == NULL) {
INIT_HLIST_HEAD(&task_utrace_table[i]);
}
- utrace_cachep = KMEM_CACHE(utrace, SLAB_PANIC);
+ utrace_cachep = KMEM_CACHE(utrace, 0);
if (unlikely(!utrace_cachep))
goto error;
- utrace_engine_cachep = KMEM_CACHE(utrace_engine, SLAB_PANIC);
+ utrace_engine_cachep = KMEM_CACHE(utrace_engine, 0);
if (unlikely(!utrace_engine_cachep))
goto error;