diff mbox series

[net] tipc: increase timeout in tipc_sk_enqueue()

Message ID 20210913092852.10271-1-hoang.h.le@dektech.com.au (mailing list archive)
State Accepted
Commit f4bb62e64c88c93060c051195d3bbba804e56945
Delegated to: Netdev Maintainers
Headers show
Series [net] tipc: increase timeout in tipc_sk_enqueue() | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Hoang Huu Le Sept. 13, 2021, 9:28 a.m. UTC
In tipc_sk_enqueue() we use hardcoded 2 jiffies to extract
socket buffer from generic queue to particular socket.
The 2 jiffies is too short in case there are other high priority
tasks get CPU cycles for multiple jiffies update. As result, no
buffer could be enqueued to particular socket.

To solve this, we switch to use constant timeout 20msecs.
Then, the function will be expired between 2 jiffies (CONFIG_100HZ)
and 20 jiffies (CONFIG_1000HZ).

Fixes: c637c1035534 ("tipc: resolve race problem at unicast message reception")
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
---
 net/tipc/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 13, 2021, 11:50 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Mon, 13 Sep 2021 16:28:52 +0700 you wrote:
> In tipc_sk_enqueue() we use hardcoded 2 jiffies to extract
> socket buffer from generic queue to particular socket.
> The 2 jiffies is too short in case there are other high priority
> tasks get CPU cycles for multiple jiffies update. As result, no
> buffer could be enqueued to particular socket.
> 
> To solve this, we switch to use constant timeout 20msecs.
> Then, the function will be expired between 2 jiffies (CONFIG_100HZ)
> and 20 jiffies (CONFIG_1000HZ).
> 
> [...]

Here is the summary with links:
  - [net] tipc: increase timeout in tipc_sk_enqueue()
    https://git.kernel.org/netdev/net/c/f4bb62e64c88

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index a0a27d87f631..ad570c2450be 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2423,7 +2423,7 @@  static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
 static void tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk,
 			    u32 dport, struct sk_buff_head *xmitq)
 {
-	unsigned long time_limit = jiffies + 2;
+	unsigned long time_limit = jiffies + usecs_to_jiffies(20000);
 	struct sk_buff *skb;
 	unsigned int lim;
 	atomic_t *dcnt;