Skip to contentSkip to conversation

sk_stream_wait_memory: Query

DISCUSSION Ravish Tayal 1 participant 1 message Aug 26, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

In " tcp_sendmsg" function in 2 situation, tcp code attempts to jump to "wait_for_memory:
" case when
1. it fails to allocate to the new skb [sk_stream_alloc_pskb failure]
2. it fails to allocate new cache page.

and invokes the sk_stream_wait_memory function.

inside which it invokes the
sk_wait_event(sk, &current_timeo, sk_stream_memory_free(sk) &&
vm_wait);

in case if sk_stream_wait_memory is invoked due to skb allocation failure, it would busy loop and would not relinquish the control. [For non-preemptive kernel]

Is it fair expectation, or even this case it should let it current task get scheduled and re try after timer expiry.

regards
Ravish Tayal

in the case if linux kernel is configured as non-premeptive