[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191008094915.GC608@amd>
Date: Tue, 8 Oct 2019 11:49:15 +0200
From: Pavel Machek <pavel@...x.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Corey Minyard <cminyard@...sta.com>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 012/106] ipmi_si: Only schedule continuously in the
thread in maintenance mode
Hi!
> @@ -1013,11 +1016,20 @@ static int ipmi_thread(void *data)
> spin_unlock_irqrestore(&(smi_info->si_lock), flags);
> busy_wait = ipmi_thread_busy_wait(smi_result, smi_info,
> &busy_until);
> - if (smi_result == SI_SM_CALL_WITHOUT_DELAY)
> + if (smi_result == SI_SM_CALL_WITHOUT_DELAY) {
> ; /* do nothing */
> - else if (smi_result == SI_SM_CALL_WITH_DELAY && busy_wait)
> - schedule();
> - else if (smi_result == SI_SM_IDLE) {
> + } else if (smi_result == SI_SM_CALL_WITH_DELAY && busy_wait) {
> + /*
> + * In maintenance mode we run as fast as
> + * possible to allow firmware updates to
> + * complete as fast as possible, but normally
> + * don't bang on the scheduler.
> + */
> + if (smi_info->in_maintenance_mode)
> + schedule();
> + else
> + usleep_range(100, 200);
> + } else if (smi_result == SI_SM_IDLE) {
This is quite crazy code. usleep() will need to do magic with high
resolution timers to provide 200usec sleep... when all you want to do
is unload the scheduler.
cond_resched() should be okay to call in a loop, can the code use that
instead?
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists