Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2319665pxb; Mon, 20 Sep 2021 18:42:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTkHi9RjgnmJ0Sfc0FfuktGPVHJz6xeAsyF4W4YnDPQbs9SBTsCtvshhyqozHSXDYTCwwn X-Received: by 2002:a92:cbc2:: with SMTP id s2mr19082170ilq.228.1632188579339; Mon, 20 Sep 2021 18:42:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188579; cv=none; d=google.com; s=arc-20160816; b=QL8rbVqo7VEe/BQCQ2jB7Ea/HwW72KWOi6bsFA/ciaZQkSHLW7w/jU4QZBGln6b2lL An2soyZ1wuRZ0VA8bP7cFiyNPBS2xb+aXyyHJjwzF0dfFMu1janRbb2MHDu2Jkj5S9LQ eebazW0rOfYhxFMXrDniwBMdImaB698TF57ZAfrGZEn5yt2bSk2q+V01h37VuD+CMGdO 2AyGBa2KPqtO+wW3rG0NAxGgSHjfvLrXE47eKxtLIFlhQ82M6dkzHdZUZJuhxLLfZF81 23lU2L8sDroBcZMeBHmZHvSw839PZVkfrq1YlsmpuzO1I4ONfwlhs7a7PXkCQk2SbnRU nsdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JC/WhVfz1U4BDxBbnGl2E/oOL9wMF0EDkPcdyzfau4I=; b=LKh46TC8ASeOR2n7IlfikTOcYkqg5eHjsDuRUbu6bvFHxtGZB+LDrPUuiUT545VO6E L4j11/fRt41rK1W5YKG8MziL/A1uBnPvnesXeu/XywSpJicTr/NifgB1ZdGJ4e7c9jME TOJcoAq7uOpP41zdLEUxs5jwbbdtfCuWkL+4fGOYIfV+tTYUU//Z0RoYUX2RDo28IBD2 lz20nlHGhaBxnzpS/4ocTM4/8IqOvhKDYS0U+8ptk4uOUwATaKJEHCpDAy+G27vQE2hn JkTH8rovLO8zRBWPy/Rt290WKntC+uTsYgXNIhR9sqYk/MlV1xEfoxY7n/KIDQmtxlNP lusQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IZmFmnkv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si4959556ils.103.2021.09.20.18.42.48; Mon, 20 Sep 2021 18:42:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IZmFmnkv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234110AbhITQz7 (ORCPT + 99 others); Mon, 20 Sep 2021 12:55:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:39802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236965AbhITQwN (ORCPT ); Mon, 20 Sep 2021 12:52:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3DA526137E; Mon, 20 Sep 2021 16:49:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156582; bh=WMuC6j0iyxBOMB60y653bQdixceuCmyzGqrNskJR20I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IZmFmnkvT/gQk9MQ/yiL7g2uvZ5vV9B3+0uMLwAfyHeiHehT05BeHHS9hdufARlXX OI5GZ7jdLCLZZQxxfsfdsa67xSkMEEfNWMfLdaUF/SSGMnOEkVjwfmB97soDGEis1t m8ZDio/UXACmkNP5bx/k0PL5D2nwrZyPckoRGpOc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Maloy , Hoang Le , "David S. Miller" Subject: [PATCH 4.4 124/133] tipc: increase timeout in tipc_sk_enqueue() Date: Mon, 20 Sep 2021 18:43:22 +0200 Message-Id: <20210920163916.683663644@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hoang Le commit f4bb62e64c88c93060c051195d3bbba804e56945 upstream. 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 Signed-off-by: Hoang Le Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/tipc/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1757,7 +1757,7 @@ static int tipc_backlog_rcv(struct sock 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;