Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751611AbdFIUMg (ORCPT ); Fri, 9 Jun 2017 16:12:36 -0400 Received: from mail-he1eur01on0127.outbound.protection.outlook.com ([104.47.0.127]:47664 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751538AbdFIUMd (ORCPT ); Fri, 9 Jun 2017 16:12:33 -0400 Authentication-Results: zytor.com; dkim=none (message not signed) header.d=none;zytor.com; dmarc=none action=none header.from=virtuozzo.com; Date: Fri, 9 Jun 2017 13:12:06 -0700 From: Andrei Vagin To: tip-bot for Jacob Shin Cc: linux-tip-commits@vger.kernel.org, peterz@infradead.org, john.stultz@linaro.org, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, Cyrill Gorcunov Subject: Re: [tip:timers/core] posix-timers: Zero settings value in common code Message-ID: <20170609201156.GB21491@outlook.office365.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-Originating-IP: [4.16.175.162] X-ClientProxiedBy: SG2PR0199CA0002.apcprd01.prod.exchangelabs.com (2a01:111:e400:588d::12) To VI1PR08MB0751.eurprd08.prod.outlook.com (2a01:111:e400:5a04::13) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR08MB0751: X-MS-Office365-Filtering-Correlation-Id: d541cb59-6124-425e-f71e-08d4af73db9d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:VI1PR08MB0751; X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0751;3:8kyL912DwYdHJtcR1SZTnAAq5/L/0CNpYx5+o5oL78MO4KddNSLzTw0woxvkneuJVggiQcM+j2RD8gOyqm17qFe518k4zLtsPd/acil8JTwQtOfCy+TRbbXvFOmRSnNbdKWm5bgzu2A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kqTDy3qqDdcmpUuPcLxTqbIRzjnYJDH1IHHrb3j9GS4/4b2BycS0Erk82EXvpXovOAuxbh7/7XkH1w1pXaw7dgUaA0NWC10ri1aOhIJX7CVTxSCSMZimTHGvNGrfDuWMFFSx2UhJUWUqM5AJPx2LZbCaLs9fXPKiBIUUz4VCpoQ8AzB7RnSBfwmbFaiqXruE3Sj3851YhGkE6XCxhVBsuS3VkB20mxrPcFemmag+FDj3vIm9k9bCvjaKLRWHgyvkP+Y0wKd/L/vPRLbzRKxMolt7ADM0zTPFD5i8oF7QcQJzL0mTbwIOSclvWQwuI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(166708455590820)(42068640409301)(84791874153150); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123564025)(20161123555025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR08MB0751;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR08MB0751; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;VI1PR08MB0751;4:mQZ8lm7dnKyz4jbZdk9OFIQtYLTCel1JxmGN+TSeZJQ+?= =?koi8-r?Q?9IdwF7fvwk+BBv0pxZ4RT+IFLH2Eju5oBWPQP9Q13ry9CJ06ZXCbdzJ0KRaSDG?= =?koi8-r?Q?o4qUJ9pPP2358miSZ/P7bx4c0h5STtJ3ncdGl2a2szoXBgPN2213m/qLc7exLx?= =?koi8-r?Q?po8UF+fESDMbNV4W+JllbUoZ7oj7KjOKe3xlm89G+0QQiq70txHrU1K/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IdwKvXWg/gT4w0uS0L+ouoxhBxn/kFZJQBAnCrIFq4jMcFxpDvFU9miEz?= =?koi8-r?Q?eQbki4QZk/HE85mcC0PsNE10yWx0DXIH2JwMp6LIZcAJ8hxNiXo6dQSuyp/r99?= =?koi8-r?Q?Y096bqUShz1PvM7BRV4OIkFARVuAMzMGbEbrXUb9L2ZptNYJDd7mhhrNHp?= X-Forefront-PRVS: 03333C607F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39410400002)(39400400002)(39830400002)(39450400003)(24454002)(7736002)(47776003)(966005)(81166006)(1076002)(86362001)(33656002)(189998001)(42186005)(38730400002)(107886003)(6246003)(110136004)(6506006)(478600001)(305945005)(25786009)(3846002)(8676002)(66066001)(5660300001)(50986999)(76176999)(23686003)(6306002)(4326008)(37156001)(9686003)(53936002)(229853002)(55016002)(6916009)(2950100002)(6666003)(53416004)(2906002)(1720100001)(54356999)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR08MB0751;H:outlook.office365.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;VI1PR08MB0751;23:kfQgQPhAGiqLfb8IF7FeKwJA+/VGe8tnVplm1ehApE3?= =?koi8-r?Q?ZiuYAM4Wv9Riqy+eOfYNkTF72QVttFia9r4CNhqgEmyh9GcPQrB7B49Qno0M2F?= =?koi8-r?Q?dnGbK0WUtI+rgRLRTDs8M1CSSKSROn6c/Ce5IzJ7PFNZRdCUtEkSxcEqLgVYv9?= =?koi8-r?Q?TZdGpMyxskNWUe0g0vJwHvHkntW8phJ4MKgORiKp/G+8mNJFA76aTueoHvhjff?= =?koi8-r?Q?yrwvVXiWj7C98HdT2/VYtnCCmMwXnhJAIvo8p0z79QJYIlGBA5MBj44i1RhjP5?= =?koi8-r?Q?hB/Zsh+TJHgKzo21eUB7PvC6V+VFfWTJ8K2qQB0bON/HlK7OB7bzZOSBvTuE81?= =?koi8-r?Q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YUcXT9pUEdeyLcwqD4ZsJm13dQ9FQD4JXPWY8WSu2za8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0751;7:lo9x9qCr0jEWyR2qo5NKerS0LdZmh7xorFZ7n99GIEzH6bfy9vrIoDB6niSG9UCcsmzCQL4mEQPvAw8qyimhZ+6pCOtbrVw9HgTcGfpDcZ908jABt0OJtxqOBgrAwXdmHL4YZ3r3Or3M0EZO4qnBvCffDGKgaqqBgjhrJwlsaGfSUTGYiZrzFHcAiSuq0dk+3fXEh+WiZP5wQD957OTNUsQAAXqbH2/eNejGYV2yI8P0GmpiJTc+BPSL8eVjCTScZpQeHbKfoM1cDuN7bN6zSKv6IKyGQpKk6aq1RQPa+/Q4YeBqFdJwc0iRVza/DZnvEzyShZ9Y+elk+sq6GXVPxA==;20:vYQFR4N6sK6p9oPzr/mCyE3BCYq165wVoQvPVfBw5N7SeTgpTBbgLM/aFoCRqXbPhsUitftVYGP8PRGu4dI6lbD30LH7vjA/CFbb7DDHPwvvgcvgSa5yoWK8EGq0MzAPkfgIqrArHefwXkEX8jerQbyyXp6EEiK8PcOx0pJGttE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2017 20:12:26.9400 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB0751 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4403 Lines: 107 Hello Thomas, This patch breaks one of our CRIU tests: https://github.com/xemul/criu/blob/master/test/zdtm/static/posix_timers.c#L145 python /root/git/main/criu/test/zdtm.py run -t zdtm/static/posix_timers --iter 0 ====================== Run zdtm/static/posix_timers in h ======================= Start test ./posix_timers --pidfile=posix_timers.pid --outfile=posix_timers.out Send the 15 signal to 24 Wait for zdtm/static/posix_timers(24) to die for 0.100000 ############## Test zdtm/static/posix_timers FAIL at result check ############## Test output: ================================ 22:39:39.573: 24: ( start) boottime 12 boottime-coarse 12 total_sleep_time 0 22:39:39.602: 24: ( end) boottime 12 boottime-coarse 12 total_sleep_time 0 22:39:39.603: 24: FAIL: posix_timers.c:145: REALTIME (oneshot): timer became periodic 22:39:39.603: 24: FAIL: posix_timers.c:145: MONOTONIC (oneshot): timer became periodic 22:39:39.603: 24: FAIL: posix_timers.c:145: BOOTTIME (oneshot): timer became periodic <<< ================================ === Run 1/1 ================ zdtm/static/posix_timers ##################################### FAIL ##################################### This test sets a timer and then check that it is set correctly. And with this patch, we see that timer_settime returns incorrect data. 2447 timer_settime(10, 0, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=2147483, tv_nsec=647000000}}, NULL) = 0 .... 2519 timer_settime(10, 0, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=0, tv_nsec=0}}, 2509 <... exit_group resumed>) = ? 2519 <... timer_settime resumed> {it_interval={tv_sec=-1861316067, tv_nsec=18446645490300239488}, it_value={tv_sec=-1852565060, tv_nsec=133}}) = 0 Thanks, Andrei On Mon, Jun 05, 2017 at 01:21:46AM -0700, tip-bot for Jacob Shin wrote: > Commit-ID: eabdec04385376d560078992710104cc7be2ce1b > Gitweb: http://git.kernel.org/tip/eabdec04385376d560078992710104cc7be2ce1b > Author: Thomas Gleixner > AuthorDate: Tue, 30 May 2017 23:15:51 +0200 > Committer: Thomas Gleixner > CommitDate: Sun, 4 Jun 2017 15:40:28 +0200 > > posix-timers: Zero settings value in common code > > Zero out the settings struct in the common code so the callbacks do not > have to do it themself. > > Signed-off-by: Thomas Gleixner > Cc: Peter Zijlstra > Cc: John Stultz > Link: http://lkml.kernel.org/r/20170530211657.200870713@linutronix.de > --- > kernel/time/posix-cpu-timers.c | 5 +---- > kernel/time/posix-timers.c | 3 +-- > 2 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c > index 96c833a..cb4a4eb 100644 > --- a/kernel/time/posix-cpu-timers.c > +++ b/kernel/time/posix-cpu-timers.c > @@ -719,10 +719,8 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec64 *itp > */ > itp->it_interval = ns_to_timespec64(timer->it.cpu.incr); > > - if (timer->it.cpu.expires == 0) { /* Timer not armed at all. */ > - itp->it_value.tv_sec = itp->it_value.tv_nsec = 0; > + if (!timer->it.cpu.expires) > return; > - } > > /* > * Sample the clock to take the difference with the expiry time. > @@ -746,7 +744,6 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec64 *itp > * Call the timer disarmed, nothing else to do. > */ > timer->it.cpu.expires = 0; > - itp->it_value = ns_to_timespec64(timer->it.cpu.expires); > return; > } else { > cpu_timer_sample_group(timer->it_clock, p, &now); > diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c > index 48f6c37..0332f7a 100644 > --- a/kernel/time/posix-timers.c > +++ b/kernel/time/posix-timers.c > @@ -645,8 +645,6 @@ common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting) > struct timespec64 ts64; > bool sig_none; > > - memset(cur_setting, 0, sizeof(*cur_setting)); > - > sig_none = (timr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE; > iv = timr->it_interval; > > @@ -705,6 +703,7 @@ SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, > if (!timr) > return -EINVAL; > > + memset(&cur_setting64, 0, sizeof(cur_setting64)); > kc = timr->kclock; > if (WARN_ON_ONCE(!kc || !kc->timer_get)) > ret = -EINVAL;