From nobody Thu Jan 13 09:49:03 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A3D9C12D2019; Thu, 13 Jan 2022 09:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JZKQ75P2gz4jKf; Thu, 13 Jan 2022 09:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642067343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYbYuBjslDPlI86xLVW4xRAUZcDcUaAYnp5Z14jmMa0=; b=KcMtNFWyTmYB1uer4c8l3DvKh5H1stWipzrp+9poVULko4BEhHAy8EYqPIC//gFiecmIKw 9kvY4dl4ukifawCdl6FPb5o1IPvv06Xd+jusrxvm1DYqmCHi5GTaEe26Qz/O14AdWwUefb OAhphdTT3B/7z5Ng57R3nCqVgEXHWXp5HYJ0NCxyQHBZPlY0zi4QoPAlXa7mLvUUpgvq9r t0JUV6Z9gu777PIcQ7ndMKHHsIyFhlXwfdvGY7DHt3KrWFJrcp9BqKunCqyr7YZmX4XkQ+ uqK7Ch39j/rtDleDNWiPcky53az2xYjAw4NEMgjbUcuBPYFMirD5TeGx3lLw7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CA501E4A8; Thu, 13 Jan 2022 09:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20D9n3Z1095874; Thu, 13 Jan 2022 09:49:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20D9n3gW095873; Thu, 13 Jan 2022 09:49:03 GMT (envelope-from git) Date: Thu, 13 Jan 2022 09:49:03 GMT Message-Id: <202201130949.20D9n3gW095873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 4003cdd81b87 - stable/13 - loader: ip: Do not call getsecs so much List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4003cdd81b8776cb451395ffa53423ad52328bc9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642067343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYbYuBjslDPlI86xLVW4xRAUZcDcUaAYnp5Z14jmMa0=; b=YBXHgNR5BrQmcIVlyfmgGmR+0WVr5Fk4OeBO26Q221NWc4QK6RFdSdjh1q6nsfTJLDcqwO oAKbtjsfSEuMld6V+17mxjWBWBWXbvDGlnBvPtBr4vlUAoz0qdFAXFAGMcxZstdtFdsQi6 9qbyDhkcZfu5ID3JZUHzsVBjPKc4M6aPvcKUUVt4PvEjtgnt4nZNGdNKoPYYLIoraaIuwb ANW36rFJhlpJcJ7ChzWeznOWI8U49DEjLN0RV2GXEmsNDLu4x1ds8XyxWShMZjLpS6RvN1 fTxzJYGXeAug66zQHmVYQO5cr/rLhnQDiYi2XfgYDAV23hn2/4rkODdtJuWUPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642067343; a=rsa-sha256; cv=none; b=FLt82N7DVXa93FkG4+zMveZytqmp66FIFZPwHqbrkOnE9yRPtFoC30UmbgApOUmC96bnlt er5I7u/DKXXykR3IvjHjELva3m6n+fdZ4fnQbqSNZLCKxZegF1Pp29ym4beiRqfCrKITCk smV8b/xxFfCTMRoZoRvQ1e+nIq6yhpj5W5FP2wd403sdu1hvb+bbeQ/wHffx1gcTdD8+lK 99yagNMJfQ8x5XbpcrU9VMkjQ2VU7vT2PVp7t9S+EQJDnzmabnQKHjQCgviVYZFSmygBWN hi3VA2yBhVibb0Y4gmMpJPhaHUpQjBvTioi2G8mV3Is9vs2kDwrRCpr1uv42sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4003cdd81b8776cb451395ffa53423ad52328bc9 commit 4003cdd81b8776cb451395ffa53423ad52328bc9 Author: Emmanuel Vadot AuthorDate: 2021-12-09 14:46:39 +0000 Commit: Emmanuel Vadot CommitDate: 2022-01-13 07:56:00 +0000 loader: ip: Do not call getsecs so much getsecs is very costly, reuse the values we got before. Fetching a ~30MB kernel with the tftp command use to take ~26 seconds and now it's ~18 seconds. Reviewed by: imp, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33408 (cherry picked from commit c5f24f5e0db24c8e33e6278a4fbb7e68364ca18d) --- stand/libsa/net.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stand/libsa/net.c b/stand/libsa/net.c index 3142616a5bf0..e04a370e466e 100644 --- a/stand/libsa/net.c +++ b/stand/libsa/net.c @@ -101,10 +101,9 @@ sendrecv(struct iodesc *d, tmo = MINTMO; tlast = 0; tleft = 0; - tref = getsecs(); - t = getsecs(); + tref = t = getsecs(); for (;;) { - if (MAXWAIT > 0 && (getsecs() - tref) >= MAXWAIT) { + if (MAXWAIT > 0 && (t - tref) >= MAXWAIT) { errno = ETIMEDOUT; return -1; }