From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752627AbbFHIGa (ORCPT ); Mon, 8 Jun 2015 04:06:30 -0400 Received: from www.linutronix.de ([62.245.132.108]:40587 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752123AbbFHIG1 (ORCPT ); Mon, 8 Jun 2015 04:06:27 -0400 Date: Mon, 8 Jun 2015 10:06:07 +0200 (CEST) From: Thomas Gleixner To: Oleg Nesterov cc: Peter Zijlstra , umgwanakikbuti@gmail.com, mingo@elte.hu, ktkhai@parallels.com, rostedt@goodmis.org, juri.lelli@gmail.com, pang.xunlei@linaro.org, wanpeng.li@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/14] hrtimer: Allow hrtimer::function() to free the timer In-Reply-To: <20150607225638.GA9329@redhat.com> Message-ID: References: <20150605084836.364306429@infradead.org> <20150605085205.723058588@infradead.org> <20150607223317.GA5193@redhat.com> <20150607225638.GA9329@redhat.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Jun 2015, Oleg Nesterov wrote: > On 06/08, Oleg Nesterov wrote: > > > > And I simply can not understand the complication in hrtimer_active(), > > please help! > > Sorry for another off-topic email, but I don't even understand the > usage of hrtimer_active(). > > Say, do_nanosleep() > > hrtimer_start_expires(&t->timer, mode); > if (!hrtimer_active(&t->timer)) > t->task = NULL; That's gone in tip/timers/core. > OTOH. perf_cpu_hrtimer_restart() does > > if (hrtimer_active(hr)) > return; > > if (!hrtimer_callback_running(hr)) > __hrtimer_start_range_ns(...); > > why it can't simply do > > if (!hrtimer_active(hr)) // implies !hrtimer_callback_running() > __hrtimer_start_range_ns(...); That's fixed as well. Thanks, tglx