Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1133894ybz; Thu, 16 Apr 2020 03:36:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJDFfcUNihidQAzZlsxmQKGxtQVGbpAbKOSDkWU9sGgSm39cjtzO6YEQXAyKiDdva0DP0B7 X-Received: by 2002:a17:906:72c8:: with SMTP id m8mr9304503ejl.318.1587033372490; Thu, 16 Apr 2020 03:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587033372; cv=none; d=google.com; s=arc-20160816; b=rViYHr8OIJ8ojqXF4T6LN0CxXCM8sueixJ6sUb89HM+FX+pHhvu0l4plKR97A3UyNE eKond+VnWKSDP2IwDeXgGL4zBz4HZFt70w4vNS8e+iace578dXKArJYCs81Xr9k6L9dA A4rQV4dlGVkE63wcsNVyGqFeF+b1GfLO4SSqM0X6h3OJ5Y7JzlaeX6pRaYMU/SK7zqc5 wfb+RlFkFBOHwv07AXE93wakGYiTI3C3K+iuXqKV5tliawaPdSagoBK3tdJC1HORE0fl xcTJy3tM3JESG0BYjMmrFij5O9UK7O3nk6ZoTN1BeJarpKFcWmYzwXZCx/eX2L/PjChi A7xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=wSOHFT9tJQ3WMUJpzqJBLiS8QZ3BM+HLY6292xvXFZM=; b=W9SuJKnQmMMjWuhMDGVhKCydFDt+/7TOpCOR/63+rw19draJ16TobrUi1AdHcldbiT ACRNTpxNe7HJykf0zWsF9/e5WBICwJw7pSRaPcn9MJqWXzq/nLPAjuVO9X4U3ufjJcvY H5cGXWrXnpbRBL0Xv2CpU0s4PfthbyS/HLMV1gV/Kk87yWk0A4AuxFw+YyZFkOu6LGNO 4ip2Sv4iYd/xguAxIPKQQWy+fgf8r69UJK3S50voWCFzEApMK9MpZ85E6fej3Ii64xe2 4inzHgOm9m54HwkrsgnBuVht9oUIvDKsGQinJQVosr74IljSL4ZefStxhu0REa32TcUV 0Z7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DuAiR70A; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a4si11965429eje.61.2020.04.16.03.35.41; Thu, 16 Apr 2020 03:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@redhat.com header.s=mimecast20190719 header.b=DuAiR70A; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505080AbgDPKfG (ORCPT + 99 others); Thu, 16 Apr 2020 06:35:06 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:45524 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2505075AbgDPKdm (ORCPT ); Thu, 16 Apr 2020 06:33:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587033221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wSOHFT9tJQ3WMUJpzqJBLiS8QZ3BM+HLY6292xvXFZM=; b=DuAiR70AkTLxvA/rK7PsFcNZGWdjqBd8BtZy5tk7QANjZlp3r28/2gyWuprA/f5aV3HfCi bJAeN3BvIl7SWiZjkLiY29dCK/pc0Z6fY5oDPvRB/3LGLcOECjcrWNqw9e7FPfJbqGUkkr lDDNfmSN2tqkSJgn0o2GCBeUG9b9fBQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-451-mRLDz9gnN72cnltf895Q4Q-1; Thu, 16 Apr 2020 06:33:39 -0400 X-MC-Unique: mRLDz9gnN72cnltf895Q4Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 26B2513F9; Thu, 16 Apr 2020 10:33:38 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 178D194B40; Thu, 16 Apr 2020 10:33:35 +0000 (UTC) From: Florian Weimer To: David Howells Cc: linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, keyrings@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: What's a good default TTL for DNS keys in the kernel References: <874ktl2ide.fsf@oldenburg2.str.redhat.com> <3865908.1586874010@warthog.procyon.org.uk> <128769.1587032833@warthog.procyon.org.uk> Date: Thu, 16 Apr 2020 12:33:34 +0200 In-Reply-To: <128769.1587032833@warthog.procyon.org.uk> (David Howells's message of "Thu, 16 Apr 2020 11:27:13 +0100") Message-ID: <87v9lzu3cx.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org * David Howells: > Florian Weimer wrote: > >> You can get the real TTL if you do a DNS resolution on the name and >> match the addresses against what you get out of the NSS functions. If >> they match, you can use the TTL from DNS. Hackish, but it does give you >> *some* TTL value. > > I guess I'd have to do that in parallel. Not necessary. You can do the getaddrinfo lookup first and then perform the query. > Would calling something like res_mkquery() use local DNS caching? Yes (but res_mkquery builds a packet, it does not send it). >> The question remains what the expected impact of TTL expiry is. Will >> the kernel just perform a new DNS query if it needs one? Or would you >> expect that (say) the NFS client rechecks the addresses after TTL expiry >> and if they change, reconnect to a new NFS server? > > It depends on the filesystem. > > AFS keeps track of the expiration on the record and will issue a new lookup > when the data expires, but NFS doesn't make use of this information. And it will switch servers at that point? Or only if the existing server association fails/times out? > The keyring subsystem will itself dispose of dns_resolver keys that > expire and request_key() will only upcall again if the key has > expired. What's are higher-level effects of that? I'm still not convinced that the kernel *needs* accurate TTL information. The benefit from upcall avoidance likely vanishes quickly after the in-kernel TTL increases beyond 5 or so. That's just my guess, though. Thanks, Florian