mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Stanislav Fomichev <stfomichev@yandex-team.ru>
Cc: viresh.kumar@linaro.org, paul.gortmaker@windriver.com,
	peterz@infradead.org, stuart.w.hayes@gmail.com,
	david.vrabel@citrix.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hrtimers: conditionally lock/unlock spinlock in hrtimer_get_next_event
Date: Mon, 9 Jun 2014 13:06:48 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1406091304140.3830@nanos> (raw)
In-Reply-To: <1402305825-3015-1-git-send-email-stfomichev@yandex-team.ru>

On Mon, 9 Jun 2014, Stanislav Fomichev wrote:

> In hrtimer_get_next_event we unconditionally lock/unlock spinlock, even if it's
> not required (hrtimer_hres_active() != 0). This patch moves
> locking/unlocking and mindelta range check inside the if clause,
> so we don't execute unnecessary operations.

What's wrong with simply doing:

       if (!hrtimer_hres_active())
       	  return mindelta;

That saves and indentation level and makes the code more
readable. Also the lockless check wants a comment why it is correct.

Thanks,

	tglx

  parent reply	other threads:[~2014-06-09 11:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09  9:23 Stanislav Fomichev
2014-06-09  9:27 ` Viresh Kumar
2014-06-09 11:06 ` Thomas Gleixner [this message]
2014-06-09 11:11   ` Stanislav Fomichev
2014-06-09 12:59     ` [PATCH v2] hrtimers: add fast path to hrtimer_get_next_event Stanislav Fomichev
2014-06-09 13:28       ` Viresh Kumar
2014-06-10  7:42         ` Peter Zijlstra
2014-06-09 14:44       ` Thomas Gleixner
2014-06-10  9:46         ` [PATCH v3] " Stanislav Fomichev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1406091304140.3830@nanos \
    --to=tglx@linutronix.de \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=peterz@infradead.org \
    --cc=stfomichev@yandex-team.ru \
    --cc=stuart.w.hayes@gmail.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome