[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKc596LR-=yabCEo_PT0p6Ynr5EWEXc1Fq+CcpPMeo9t3ALV9Q@mail.gmail.com>
Date: Thu, 23 Jul 2020 12:48:17 +0800
From: jun qian <qianjun.kernel@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: peterz@...radead.org, will@...nel.org, luto@...nel.org,
linux-kernel@...r.kernel.org, Uladzislau Rezki <urezki@...il.com>,
Yafang Shao <laoar.shao@...il.com>
Subject: Re: [RFC PATCH v2] Softirq:avoid large sched delay from the pending softirqs
On Thu, Jul 23, 2020 at 2:05 AM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> qianjun.kernel@...il.com writes:
> > +
> > + end = ktime_get();
> > + delta = ktime_to_us(end - start);
>
> What's the point of this conversion? That's a division for no value
> because you can simply define the maximum time in nanoseconds with the
> same effect, i.e.
>
> ktime_t end = ktime_get() + MAX_SOFTIRQ_TIME_NS;
>
> if (need_resched() && ktime_get() > end)
> break;
>
> So you can spare all that start, delta and conversion dance and keep the
> code simple.
>
> Also notice that need_resched() wants to be evaluated first because
> there is no point to do the more expensive time read if need_resched()
> is false.
good suggestion,Thanks
I will make changes in the next version
>
> Thanks,
>
> tglx
Powered by blists - more mailing lists