From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E83DC169C4 for ; Fri, 8 Feb 2019 07:56:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3552B21917 for ; Fri, 8 Feb 2019 07:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727210AbfBHH4q (ORCPT ); Fri, 8 Feb 2019 02:56:46 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:42153 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726004AbfBHH4q (ORCPT ); Fri, 8 Feb 2019 02:56:46 -0500 Received: from p5492e0d8.dip0.t-ipconnect.de ([84.146.224.216] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gs11O-00043h-3k; Fri, 08 Feb 2019 08:56:26 +0100 Date: Fri, 8 Feb 2019 08:56:25 +0100 (CET) From: Thomas Gleixner To: Dmitry Safonov cc: linux-kernel@vger.kernel.org, Andrei Vagin , Adrian Reber , Andrei Vagin , Andy Lutomirski , Andy Tucker , Arnd Bergmann , Christian Brauner , Cyrill Gorcunov , Dmitry Safonov <0x7f454c46@gmail.com>, "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 07/32] timens/kernel: Take into account timens clock offsets in clock_nanosleep In-Reply-To: <20190206001107.16488-8-dima@arista.com> Message-ID: References: <20190206001107.16488-1-dima@arista.com> <20190206001107.16488-8-dima@arista.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Feb 2019, Dmitry Safonov wrote: > > @@ -1721,9 +1722,16 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp, > { > struct restart_block *restart; > struct hrtimer_sleeper t; > + struct timespec64 tp; > int ret = 0; > u64 slack; > > + if (!(mode & HRTIMER_MODE_REL)) { > + tp = *rqtp; > + rqtp = &tp; So every invocation of hrtimer_nanosleep() gains a copy of the timespec64 even if the namespace muck is disabled. The only relevant caller of this is common_nsleep(). So it might make sense to have common_nsleep() separated for CLOCK_MONOTONIC/BOOTTIME and handle the thing there. That again avoids the switch() to and out of line calls. Thanks, tglx