Re: loop in CoreCheckTimers


Stanley Gan
 

Hi Laszlo,
Thanks for your reply.
I mean " CoreSignalEvent (mEfiCheckTimerEvent)" in CoreCheckTimers is not
necessary.
Because all timer event already signified in CoreCheckTimers 1st run. We
don't need to run CoreCheckTimers again.
I actually add Commit 239b50a86370 to my project. It can solve my problem.
But I don't think it's a good long term solution. It's not the root cause
of the issue.

On Mon, Sep 7, 2020 at 7:39 PM Laszlo Ersek <lersek@redhat.com> wrote:

(CC Jeff)

On 09/07/20 02:29, Stanley Gan wrote:
Hi All,



I have some questions about MdeModulePkg\Core\Dxe\Event\Timer.c
CoreCheckTimers.

My system will keep looping in CoreCheckTimers in some scenarios:

· CPU run very slow (Cache disabled)

· A lot of timer event (Network stack enabled)

In normal boot, CoreCheckTimers will execute two times. 1st time, it
actually signifies timer event. 2nd time, because there is no expired
timer, it will exit quickly.

In my scenario, another time interrupt comes and updates EfiSystemTime at
second CoreCheckTimers. The system will keep looping in CoreCheckTimers.

My questions are:

1. Is the red line below necessary?
What do you mean by "red line"?

Can we disable interrupt at TPL
30?

//

// If that's before now, then reset the timer to start from now

//

if (Event->Timer.TriggerTime <= SystemTime) {

Event->Timer.TriggerTime = SystemTime;

CoreSignalEvent (mEfiCheckTimerEvent);

}

2. If the system runs slowly, do we need to expand the timer
interrupt interval? Is there any golden standard about the ratio between
CPU speed and timer interval?
Perhaps related: commit 239b50a86370 ("OvmfPkg: End timer interrupt
later to avoid stack overflow under load", 2020-06-18).

Thanks,
Laszlo

Join discuss@edk2.groups.io to automatically receive all group messages.