Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5086983imb; Thu, 7 Mar 2019 07:28:43 -0800 (PST) X-Google-Smtp-Source: APXvYqz4pNHsiqpwnz3uPYQNQs92Gxv5IOqrYJ5ux/fLJN3Yq9QMWIb32cuxSd6TO7zD6JuauL+O X-Received: by 2002:a62:1f5d:: with SMTP id f90mr13271024pff.104.1551972523730; Thu, 07 Mar 2019 07:28:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551972523; cv=none; d=google.com; s=arc-20160816; b=pJr8O7hhxXyT5YM1/E1yv5KiX3apYGLvC0mFRjvKfKVjTZUaUw4/IFzx0AMRUCzbDM EQc2WLZZoT2kh21oFauaQecnrb2xBMEwr2Q3nElV2FndmMsqRCThu6uRje4HDlrNtfXV K4rzMPef929kKd+G5E7smAKXj6hxYMaVpRzfkD+WhMoAvybFaEZj+M7NlYuypHzkapyn 9dY+xgCXoCUsc0afboEMeeB8mgqsLp3Yoagh67nelstXwz019s14pNM1DV95aeeeaGJl irnWHJBPbeuENXcqf/mtt/ACjzTWPgEg5NYhIPOmLUgl+4DPHBKZ4GVAAPxD8DotXpu+ CQbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=t5xTH+/6WdNJ/as9PcGJiAcRYVVnpI+EDPMYTZd1JOI=; b=07bPGtYNJnok7EnZ2dInuI6yjxZi649peVjflZxDHh/Bg6SgfabwJ6uxC/dYBSp1WV h8np9vKaCCZPBI8U307kUE3NEl2tq37DmkpgcFP8Fv7tTSQt7F2Z+0qF1YsYMswFnpQ2 5VIoNeSaGRZY7Sq1d7h3/5uAe7SmaN6ympxowK2aJu3PXjNHYN5d8kD5GRCB+XGReYVx HMlnNHTo9VKO6potLbHR7Ga45yxP4XYZwZg7PV++OZRM2yEUpPhU6kWFpkjdrnZGqWxB 3PTJL/bx9RcV7R51IqizYR7bwLHTNmgb/UfrrhxKV/j404/LEpP6pZXvqv23T3Bsls7o hbHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si3931578pgu.132.2019.03.07.07.28.28; Thu, 07 Mar 2019 07:28:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbfCGP1N (ORCPT + 99 others); Thu, 7 Mar 2019 10:27:13 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:44866 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726207AbfCGP1N (ORCPT ); Thu, 7 Mar 2019 10:27:13 -0500 Received: by mail-qt1-f195.google.com with SMTP id d2so17467526qti.11 for ; Thu, 07 Mar 2019 07:27:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t5xTH+/6WdNJ/as9PcGJiAcRYVVnpI+EDPMYTZd1JOI=; b=Mu1b4BhbB1lrs4bVMWv4ydbpf1OhwQDyvpBGXEn+0Ii1HTRnVTKhHhaf0mnQK0/KNq 89KV0SHiZE4Bjvgb3EE27xPi/UXSHEHzrw4DDQ/hSZo1spCcAO15zNLvuiLtOHNeY12k 1EFkWuJYxX0VJG2N4NiwRRxI828LtDAKGN0wSoDEGjLR9R1b5a7MHvcpFgmlksDCRy3P rtk359YsUKdugOkirQlKBBfnPTALWZQv4E0+HarecDKKEa3tu89lp8bHbcJkgNky35u2 81UueCPkTE3+ywd15l4TuHGfrc4RCyhTwVSGqORNyxwp86jpd6N/HUb15u7n41mengAs g1dw== X-Gm-Message-State: APjAAAWdq8RVZDMScfQzUWKFHqnukJti2WFSzTbDE8Kd+CSIJeQxflYq YjaLC7Q9Bu4+ScT9MduLFdSxS8CFWxu/hmTEYL2pN2a/ X-Received: by 2002:a0c:b758:: with SMTP id q24mr11022112qve.149.1551972432079; Thu, 07 Mar 2019 07:27:12 -0800 (PST) MIME-Version: 1.0 References: <20190305162351.5aadde66@jawa> <20190307085329.2b6cbeb7@jawa> <20190307154310.677b59dd@jawa> In-Reply-To: <20190307154310.677b59dd@jawa> From: Arnd Bergmann Date: Thu, 7 Mar 2019 16:26:54 +0100 Message-ID: Subject: Re: [Y2038] Question regarding support of old time interfaces beyond y2038 To: Lukasz Majewski Cc: Zack Weinberg , Linux Kernel Mailing List , Joseph Myers , GNU C Library Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 7, 2019 at 3:43 PM Lukasz Majewski wrote: > > On Thu, Mar 7, 2019 at 8:53 AM Lukasz Majewski wrote: > > > > On Tue, Mar 5, 2019 at 10:24 AM Lukasz Majewski > To be more specific: > > I'm thinking of settimeofday/gettimeofday syscalls. > > In the kernel we use internally do_sys_settimeofday64() to support > clock_settime() and settimeofday() > > The internal (in-kernel) representation for those two is struct > timespec64. > > If I may ask - why settimeofday64() and gettimeofday64() are not > implemented? > > Is it because the same result can be achieved with clock_settime64(tv64) > + settimeofday(NULL, tz) ? > (The drawback is two syscalls instead of one). Yes, that is the idea. I don't see the drawback as significant here, since settimeofday() is not performance critical. > I've also stumbled upon the __kernel_timex introduction on the > playground branch: > > "time: Add struct __kernel_timex" > 2c620ff93d9fbd5d644760d4c21d389078ec1080 > > This one introduces the: > struct __kernel_timex_timeval { > __kernel_time64_t tv_sec; > long long tv_usec; > }; > > This code is "protected" by CONFIG_64BIT_TIME. > > Is there any plan to explicitly introduce: > > struct __kernel_timeval { > __kernel_time64_t tv_sec; > long ong tv_usec; > } > > and convert settimeofday()/gettimeofday() ? No, see above. Basically all system calls that take a 'timeval' already have a replacement that uses a 'timespec' with nanosecond resolution, so the idea was that by not having a new timeval, we make sure to catch any calls that need a nanosecond based version as well. clock_adjtime() is a bit of a special case here because it uses a timeval structure but passes nanoseconds in it when ADJ_NANO is set. Arnd