Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5665242ima; Tue, 5 Feb 2019 16:14:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IZaevAQMDzREm0lhN7fJGPvyrmMpQnRY8Y/HWMjq464QdfGxFZfnyxmow1MBEfbGrbaqOqh X-Received: by 2002:a63:9712:: with SMTP id n18mr6872714pge.295.1549412088520; Tue, 05 Feb 2019 16:14:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549412088; cv=none; d=google.com; s=arc-20160816; b=WZCfbQK8wW+yBpl+bbR27xycpfPSJW3FEc7YjMhr/0xExmGouyvww764ttibMngP2/ OrGVlOf0SgRaLr8Q7IwqB2J+QACrMyyAbd2bqgGezzbLLLT8uF5zufAWolutjUhjWdcH mJF0Vl2nHVdyPmEOaYGJ+JkL88VXxOFuZJc3HD6rcgnHjZ1f9BRGaRBoVog7Aa+0N+co paHhSKudBVpO0AfWQGxjoZ7zHmA1y+RlgPzCutdZxEDYnpzGmRgTnulE9FoWuo6r0Kh5 O5q6TrJl3K2liMClyYT8swGo1j8Ck+3MH+MTbeKhZpOijrLvRO4WEAq9r8u6NVsGGi0D ehPQ== 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=zNAVIH5tXGvK+Oi4RqlWPSq+okg61aIZvW5S3G/qiBk=; b=WjhuMPfpua+vrD4z8J7l48tx1WJZPSh5d863+YV0C4LXAsN7C18vD1xHQL/RkfxNoi uzsOoOATdGOMrqrTlZjIWeo8+xll1ctfqPnBw3FJTVaLB9E6w9ron4635/si0VWmZPiI V0VbEI+V+KrirFnTxo9DnUXSpDT/j1HEMKKrnkKXfhoLkyAfo+CjSOLg6P9s1qbwskXz B5bFOOZzX3xV11jGPx3tnCITKBBN3wCQJBFPdFDU+su5JHUWbOaiVRxfCBX2M8JuJZdo RmigMHg2/EF7cA5Xbfa6ueuCLNhjejYEqBZIzVcCz+Zq1MSNic429dtHprF1lWsHGdyN z9SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=kGiTxljn; 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 204si4191648pga.383.2019.02.05.16.14.32; Tue, 05 Feb 2019 16:14:48 -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; dkim=pass header.i=@arista.com header.s=googlenew header.b=kGiTxljn; 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 S1730155AbfBFANp (ORCPT + 99 others); Tue, 5 Feb 2019 19:13:45 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:35217 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727403AbfBFALU (ORCPT ); Tue, 5 Feb 2019 19:11:20 -0500 Received: by mail-ed1-f66.google.com with SMTP id b17so321987eds.2 for ; Tue, 05 Feb 2019 16:11:19 -0800 (PST) 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=zNAVIH5tXGvK+Oi4RqlWPSq+okg61aIZvW5S3G/qiBk=; b=kGiTxljnyIIE3rrOlleGdhd1pRlAohejD4LkRskE5+y2/a0jtQl7LdGW/baXd39hk5 6PVzXOMsvn9VJfA3HJjWv6ze6Llp3WQC+eDVJmW9l039ExoVmD/R9+mmX85TN0nBALg2 mXrZBCPxwKa41imMM7oQxxVb4xdFKlWzpMGTPBPGH3DnSgWdPJYEfMPsLYUXFKRz4B0W qJ6miThUsQiY3ER+a1GFx4WV4FVqvaYQowO2r9U/g9VGcmYtOiJhDYGQIUJjAESKs2ki LD+qMlvq87wfBrs6zoHe6UaS8bt/i/U/ttxTs9uIqpqsuwY4IuYclPR761ZYloBIFFIn XUOA== 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=zNAVIH5tXGvK+Oi4RqlWPSq+okg61aIZvW5S3G/qiBk=; b=OCdcF91vlfu8vHL/55vQMtZhaktV9fP7aJfry2ff0tMhMscTZifPzzODziNZCynhWA SY0V9LIweprycmGN93AZE8wyS5kHPFdUsqR4rbg+D+CjZpMez4a+XpSZ4AtooyqtpJ9r apG4iZ0u/08Bs9/TrlQH0v4KV+dgMWJL4RpwWPGN0giGmTjdqAxUwwUb7KAwPMY7GYJv BIav/V9jE4zq5bZOHEMku1lhHnX5ucwPzGeuDHek6QUfn1vwWGep+Xhr6W6jzB6jzySH TDoQhCRqhG7HHaQOvFIdqXPtIkiX36/wqo9u9ZemhrtC3Hvl2Acky/4QGYxqFGvSNGZT PEUg== X-Gm-Message-State: AHQUAuYnMHMHxAf/qbAAqrwcDKOxhUPy+ZMUnxm0HMffGjdGTLSzPY0i BkO8QLUUKFSUhRf1DkMzIMy2spCEZAM= X-Received: by 2002:a17:906:1cd7:: with SMTP id i23mr5082403ejh.150.1549411878900; Tue, 05 Feb 2019 16:11:18 -0800 (PST) Received: from Mindolluin.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id p30sm5489594eda.68.2019.02.05.16.11.17 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 05 Feb 2019 16:11:18 -0800 (PST) From: Dmitry Safonov To: linux-kernel@vger.kernel.org Cc: Andrei Vagin , Dmitry Safonov , 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 , Thomas Gleixner , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org Subject: [PATCH 07/32] timens/kernel: Take into account timens clock offsets in clock_nanosleep Date: Wed, 6 Feb 2019 00:10:41 +0000 Message-Id: <20190206001107.16488-8-dima@arista.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206001107.16488-1-dima@arista.com> References: <20190206001107.16488-1-dima@arista.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 f5cfa1b73d6f..47345aea406d 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -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; + timens_clock_to_host(clockid, &tp); + } + slack = current->timer_slack_ns; if (dl_task(current) || rt_task(current)) slack = 0; -- 2.20.1