[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53BD1DEC.7050305@arm.com>
Date: Wed, 09 Jul 2014 11:48:12 +0100
From: Chris Redpath <Chris.Redpath@....com>
To: Viresh Kumar <viresh.kumar@...aro.org>
CC: "tglx@...utronix.de" <tglx@...utronix.de>,
"linaro-kernel@...ts.linaro.org" <linaro-kernel@...ts.linaro.org>,
"fweisbec@...il.com" <fweisbec@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"preeti@...ux.vnet.ibm.com" <preeti@...ux.vnet.ibm.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Arvind Chauhan <Arvind.Chauhan@....com>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [RFC 7/7] net: don't check for active hrtimer after adding it
On 09/07/14 11:44, Viresh Kumar wrote:
> Hi Chris,
>
> On 9 July 2014 16:02, Chris Redpath <Chris.Redpath@....com> wrote:
>
>>> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
>>> index fc17a9d..f911acd 100644
>>> --- a/net/core/pktgen.c
>>> +++ b/net/core/pktgen.c
>>> @@ -2186,8 +2186,6 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t
>>> spin_until)
>>> do {
>>> set_current_state(TASK_INTERRUPTIBLE);
>>> hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS);
>>> - if (!hrtimer_active(&t.timer))
>>> - t.task = NULL;
>>>
>>> if (likely(t.task))
>>> schedule();
>>
>>
>> I think this if condition can also be removed. hrtimer_init_sleeper copies
>> the supplied task_struct * to the timer, which in this case is 'current'.
>> The check is likely to be there in case of !active case you removed.
>
> Yeah, it looks like we can get rid of this. Also,
>
> } while (t.task && pkt_dev->running && !signal_pending(current));
>
> is present in the closing "}" of do-while loop and probably we
> don't need to check t.task here as well.
>
> And this review comment applies to patch 2/7 as well:
> hrtimer: don't check for active hrtimer after adding it
>
> I would still wait for somebody to prove us wrong :), and will resend
> it next week only.
>
> Thanks.
>
Yeah, no worries. I just happened to read it and not knowing any of the
APIs had to look up what is going on.
BTW, I *will* get back to you about that broadcast stuff when I get back
to it myself. Other priorities at the moment again.
--Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists