Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1374322imj; Thu, 7 Feb 2019 23:57:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IZKHI+sS0cLksk50S5guXpyIgBh/o2tGYoPniqEssNl1AjvuxEPXMulkKDDDWJU5xDRRf5g X-Received: by 2002:a17:902:161:: with SMTP id 88mr21725008plb.306.1549612628828; Thu, 07 Feb 2019 23:57:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549612628; cv=none; d=google.com; s=arc-20160816; b=YjrHkgS3DsHwKNTsG2+dEmyNmv522LFS61fT3/JzeIqy8ayjWQDCIgErQ+B2V3qDgk 40Z2u9rgETOWhNjlMxOmpGNTCHh6XClO2ieaRiDCBoyaJOdZV/pg6gc2mDax1oHI9MoI y3R5a2ZMuMBVAW7MDm75vIQUdsI8NbqurM/Bo9tlclxz9JQ/Vj1kZmAWjaCMiCr0cfvF vEQ1Mayfjj0jc7xWJU4rg76/J7vfyT820xE/G4GK5CcGapYZhQSsaXRqd9APlumXAwgk N/5NmrELcXOjntDp3TRHpGTyo+GnWBvf4OQBpEDJR+ExfF1R5KTJEhRQfbpE3mJZafq9 OVdg== 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:references :message-id:in-reply-to:subject:cc:to:from:date; bh=QjaZn60b3FgFJBrZwVsxAxUbcX56zAq4cAptlUl89FI=; b=vvI+cQWlocSizXYHbwWv4dQ4Mjjb2+RHrcxZGq+qV9WJbQWwLP5MEwvsufpQPhK+sI 5MkZdqN6kw2VgUUYiLSfjWxJtZRsYmiZU/MmNQ0+qF9HF71xrxy4Mf6XYHADEk+9x2g4 mjcqnAMyUva4xrY43b+W7gEZjixlON6XhOjLrOg/blECnxCF83kJeNzw+tQRqvfRBq3c 0bMOBzdXtwRy88pQQ7gvtB8Ctdzvsp13+9WdMTnMggKBSlJMneSRLH1AgauL7Kf3rkHE eipimm2fpwfFIWqhbU43jms5As2oCPVQMxWBwBl/mR21zLcgBnNFecLH4MVjMWnzMHqR Lq3w== 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 a35si1543302pla.226.2019.02.07.23.56.52; Thu, 07 Feb 2019 23:57:08 -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 S1727177AbfBHH4q (ORCPT + 99 others); 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