From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934529AbdC3Wk3 (ORCPT ); Thu, 30 Mar 2017 18:40:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40956 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201AbdC3Wk2 (ORCPT ); Thu, 30 Mar 2017 18:40:28 -0400 Date: Thu, 30 Mar 2017 15:40:26 -0700 From: Andrew Morton To: Vlastimil Babka Cc: kernel test robot , Stephen Rothwell , Mel Gorman , Johannes Weiner , Joonsoo Kim , David Rientjes , LKML , lkp@01.org Subject: Re: [lkp-robot] [mm, page_alloc] b7ef62aa8a: BUG:kernel_hang_in_boot_stage Message-Id: <20170330154026.3ca919cf3b93da81c25724c4@linux-foundation.org> In-Reply-To: <59d71b35-d556-4fc9-ee2e-1574259282fd@suse.cz> References: <20170322043611.GJ26669@yexl-desktop> <59d71b35-d556-4fc9-ee2e-1574259282fd@suse.cz> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > BUG: kernel hang in boot stage > > Thanks, I was able to reproduce and debug this. > Andrew, please apply the following -fix. There will be conflicts on later > patches, but with trivial resolution (pages -> free_pages). Thanks! > > ... > > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1977,6 +1977,9 @@ static void steal_suitable_fallback(struct zone *zone, struct page *page, > goto single_page; > > pages = move_freepages_block(zone, page, start_type); > + /* moving whole block can fail due to zone boundary conditions */ > + if (!pages) > + goto single_page; > > /* Claim the whole block if over half of it is free */ > if (pages >= (1 << (pageblock_order-1)) || The result is a bit odd: free_pages = move_freepages_block(zone, page, start_type, &movable_pages); /* * Determine how many pages are compatible with our allocation. * For movable allocation, it's the number of movable pages which * we just obtained. For other types it's a bit more tricky. */ if (start_type == MIGRATE_MOVABLE) { alike_pages = movable_pages; } else { /* * If we are falling back a RECLAIMABLE or UNMOVABLE allocation * to MOVABLE pageblock, consider all non-movable pages as * compatible. If it's UNMOVABLE falling back to RECLAIMABLE or * vice versa, be conservative since we can't distinguish the * exact migratetype of non-movable pages. */ if (old_block_type == MIGRATE_MOVABLE) alike_pages = pageblock_nr_pages - (free_pages + movable_pages); else alike_pages = 0; } /* moving whole block can fail due to zone boundary conditions */ if (!free_pages) goto single_page; should we do `goto single_page' as soon as the move_freepages_block() call fails? From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6886151771677016927==" MIME-Version: 1.0 From: Andrew Morton To: lkp@lists.01.org Subject: Re: [lkp-robot] [mm, page_alloc] b7ef62aa8a: BUG:kernel_hang_in_boot_stage Date: Thu, 30 Mar 2017 15:40:26 -0700 Message-ID: <20170330154026.3ca919cf3b93da81c25724c4@linux-foundation.org> In-Reply-To: <59d71b35-d556-4fc9-ee2e-1574259282fd@suse.cz> List-Id: --===============6886151771677016927== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable > > BUG: kernel hang in boot stage > = > Thanks, I was able to reproduce and debug this. > Andrew, please apply the following -fix. There will be conflicts on later > patches, but with trivial resolution (pages -> free_pages). Thanks! > = > ... > > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1977,6 +1977,9 @@ static void steal_suitable_fallback(struct zone *zo= ne, struct page *page, > goto single_page; > = > pages =3D move_freepages_block(zone, page, start_type); > + /* moving whole block can fail due to zone boundary conditions */ > + if (!pages) > + goto single_page; > = > /* Claim the whole block if over half of it is free */ > if (pages >=3D (1 << (pageblock_order-1)) || The result is a bit odd: free_pages =3D move_freepages_block(zone, page, start_type, &movable_pages); /* * Determine how many pages are compatible with our allocation. * For movable allocation, it's the number of movable pages which * we just obtained. For other types it's a bit more tricky. */ if (start_type =3D=3D MIGRATE_MOVABLE) { alike_pages =3D movable_pages; } else { /* * If we are falling back a RECLAIMABLE or UNMOVABLE allocation * to MOVABLE pageblock, consider all non-movable pages as * compatible. If it's UNMOVABLE falling back to RECLAIMABLE or * vice versa, be conservative since we can't distinguish the * exact migratetype of non-movable pages. */ if (old_block_type =3D=3D MIGRATE_MOVABLE) alike_pages =3D pageblock_nr_pages - (free_pages + movable_pages); else alike_pages =3D 0; } /* moving whole block can fail due to zone boundary conditions */ if (!free_pages) goto single_page; should we do `goto single_page' as soon as the move_freepages_block() call fails? =20 --===============6886151771677016927==--