From patchwork Thu Jun 17 11:50:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 43869 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4ABA73896C03 for ; Thu, 17 Jun 2021 11:58:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4ABA73896C03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623931133; bh=8vhERQgGy5zvoAY36fUGUkyJEgk62SKv7Q5SiIdwxjk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=YlpZZoAhOkN54/quWTQBmdf4dkc1A5hI9PsyPegM/q0Z6rcOTnOSSQdrjADRiQVX7 6vYAXKLfbhht0lkedEKLCpeOOZX53E87zs6IbFUl8UETAQUWIEoCBVX9o/LZAhkHRq qe1G0SrDamLRjCgSma992Ehe7BdoT6k+yCjK5U8M= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by sourceware.org (Postfix) with ESMTPS id 6FDFB3894411 for ; Thu, 17 Jun 2021 11:51:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6FDFB3894411 Received: by mail-qk1-x729.google.com with SMTP id d196so2733610qkg.12 for ; Thu, 17 Jun 2021 04:51:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8vhERQgGy5zvoAY36fUGUkyJEgk62SKv7Q5SiIdwxjk=; b=lKu5KxX3Tu1t0GubMxwQsTc5oeVXrx+ckEk44G93fkuVN2bc/vaYcR3mgUopEwkfwE h3rBQOMSOVKQXFh7g6ueGYoSOlrQNIdKPFxT7mqAD/wnTBr9dn4Tfh4L+wHIFHvWDFwX oOUluttGURw8vcpAyvwA3mjl95m/7ClzgwL23hGJSXd+ogpFql1esfVrsSuYfJBW+m1J ICFyUPdq6Sgg/QzNNuiKcx158PfnL/FFLu5UNHfbFACHxdkkOgg4W6uP5ckGnARgdIfg A9ZqVZzvbj28UjMy1Rd20kewy5rzz46Ov9QjpWskJ6/7p2oALVyNat3+7rcyF0dFa7hY YTfg== X-Gm-Message-State: AOAM532D5vCspyKhlKsXsTC+LzeiN5r0EyAe06Ez/iv9f9W4HA506WuG EP20+zk1aJh5RnPnPgtPf/swPpD5RcJYWQ== X-Google-Smtp-Source: ABdhPJxybt9cJpItjlvfLgDEURpdlSENkF9CrKlvK86nkxis2yozN+kCH32fvI3aiZWfelvWtI1W4A== X-Received: by 2002:a37:a8c1:: with SMTP id r184mr3326812qke.129.1623930682924; Thu, 17 Jun 2021 04:51:22 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id p12sm3016435qtw.61.2021.06.17.04.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 04:51:22 -0700 (PDT) To: libc-alpha@sourceware.org, Lukasz Majewski , Carlos O'Donell Subject: [PATCH 08/18] linux: Remove supports_time64 () from clock_gettime Date: Thu, 17 Jun 2021 08:50:54 -0300 Message-Id: <20210617115104.1359598-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210617115104.1359598-1-adhemerval.zanella@linaro.org> References: <20210617115104.1359598-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" It breaks the usage case of live migration like CRIU or similar. The performance drawback is it would require an extra syscall on older kernels without 64-bit time support. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski --- sysdeps/unix/sysv/linux/clock_gettime.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c index 781d05c2fd..cfe9370455 100644 --- a/sysdeps/unix/sysv/linux/clock_gettime.c +++ b/sysdeps/unix/sysv/linux/clock_gettime.c @@ -22,7 +22,6 @@ #include #include "kernel-posix-cpu-timers.h" #include -#include #include /* Get current value of CLOCK and store it in TP. */ @@ -35,19 +34,14 @@ __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp) # define __NR_clock_gettime64 __NR_clock_gettime #endif - if (supports_time64 ()) - { #ifdef HAVE_CLOCK_GETTIME64_VSYSCALL - r = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp); + r = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp); #else - r = INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp); + r = INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp); #endif - if (r == 0 || errno != ENOSYS) - return r; - - mark_time64_unsupported (); - } + if (r == 0 || errno != ENOSYS) + return r; #ifndef __ASSUME_TIME64_SYSCALLS /* Fallback code that uses 32-bit support. */