Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WerKK-0004OC-7n for mharc-grub-devel@gnu.org; Mon, 28 Apr 2014 15:34:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WerKB-0004FU-2d for grub-devel@gnu.org; Mon, 28 Apr 2014 15:34:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WerK2-0001qg-Kr for grub-devel@gnu.org; Mon, 28 Apr 2014 15:34:47 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:54812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WerK2-0001qV-8X for grub-devel@gnu.org; Mon, 28 Apr 2014 15:34:38 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Apr 2014 13:34:36 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 28 Apr 2014 13:34:35 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id BB0801FF003E for ; Mon, 28 Apr 2014 13:34:34 -0600 (MDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by b03cxnp08025.gho.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s3SJYYGl7471586 for ; Mon, 28 Apr 2014 21:34:34 +0200 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s3SJYXfQ001811 for ; Mon, 28 Apr 2014 13:34:34 -0600 Received: from ram.oc3035372033.ibm.com (dyn9050018046.mts.ibm.com [9.50.18.46] (may be forged)) by d03av04.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s3SJYTbs001511 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 28 Apr 2014 13:34:32 -0600 Date: Mon, 28 Apr 2014 12:34:29 -0700 From: Ram Pai To: grub-devel@gnu.org Subject: Re: [PATCH 1/1] grub: fix hang in netboot Message-ID: <20140428193429.GA23788@ram.oc3035372033.ibm.com> References: <20140424220733.GA9786@ram.oc3035372033.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140424220733.GA9786@ram.oc3035372033.ibm.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14042819-9332-0000-0000-000000A1B7E2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 32.97.110.160 Cc: arvidjaar@gmail.com, phcoder@gmail.com, dvaleev@suse.de X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 19:34:55 -0000 On Thu, Apr 24, 2014 at 03:07:33PM -0700, Ram Pai wrote: > Grub can busy-loop and hang while network booting, if the network has > some fair amount of activity. This is because grub's net module sniffs > the network for packets, and busy-loops in receive_packets() till it > finds network packet of type IP or IPV6. During this period grub will > not respond to any user input, thus hanging up the system. > > The following patch lets grub to relax every few iterations, so that it > can respond to other user inputs. > > Signed-off-by: Ram Pai > > diff --git a/grub-core/net/net.c b/grub-core/net/net.c > index 0e57e93..4b316fa 100644 > --- a/grub-2.02~beta2/grub-core/net/net.c > +++ b/grub-2.02~beta2/grub-core/net/net.c > @@ -1500,10 +1500,11 @@ grub_net_poll_cards_idle_real (void) > FOR_NET_CARDS (card) > { > grub_uint64_t ctime = grub_get_time_ms (); > + int stop_condition = 1; > > if (ctime < card->last_poll > || ctime >= card->last_poll + card->idle_poll_delay_ms) > - receive_packets (card, 0); > + receive_packets (card, &stop_condition); > } > grub_net_tcp_retransmit (); > } There is a patch by Paulo that fixes the same problem. http://marc.info/?l=grub-devel&m=139175231351317&w=2 Git commit d99d2f84166b0f60673d5c0714605a153946c0fc. This patch is not needed, please ignore. RP