Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp42925pxa; Tue, 4 Aug 2020 16:01:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/AXmxK4GunwIStyZhMllsRbosbwKCaVsQsm09RlOSd7hA4whVu6oTAiu0W89wgfuwwCPo X-Received: by 2002:a17:906:46cc:: with SMTP id k12mr418874ejs.366.1596582104393; Tue, 04 Aug 2020 16:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596582104; cv=none; d=google.com; s=arc-20160816; b=loQddrvs0Xp7c5OQ5mgoQp903D4s/vo/fENSbJMav74wI7/TH0dPoZ2ft21WcW9n0u 6HF8P9c2nUkTWhsyaeiHWZLfPrt7IrozJst1oN+ZPCNM4e8cKBKZywtlxU3d7tgTOT/2 mx3STrABb383MBH2W+6ARAv7NHYbYVL+NZzI4z+QBHM6Co9pHW5OcICOn9XS+Zre8i1A vahX8yac4D01oMUCFQC7LFJnYnYVmUpFBrY6opJ/bBuv2mF8oCgtgaUEy+wSF9ldNBjb Fgg9iGT3l3yUPBOaZUZ8J6T7LisGXgDwfT9DASnaYxD0muSAy2nRe1YvG7NTG1LhYj/7 lSmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=ZCQUeyZa+4brd9eTm9Y4g4J/Uahexf1gp0mO0iu/UxY=; b=ZPxEoF3TE48ZS14ro7EcFpnvQxAb7qjVPmZ9zukK+4dLA16VKl1aIU1XiRlkLaKx11 ZsO046mP/LO4GIPUSf92rkJmhZ47vysx6gfBQUBnCMdl1T2X3SrsBIb4Avjvwwql3jak DzxZKz//f9AuG07aY9fcJV0b9/kUQf3em7o/CvUqsCEjmeov4r4kltubM11gdKUcMjl4 bsLcCuUPif26OTaR3ibVqbu4ri7m0rmt+N4aSPiC0tPy3rgx0RVKi6FWzU/c+gQhXoCh yIjKfswb07AyWUlZB1h+fjTJH4LKDYTSfSrnXMfTQlPSG8cS88b5tnBy3qndWHEF1uZr dwlw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si81918edw.580.2020.08.04.16.01.21; Tue, 04 Aug 2020 16:01:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727070AbgHDW6k (ORCPT + 99 others); Tue, 4 Aug 2020 18:58:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726955AbgHDW6i (ORCPT ); Tue, 4 Aug 2020 18:58:38 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76E60C06174A; Tue, 4 Aug 2020 15:58:38 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 20AAA128958FA; Tue, 4 Aug 2020 15:41:49 -0700 (PDT) Date: Tue, 04 Aug 2020 15:58:31 -0700 (PDT) Message-Id: <20200804.155831.644663742975051162.davem@davemloft.net> To: wenyang@linux.alibaba.com Cc: kuba@kernel.org, xlpang@linux.alibaba.com, caspar@linux.alibaba.com, andrew@lunn.ch, edumazet@google.com, jiri@mellanox.com, leon@kernel.org, jwi@linux.ibm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: core: explicitly call linkwatch_fire_event to speed up the startup of network services From: David Miller In-Reply-To: <20200801085845.20153-1-wenyang@linux.alibaba.com> References: <20200801085845.20153-1-wenyang@linux.alibaba.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 04 Aug 2020 15:41:49 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wen Yang Date: Sat, 1 Aug 2020 16:58:45 +0800 > diff --git a/net/core/link_watch.c b/net/core/link_watch.c > index 75431ca..6b9d44b 100644 > --- a/net/core/link_watch.c > +++ b/net/core/link_watch.c > @@ -98,6 +98,9 @@ static bool linkwatch_urgent_event(struct net_device *dev) > if (netif_is_lag_port(dev) || netif_is_lag_master(dev)) > return true; > > + if ((dev->flags & IFF_UP) && dev->operstate == IF_OPER_DOWN) > + return true; > + > return netif_carrier_ok(dev) && qdisc_tx_changing(dev); > } > You're bypassing explicitly the logic here: /* * Limit the number of linkwatch events to one * per second so that a runaway driver does not * cause a storm of messages on the netlink * socket. This limit does not apply to up events * while the device qdisc is down. */ if (!urgent_only) linkwatch_nextevent = jiffies + HZ; /* Limit wrap-around effect on delay. */ else if (time_after(linkwatch_nextevent, jiffies + HZ)) linkwatch_nextevent = jiffies; Something about this isn't right. We need to analyze what you are seeing, what device you are using, and what systemd is doing to figure out what the right place for the fix. Thank you.