Re: [PATCH v3 03/21] s390/ap: Introduce ap message buffer pool

Heiko Carstens
2025-03-31T10:46:42Z

On Thu, Mar 27, 2025 at 03:39:23PM +0100, Harald Freudenberger wrote:
> +/*
> + * There is a need for a do-not-allocate-memory path through the
> + * ap bus layer. When ap_init_apmsg() with use_mempool set to true

Please describe exactly what the need for this path is. The current
description leaves the question: "why exactly is this needed?". And
this may confuse future readers: is this still needed?

Does this depend on (atomic?) context? Or is it just to avoid I/O?
If so, why?

> + /* create ap msg buffer memory pool */
> + ap_msg_pool = mempool_create_kmalloc_pool(ap_msg_pool_min_items,
> + AP_DEFAULT_MAX_MSG_SIZE);
> + if (IS_ERR(ap_msg_pool)) {
> + ap_msg_pool = NULL;
> + goto out;
> + }

This is not correct. mempool_create_kmalloc_pool() returns NULL on error.
Furthermore rc is not initialized on error (out path); you need to
preinitialize rc to -ENOMEM.