Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1194695imm; Wed, 19 Sep 2018 13:53:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaJJQXKKMPoWNNdW538bCzGgxP/WjV4W/Mn7W/Un3xcThMnrhioyW1Y5Qj3THamkcEgn/js X-Received: by 2002:a17:902:6b44:: with SMTP id g4-v6mr36338837plt.50.1537390382014; Wed, 19 Sep 2018 13:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537390381; cv=none; d=google.com; s=arc-20160816; b=was4ZuPG/Etmt1A/ZzkGrlbEQjYHhgw3THTfj+0LZ/76T+exPCv9LSe/3ABMxuzqp3 WGmTjxwkLU0SpJCYNl2ZymOcLUEJ5Xz2+v7Owu8taJ9qMCRBr1ouk95rECqu9DjBkRSb eLKaXiAQTzPu8CT7NzPh/tvgjhKnD9qV1vDvd18LUdeYVL6QjR6KCft8NbPDmtrkCa0s x01MNS9V2aUO5qOs7s/wpCGLjDHq/5ZNWMPIh+8LPUcyHsFCxQFqMvKnlTiQTf03SuAu T3yFfllGvKfIEIfX2br2XoIL2krBEinkuejseqHP0GBE034L+i5ANRBinwXW9y27b0zw Q+fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=PQ4JZILf1wPuiGcYuzRMQXBJWimKQO+nHWv+GPkcK2A=; b=GLToIwPI6kitwdB8TAuPl2HZpuZchXlcwiQclWPYwAs2hxXZC62y8EQl4muZcpZNqD FhspccDXZkxIBhknf0v9o9DRmqYx4ECRPnj7515vmLdDZ3RR1b33DRVzvYgFG40P2Vt+ fp3Eb8SmlkCsT5ic/DjzNGsdr+MQZFxnh6+2csbGIWqktxWMRLBY/LM0OD8/GOtXfPp5 yKXYq2Gmjhs9clN6OTrkDKmJss/8TOZVx7IGzB0PGWKu9fylrTYtVW8j9Jqt+3bChgIR ng++2I4DGZcJX9L0lcgrQETpNr2Ek8UUyE+7/aRLzGu/zimu/YPIlQj46bBnAN09NLDf fhxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=BOrkhkg6; 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 j10-v6si22882599plk.406.2018.09.19.13.52.46; Wed, 19 Sep 2018 13:53:01 -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=BOrkhkg6; 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 S1732751AbeITCaa (ORCPT + 99 others); Wed, 19 Sep 2018 22:30:30 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:35945 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732336AbeITCa3 (ORCPT ); Wed, 19 Sep 2018 22:30:29 -0400 Received: by mail-ed1-f67.google.com with SMTP id f4-v6so6046611edq.3 for ; Wed, 19 Sep 2018 13:50:49 -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; bh=PQ4JZILf1wPuiGcYuzRMQXBJWimKQO+nHWv+GPkcK2A=; b=BOrkhkg6srttMHh8viMt1I07BhwLwtU170hEzjUXLacCyz8+edIzXxwjS7g40sOYcT qT3xgjMNN9fM4iEBUChIKLhG2cRp1RnXGfnYlF0uVlZGyb448oPoK3vZzgmIOXM093WM 5X2QEzWoPtudKa6CGxSFAgiJkT2u1Ow4swSJHk7bKkG3+EwTIiDH56Qxg00vmbL34AzB GM/C+j2gEooTJYkJboHgVBg+CRtsi7u0ZSJ8MZppDOgCfXsdb2ZCIsYPwSOwhzhL4eN0 TaWVizIs4vR1zRYIi/kzq1mCFo2Nzc2+dJgYbNph4VeI4m6m2unnm9kYBhh4SP52W562 2ClA== 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; bh=PQ4JZILf1wPuiGcYuzRMQXBJWimKQO+nHWv+GPkcK2A=; b=lwT8z+HdtT1EHCrB2Wp1HufGcLPswZkZYV2ws1e4d0WhycMRU6aTdiFsE1aVIjZGYd +L4EiI0TiK7LOZLxSIDQwiiR4cHDgFyiFQKIcEKN1w3G7ZenItgLn4z3Aa+aLx+9dUf4 B1/mpUsO/5Oids1rfMiTj3QDnhfjtjoQtObaD4dmT5G7FxAN+AKela0Akw7/avbWC6zs braZ+2LiCKEZdRs7zQlfZxit4yV2jdBOtQ/Ttctn3yoxPian2sEbtJMR80i3G7v2SINb 1mYebe9pGwXHmoCVetpblgg9n2Ik7KITDvYZFzvh17B+bXir82cHfUGpzOJPlQQaC6cA Kwrw== X-Gm-Message-State: APzg51CUjTYo8qB4N6vUXIfTb8FI5G3ss5iYCWOai7/6kGf0RDLCpuNu 6pvDs8xeL5HG2ZSIHrhNlk5XJHaM4tU= X-Received: by 2002:a50:f297:: with SMTP id f23-v6mr61787971edm.40.1537390248054; Wed, 19 Sep 2018 13:50:48 -0700 (PDT) Received: from dhcp.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id t17-v6sm1747729edb.27.2018.09.19.13.50.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 13:50:47 -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 , Christian Brauner , Cyrill Gorcunov , "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , Thomas Gleixner , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org Subject: [RFC 06/20] kernel: Take into account timens clock offsets in clock_nanosleep Date: Wed, 19 Sep 2018 21:50:23 +0100 Message-Id: <20180919205037.9574-7-dima@arista.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180919205037.9574-1-dima@arista.com> References: <20180919205037.9574-1-dima@arista.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrei Vagin Wire up clock_nanosleep to timens offsets. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- kernel/time/hrtimer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index e1a549c9e399..4fe80c1325b2 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -51,6 +51,7 @@ #include #include #include +#include #include @@ -1730,9 +1731,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; + timens_clock_to_host(clockid, &tp); + } + slack = current->timer_slack_ns; if (dl_task(current) || rt_task(current)) slack = 0; -- 2.13.6