Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp252411rdd; Wed, 22 Nov 2023 15:11:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRf2fXQfineVlj8NH6cOTtza/vXlsAhx/elCl9VTRdpMxiJ1UPuYgNYbvKNmd6Rw2FuZ2D X-Received: by 2002:a05:6214:20a5:b0:679:f328:90bd with SMTP id 5-20020a05621420a500b00679f32890bdmr4374058qvd.8.1700694664849; Wed, 22 Nov 2023 15:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700694664; cv=none; d=google.com; s=arc-20160816; b=BKiNJ1Pwe/+x5sqHw+o4uhoCIWbA5tVgk0KXjeCnK68uvKu8xDlT9XiLGQj9JKuP0T Ab0NvfCUzqLliEyyCKinrFG4jdPTYZhG+XDP7EJDbu61G5FeOarP1EAFjNKPyZnXcgxM AYVF7i+eCzaZVTAJ7Ha5i4h3oC327XVz2YqZDZkcKG1AVkeR4SY8EwwlAgmlFx+ehaKZ XfTYDRVn7/n3C0x91ZVsYMoso97QcWAf1BxV2MIz5HY8GwqP10hgmIeMidsISRigEGMh ezUh+Vv73/DUPadFrG52XVeYXw80uVRg3M4u0QlZjoE0C5nZ0oS54ttFV+je81W4A/xh VS3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=umYZG4o4asl5GTSKUOet+bFf4MSEtCJAXeDIEtwaNTU=; fh=A3pMOUK00huGibGCZBFsLekFLVbB5hHGKjUNNKwO+5E=; b=TgdG5dgqB/nzo53DhN5QGZemY44KF3gOjkLVYxwZHasB7gb365dR8vXS6wilcPJ/cg su7W452slfbJ3KHhh8h/eyrbxCMkCbCCPsFUl9oQmFzd9kRNOu4TBPVHu2NwsBYDs8/V OF5zOXVPMRXjqB4cUj1c7OaayRnbEgD5/TQj0NhZ9FMhzRzJEpoOBewerqT2Y6HPk8Rm lJVIxwustCaaCxzIAJl9g1Jj9Nom5weLwfoxPtmKCYhe6y3pC1WK457vinGopTSLDTDP hrgX1IeXDU6HY8p6ULHVdTuYsYk2quZoEZV5zeDvVG5PU4sdVR4wtcoRQ9eN3nsLk7xs THIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RWYY1L0x; spf=pass (google.com: domain of linux-nfs+bounces-36-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-36-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q3-20020a05621410e300b00670df30f615si451961qvt.386.2023.11.22.15.11.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 15:11:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-36-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RWYY1L0x; spf=pass (google.com: domain of linux-nfs+bounces-36-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-36-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 781411C2042A for ; Wed, 22 Nov 2023 23:11:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2E6F1D559; Wed, 22 Nov 2023 23:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RWYY1L0x" X-Original-To: linux-nfs@vger.kernel.org Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C2521AB for ; Wed, 22 Nov 2023 15:10:59 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-544455a4b56so422585a12.1 for ; Wed, 22 Nov 2023 15:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700694657; x=1701299457; darn=vger.kernel.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=umYZG4o4asl5GTSKUOet+bFf4MSEtCJAXeDIEtwaNTU=; b=RWYY1L0xcEZXYkKRaSPeFD4KvqFFuobhvvs9cMC2vjZvqXRYwrpomKLU4LgYj9gSQm xJaKWPnDcu1eKTtMaFLwl0YZucEz4TWODYtNNGPpjscOa9Bv+uUK8gtRtuZt/ooIHKbK C155NpKJNrrBiGuhbTksHAOVCGWYdR9/gewqIyGEUAxmaCEnIU2U7Tnnm3zSVUCoUxnU Ew9lXiiVz8fJqH9Bh6zPwVhoblZSWSLCm+8xFITGMlFMZPEakwd+O0JxKe6VOh0XqOTS ArW2TA+rFNkY6atYYIpRr4/VTYv3/6XRN/L7HMzofOtESIn8Vgtp8oU/mewJQE77xOmL 9fAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700694657; x=1701299457; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=umYZG4o4asl5GTSKUOet+bFf4MSEtCJAXeDIEtwaNTU=; b=LDZ88Fp+AHkRuqt9rJqFUAyAef8OM+ExkBKStLG78ybPBJbW56tANB3VxCsn1Q9KQ8 h4tw7eJRzs+QkVbQjDY9INqUXnsKyPy/ASs4w68Pnj5DI9KqGqcIVzG3BdGpiuSV210s cfAyQ+ZsfekrD7CewhLt8QZft5rwqDCcFyDr7gP82mpBBhLLkweJeKIwt8Oks4rkRDF9 B/x2DPNBiOmF9IG5FxfmyS57YG2qEF88wQ35NwNMx0ZzucgbzgCXXKPd1Us/HBkGyghM w4E9kAhd+dR9Lz3Gw9+TnkK1lzmGQzRbbA9a4yewIQm/HLsI/7MpE4baFK/GRRFummN6 nYOg== X-Gm-Message-State: AOJu0YyewCX/JTclePQ5OLev6ZS4CcfxDcUo1XStwADw+a+PTemh14Ny e+6myvgtSI8BxhIVzOa4k5aE9M7mE7S34hW8phw9ejxd87E= X-Received: by 2002:a50:ef05:0:b0:53e:4762:9373 with SMTP id m5-20020a50ef05000000b0053e47629373mr2857726eds.18.1700694657343; Wed, 22 Nov 2023 15:10:57 -0800 (PST) Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Cedric Blancher Date: Thu, 23 Nov 2023 00:10:21 +0100 Message-ID: Subject: Re: TCP_KEEPALIVE for Linux NFS client? To: Linux NFS Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 23 Nov 2023 at 00:03, Calum Mackay wrote: > > hi Ced, > > On 22/11/2023 10:48 pm, Cedric Blancher wrote: > > On Mon, 20 Nov 2023 at 03:57, Olga Kornievskaia wrote: > >> > >> Hi Ced, > >> > >> Why do you think it doesn't use it? Have you looked at a network trace > >> of an idle connection? I seem to recall seeing keep-alive being used. > > > > Well, I don't see a setsockopt(TCP_KEEPALIVE) in the libtirpc code? > > We have this, in the kernel RPC code: > > https://elixir.bootlin.com/linux/latest/source/net/sunrpc/xprtsoc= k.c#L2257 > > which might be it. Yay, But how does the kernel get the fd from libtirpc? Also, how can I turn this: /* TCP Keepalive options */ sock_set_keepalive(sock->sk); tcp_sock_set_keepidle(sock->sk, keepidle); tcp_sock_set_keepintvl(sock->sk, keepidle); tcp_sock_set_keepcnt(sock->sk, keepcnt); /* TCP user timeout (see RFC5482) */ tcp_sock_set_user_timeout(sock->sk, timeo); into setsockopt() from userland code? Does the BSD socket library have such options? Ced > > cheers, > calum. > > > > > Ced > > > >> > >> On Fri, Nov 17, 2023 at 8:02=E2=80=AFPM Cedric Blancher > >> wrote: > >>> > >>> Good morning! > >>> > >>> Why does the Linux NFS client not use TCP_KEEPALIVE for its TCP > >>> connections? What are the pro and cons of using that for NFS TCP > >>> connections? > >>> > >>> Ced > >>> -- > >>> Cedric Blancher > >>> [https://plus.google.com/u/0/+CedricBlancher/] > >>> Institute Pasteur > > > > > > > > -- > Calum Mackay > Linux Kernel Engineering > Oracle Linux and Virtualisation > --=20 Cedric Blancher [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur