Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5434627ybp; Tue, 8 Oct 2019 02:49:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbxNwGU2ReKRC8QYV7xQ2T49PdfYjMZ8ek9VXHj9kP5WnB9dLEt8I12fMhpVIIjMlxkwN8 X-Received: by 2002:a17:906:1152:: with SMTP id i18mr28108799eja.113.1570528187619; Tue, 08 Oct 2019 02:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570528187; cv=none; d=google.com; s=arc-20160816; b=UJiqvBPL7n34aBcnrjCyweMXwgN94+h9H2sf5ErV4U3+7m8diCwBvZzu6cJCYKsiSI ws6DyDB4SAjgfb9ckmkLscdL7APcgPTPMFeSoN2Xh6OvqVG7BVyfhXsc6ZLG0R+HinR0 EpPR4DpYC7UcEs71+zc2VTfTLuB8ZR+5fQpUu82ZBnEOOv3HqaDRnQJqNMAFBj20gVmx tfvvbcx20NVbUhWRaB0OSSHqsvT27V6uGMUcNtIW+T07MKuKJ4od7MAoMLHvGfUZ08Pt nkmfzLTSixBmv6EV4UW5NGgPUwOb6CRWi9QqY4+A0SC5QWf8ktrST5NKuhAm4voNJr/Y Wimw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=sY4RvrAq5fuuVhQGd3gFKnbJqtUZHSIezeRoAYroaYU=; b=gcfJdJcBbvqC+iZWQAsWMP2pPEgsyTbqF8B2h6C/lSmyeg0bINVBaOZzMqx+4Geyn4 BdEAGn3nfYMW4o6UJMZPHNEZJDFPEhxUzPE1picHWDqZT0qggeaLOfcbdUzjyKMxgHJh c+8Bb15/b644p22YHjASthn7Cx9JYGGW18w1j9kQ/0mdLg5bjocAqnLGo3tCfGR4GUQC 7gug+94PO1Gc4dQULIbDdy9kiugG9j9hqxzFrq+2pfpT19KA7WBd0Vws+XYjEyahxFtW P9/WVF2pYAwDtG8+J0rz6fUTeiXaKLqjIrUzdmTMZfM8bxD7gAUb62bw1b13ickz2ESw lyVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h28si10759030edh.278.2019.10.08.02.49.22; Tue, 08 Oct 2019 02:49:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729989AbfJHJtS (ORCPT + 99 others); Tue, 8 Oct 2019 05:49:18 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:35852 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729767AbfJHJtR (ORCPT ); Tue, 8 Oct 2019 05:49:17 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 618B88037F; Tue, 8 Oct 2019 11:49:00 +0200 (CEST) Date: Tue, 8 Oct 2019 11:49:15 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Corey Minyard , Sasha Levin Subject: Re: [PATCH 4.19 012/106] ipmi_si: Only schedule continuously in the thread in maintenance mode Message-ID: <20191008094915.GC608@amd> References: <20191006171124.641144086@linuxfoundation.org> <20191006171130.485953894@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Clx92ZfkiYIKRjnr" Content-Disposition: inline In-Reply-To: <20191006171130.485953894@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Clx92ZfkiYIKRjnr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > @@ -1013,11 +1016,20 @@ static int ipmi_thread(void *data) > spin_unlock_irqrestore(&(smi_info->si_lock), flags); > busy_wait =3D ipmi_thread_busy_wait(smi_result, smi_info, > &busy_until); > - if (smi_result =3D=3D SI_SM_CALL_WITHOUT_DELAY) > + if (smi_result =3D=3D SI_SM_CALL_WITHOUT_DELAY) { > ; /* do nothing */ > - else if (smi_result =3D=3D SI_SM_CALL_WITH_DELAY && busy_wait) > - schedule(); > - else if (smi_result =3D=3D SI_SM_IDLE) { > + } else if (smi_result =3D=3D 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 =3D=3D 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 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --Clx92ZfkiYIKRjnr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl2cW5sACgkQMOfwapXb+vJ7eQCaAzXAg5l8bKuBD/+tQE+XpSfc J6sAn05kFLCKSTjEBPozN5WdveX4pR9R =82/+ -----END PGP SIGNATURE----- --Clx92ZfkiYIKRjnr--