On 12/22/20 7:43 AM, Willem de Bruijn wrote:
>
>> void sock_zerocopy_put(struct ubuf_info *uarg)
>> {
>> - if (uarg && refcount_dec_and_test(&uarg->refcnt))
>> + if (uarg)
>> uarg->callback(uarg, uarg->zerocopy);
>> }
>> EXPORT_SYMBOL_GPL(sock_zerocopy_put);
>
> This does increase the number of indirect function calls. Which are
> not cheap post spectre.
>
> In the common case for msg_zerocopy we only have two clones, one sent
> out and one on the retransmit queue. So I guess the cost will be
> acceptable.
>
sock_zerocopy_callback seems to be the only one at the moment - or the
most dominant if I goofed my search. Could use the INDIRECT_CALL macros
for it.