Re: [PATCH 13/21] binder: relocate low space calculation

From: Alice Ryhl
Date: Tue Nov 07 2023 - 04:09:08 EST


Carlos Llamas <cmllamas@xxxxxxxxxx> writes:
> Move the low async space calculation to debug_low_async_space_locked().
> This logic not only fits better here but also offloads some of the many
> tasks currently done in binder_alloc_new_buf_locked().
>
> No functional change in this patch.
>
> Signed-off-by: Carlos Llamas <cmllamas@xxxxxxxxxx>

One suggestion below, but I'm fine either way.

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>


Carlos Llamas <cmllamas@xxxxxxxxxx> writes:
> + if (debug_low_async_space_locked(alloc))
> + buffer->oneway_spam_suspect = true;

You could avoid a branch here like this:

buffer->oneway_spam_suspect = debug_low_async_space_locked(alloc);

Alice