Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1949885pxb; Mon, 11 Oct 2021 17:14:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDUN0eZaQ9u6oPimOCHGM5Vogm+u033tftLM78H1C4n4xdBsAuHGmgtcwPq70k3Kjej9jQ X-Received: by 2002:a05:6402:11cf:: with SMTP id j15mr45888601edw.232.1633997661569; Mon, 11 Oct 2021 17:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633997661; cv=none; d=google.com; s=arc-20160816; b=MzDkU+SOb8ioLHA2p+6nLzNClGbKtv13oe6vbBHHVPBXDXjM9NwJ0/rBZE7KpokR3h CChYm1G8sQwe2B67wMfWTS/vWZZjKpUAFPe1MzjdU3oeOukr7zVU8b+be4bOcvevc2jp cWM2t+GHCZEZO2BEUZCIaZqXn5knGMjZ60CjREkWphbh3uEpFwZS7od+SLXpil8hRt32 kjPVqnB7II0RaNV9qxMlodPdvPyKYPY77QUY7pIM532iTxO5fbDDc2kacuV0D7UY7f4t eSU88aoIAIDDx9wrYV4WBQBJApqUOGnFa0emdLH20+i1XZ1QcgJio3veDUBPtCrna8yE 11Og== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=k061JOq+ZGBoMlNQtFUeHz3tsWfzCnkuiqNOK0BQ3kA=; b=OTdpHI1BPhJVZk5WJdNXS4BpDpX4OQvKFm4Y6rphcjvCwSEnQX4TREu4IY3sKjqg6K ssA+OVBUuw9s2NUOpv6ZoX99N/dEq1YahzfuL4A9PeEo6y4FIAaxq7tHDRpid51azUlP ueWo+8OYLeSCXMMFZfq95EWwgUT42tbxCTwFtOexXU688Cik/u947Twt7hrKpMa/NOw2 mq004iE3P1AovAxN4Ga3Z2OC/+OS0bpq+U0j5YYPpEtjK/easKeTLNkZEMHIuDRxtsFl AZUY+YIgusip044EPkeOhxyuJoduAT91iLdDvecxCeHNSbztgnQImjSWzqcv0Z6P3qre 26jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T/qMwMhO"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si21180717ejn.348.2021.10.11.17.13.49; Mon, 11 Oct 2021 17:14:21 -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=@kernel.org header.s=k20201202 header.b="T/qMwMhO"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233200AbhJLANX (ORCPT + 99 others); Mon, 11 Oct 2021 20:13:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:41102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232888AbhJLANU (ORCPT ); Mon, 11 Oct 2021 20:13:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 56FA960E54; Tue, 12 Oct 2021 00:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633997479; bh=Sxry5lBoLED+PmULe66+x8rW+kGtlngMtcUNj5tGH2o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=T/qMwMhO851f8Det/z36Q63BzSmM43bo8/zAd+Ra3lvkBZP8R3dIDWK/CmKE8ti7R 3haf8SQPbD0ylLndk+//4cwh9V/dFnw0lbzRnMskegEYuKBy+CWObTEiCGHrNf0gf0 rqTkvamUNYa7eo3Q9usCsGWFbvLB0nhOvPWAapyc3Km2Hyi7siUuMwTML19nfzCZ0Q su/FJo6BtGa0BZFPAbjyhJRlUBaD4hNJFndfZnSHHTVzdZhw0v9AasuexAgDBqwj4Q 9gVGJhXHQ/SA4/zbtKzlnvlMNQ7ly8uDS4Ea3lAdUS1DSdKZiX6JpA/w4XgBofDF6m PwgX/+oXzL93w== Date: Mon, 11 Oct 2021 17:11:18 -0700 From: Jakub Kicinski To: Yajun Deng Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] netpoll: Fix carrier_timeout for msleep() Message-ID: <20211011171118.6e0bf5db@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20211011085753.20706-1-yajun.deng@linux.dev> References: <20211011085753.20706-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Oct 2021 16:57:53 +0800 Yajun Deng wrote: > It should be sleep carrier_timeout seconds rather than 4 seconds if > carrier_timeout has been modified. carrier_timeout is for changing the upper bound of the wait, not for controlling how long to wait if carrier is untrustworthy. > Add start variable, hence atleast and atmost use the same jiffies, and > use msecs_to_jiffies() and MSEC_PER_SEC match with jiffies. > At the same time, msleep() is not for 1ms - 20ms, use usleep_range() > instead, see Documentation/timers/timers-howto.rst. > > Fixes: bff38771e106 ("netpoll: Introduce netpoll_carrier_timeout kernel option") > Signed-off-by: Yajun Deng