From patchwork Wed Jul 9 15:25:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 33329 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2390B208CF for ; Wed, 9 Jul 2014 15:25:32 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id il7sf24884348vcb.8 for ; Wed, 09 Jul 2014 08:25:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=J3dT7rWtZ/bejzEpMLBpf8exPzlDsqb6pZ6O9oLHOPQ=; b=PzopVMlmERCMyR7LO5ycWcrjJAj13kbevSH8RgWZI7aQtZHqm73pUWIMKdazUpVsCi RyVNTpFjbgqfLV32ADh3FgdCCYXq1HMRlkbFQXGHnzYGnWy1tvS61ES8CoNCiRo6+NrH PiTjUlmI/Z1f20N3IMxtoju1JwCbe+Rrn3JxS40NDs7GDzeXSQ2UBD2/q7aodcEBiJNI BVNvwob3W1lLL/8NMwvO3c5kWZMeR5J00f9JKO0USEc15fKgKwQKpfg/uVWAQfgNUXNv +W7RRqsceD/q7C9XtQH/xuMP4pr7UgmC/WFKVizUlUnvd23mTFjrMtViwy1oZ+uAYbJW 3wSg== X-Gm-Message-State: ALoCoQk9K1Cw81JJYBpMKOkQiPkT2KAJEiSaVgi0GulC2kcp2CerH3pJs2s3MKAXznNLDhadbBJQ X-Received: by 10.236.101.148 with SMTP id b20mr17698591yhg.46.1404919531883; Wed, 09 Jul 2014 08:25:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.4 with SMTP id 4ls2661634qgy.98.gmail; Wed, 09 Jul 2014 08:25:31 -0700 (PDT) X-Received: by 10.58.149.170 with SMTP id ub10mr28425712veb.0.1404919531796; Wed, 09 Jul 2014 08:25:31 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id tb9si15600262vcb.32.2014.07.09.08.25.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Jul 2014 08:25:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ij19so7057225vcb.23 for ; Wed, 09 Jul 2014 08:25:31 -0700 (PDT) X-Received: by 10.52.88.44 with SMTP id bd12mr608260vdb.86.1404919531712; Wed, 09 Jul 2014 08:25:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp56537vcb; Wed, 9 Jul 2014 08:25:31 -0700 (PDT) X-Received: by 10.70.102.10 with SMTP id fk10mr11585244pdb.111.1404919530871; Wed, 09 Jul 2014 08:25:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fy14si7458790pdb.120.2014.07.09.08.25.30; Wed, 09 Jul 2014 08:25:30 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964776AbaGIPZL (ORCPT + 28 others); Wed, 9 Jul 2014 11:25:11 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:48541 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932591AbaGIPZE (ORCPT ); Wed, 9 Jul 2014 11:25:04 -0400 Received: by mail-ob0-f173.google.com with SMTP id va2so8261408obc.4 for ; Wed, 09 Jul 2014 08:25:02 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.123.66 with SMTP id ly2mr47839408oeb.19.1404919502710; Wed, 09 Jul 2014 08:25:02 -0700 (PDT) Received: by 10.182.233.166 with HTTP; Wed, 9 Jul 2014 08:25:02 -0700 (PDT) In-Reply-To: <53BD1AA3.4000203@arm.com> References: <13861232628603285a2734e32b309abd73c8741c.1404888801.git.viresh.kumar@linaro.org> <53BD1AA3.4000203@arm.com> Date: Wed, 9 Jul 2014 20:55:02 +0530 Message-ID: Subject: Re: [RFC 2/7] hrtimer: don't check for active hrtimer after adding it From: Viresh Kumar To: Chris Redpath Cc: "tglx@linutronix.de" , "linaro-kernel@lists.linaro.org" , "fweisbec@gmail.com" , "linux-kernel@vger.kernel.org" , "preeti@linux.vnet.ibm.com" , Arvind Chauhan Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 9 July 2014 16:04, Chris Redpath wrote: > On 09/07/14 07:55, Viresh Kumar wrote: >> diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c >> index cf40209..a76f962 100644 >> --- a/kernel/hrtimer.c >> +++ b/kernel/hrtimer.c >> @@ -1555,8 +1555,6 @@ static int __sched do_nanosleep(struct >> hrtimer_sleeper *t, enum hrtimer_mode mod >> do { >> set_current_state(TASK_INTERRUPTIBLE); >> hrtimer_start_expires(&t->timer, mode); >> - if (!hrtimer_active(&t->timer)) >> - t->task = NULL; >> >> if (likely(t->task)) >> freezable_schedule(); >> @@ -1837,8 +1835,6 @@ schedule_hrtimeout_range_clock(ktime_t *expires, >> unsigned long delta, >> hrtimer_init_sleeper(&t, current); >> >> hrtimer_start_expires(&t.timer, mode); >> - if (!hrtimer_active(&t.timer)) >> - t.task = NULL; >> >> if (likely(t.task)) >> schedule(); >> > > Maybe safe to remove this if condition too. Included following diff to this patch: mode = HRTIMER_MODE_ABS; @@ -1836,8 +1835,7 @@ schedule_hrtimeout_range_clock(ktime_t *expires, unsigned long delta, hrtimer_start_expires(&t.timer, mode); - if (likely(t.task)) - schedule(); + schedule(); hrtimer_cancel(&t.timer); destroy_hrtimer_on_stack(&t.timer); Latest changes are pushed to my branch in case someone is looking to test them. --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index a76f962..ae7b5cf 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1556,8 +1556,7 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t->timer, mode); - if (likely(t->task)) - freezable_schedule(); + freezable_schedule(); hrtimer_cancel(&t->timer);