Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4138361ybi; Mon, 29 Jul 2019 20:06:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWljkjNpGWn9S1KrGSU7sADhuChJU/6l/QgrZj4vq7qFP7aNPabYZF4+NleNok0GQix9if X-Received: by 2002:a17:902:e40f:: with SMTP id ci15mr113508305plb.103.1564455962660; Mon, 29 Jul 2019 20:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564455962; cv=none; d=google.com; s=arc-20160816; b=QYoqA10DV73xA3sfD4RpQHHMywgsNtLZcKSsYKwpLVHIk79VtrfHFg1cApSPFJTWay s1eQJu9+PpdDyMXLCrQ657PE1LZMk/mNjRyB3lZQOP/YfgSHOw03S4bw9EWQI/xlokX6 qYSWLU/ox5tv5UCYOyiDckZ0WM0aHljK8VEe2t75B1ZR+PZYl8gvaNTbiNg3FQXrkDSS i8ilz+NA6KkUz4WoQqimhfYl0NSkJAM+s5s2AMbKHYZp7ek4CQR19n5sgwMrREw1MZ5+ 1uhsGRWD3fg2N9GpZC5nS1zH5ZfcgoYA6i5kSQ1LZHgLxfx4ZcaAeBqFaB2YC0uMTN6n Lmcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DhPhiPaFDmP+L0m96dR9tEY4UhLjSpCkVC6HHYt2zds=; b=e9Z5BmF4LX2bHbD+X2tVmccTutt3sOh9lCabXBoNE90zGHGxPq2BNxBAVbPiz0v0PB qZ/frTTk0/nPSMBHbLNt7RpX0byEjTm4lopPPsuaSBL4ZiYxtgBpl3weXYOCvevOExZp zdvHkW5CV5f/wFaZOnKScT7czOX5Dv4AxvV5YPjjt8x/9uW05OitjsVuK/SbMamz0oRr Q+/CamjA5neC87i9h3D84r3rVO/wwdg6sSXRDkpl8DMCTiE0iq6LUbvA607hfQWv432x 2e9yVI7LNyQeSrM24VC5vy/hvs1jTUX8Sx5NDPHME6S3Q9ajmMkRcsdMcphwbVdxPyTU vhBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=Bzxe9fv+; 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; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a94si24452435pje.19.2019.07.29.20.05.47; Mon, 29 Jul 2019 20:06:02 -0700 (PDT) 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; dkim=pass header.i=@arista.com header.s=googlenew header.b=Bzxe9fv+; 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; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389245AbfG2V6Q (ORCPT + 99 others); Mon, 29 Jul 2019 17:58:16 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45416 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389201AbfG2V6M (ORCPT ); Mon, 29 Jul 2019 17:58:12 -0400 Received: by mail-wr1-f68.google.com with SMTP id f9so63438796wre.12 for ; Mon, 29 Jul 2019 14:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DhPhiPaFDmP+L0m96dR9tEY4UhLjSpCkVC6HHYt2zds=; b=Bzxe9fv+Gz9B6U6SUD29DrXP1PQacwElm6trKex2rmrhyk1ecXwic4zCCCkdnAzAPt RijKROc66z96BoZXqqRukc8FohDP7DRbkAkgGcOSCWPMRwWi5CODxc2hciZQxNAByw8v JbF7/dC9laMqSlnJChBeNExlDSvj/VJPcC+LF017UUgY16fCbvaPHSH7HV69CPbLZjC7 Ng6lxt19dY/6UzEdL4UE+OdONBMxN8SFiLhpS69++vrmWmoz/dEog0uddCKVW+3XIH7u DnrCaf1A99Xz+36wIhMyqMSbeC4i3g+Ub5Eev8nq3aK21RdkF5huE7347qRtTrOaZriI EGbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DhPhiPaFDmP+L0m96dR9tEY4UhLjSpCkVC6HHYt2zds=; b=C4y4tnC2LN/8EFCsicwMHUQPCmWTyq0y0q+0IiT/3XZqpc4RQouCjTIFdXgQNoI0M2 /KoYW6GkIIZbg1QXKrqQCOBdwGCUs5Du1vVYe0yHltNriRdcO4OASgceShMTWyXi45EV 2S6h59VM4C9S0C2uTMYqLh210y971LqFlH5d74OhMWEB3kvunGc7i7fFalDLPWxSMmrH m1+ZBX79AZ+Ve1XxWNImgVDCeynMmiYYTFfjoKcuwFFFSQZF8VFZ0zy6gpuydPUZn/9w xrGEnLVleh+zLYvG3u7hDFKhc+XGOlwrw3Y/OBAjDeP2wVY8Ma5Mx+8rBREANlBzp8cW Wb/Q== X-Gm-Message-State: APjAAAUvktsU17v8F+LxqnErEcwldV77tzbeSTMMX2S8mPUWxs4Eirr2 eQh/WJ3EVUqbQC9eEYBKJWfEG9/6TY4o5hCvsA2jyeFnAMqOnGLgqMrkfgerHaakAt9Hnq6DWZy EN+NoM2Eo8VWYTnA6hsmhz5j60ni0N1SCc42uty/HYXvnYomijLMP4UeDjt+dCy6EoPwQZqHXJ5 rkaAJ8fpa3N9RlMdoaqzXG046UQsV8r4gJS2qzzCw= X-Received: by 2002:adf:db46:: with SMTP id f6mr71646636wrj.212.1564437491336; Mon, 29 Jul 2019 14:58:11 -0700 (PDT) Received: from Mindolluin.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id x20sm49230728wmc.1.2019.07.29.14.58.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 14:58:10 -0700 (PDT) From: Dmitry Safonov To: linux-kernel@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin , Dmitry Safonov , Adrian Reber , Andrei Vagin , Andy Lutomirski , Arnd Bergmann , Christian Brauner , Cyrill Gorcunov , "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , Thomas Gleixner , Vincenzo Frascino , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org Subject: [PATCHv5 08/37] posix-timers: Use clock_get_ktime() in common_timer_get() Date: Mon, 29 Jul 2019 22:56:50 +0100 Message-Id: <20190729215758.28405-9-dima@arista.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729215758.28405-1-dima@arista.com> References: <20190729215758.28405-1-dima@arista.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CLOUD-SEC-AV-Info: arista,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrei Vagin Now, when the clock_get_ktime() callback exists, the suboptimal timespec64-based conversion can be removed from common_timer_get(). Suggested-by: Thomas Gleixner Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time/posix-timers.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index fb1848c84241..aae7ab53790d 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -666,7 +666,6 @@ void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting) { const struct k_clock *kc = timr->kclock; ktime_t now, remaining, iv; - struct timespec64 ts64; bool sig_none; sig_none = timr->it_sigev_notify == SIGEV_NONE; @@ -684,12 +683,7 @@ void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting) return; } - /* - * The timespec64 based conversion is suboptimal, but it's not - * worth to implement yet another callback. - */ - kc->clock_get_timespec(timr->it_clock, &ts64); - now = timespec64_to_ktime(ts64); + now = kc->clock_get_ktime(timr->it_clock); /* * When a requeue is pending or this is a SIGEV_NONE timer move the -- 2.22.0