From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751186AbdEaUw2 (ORCPT ); Wed, 31 May 2017 16:52:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51714 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750952AbdEaUw1 (ORCPT ); Wed, 31 May 2017 16:52:27 -0400 Date: Wed, 31 May 2017 13:52:26 -0700 From: Andrew Morton To: kernel test robot Cc: Josef Bacik , Stephen Rothwell , Josef Bacik , Rik van Riel , Johannes Weiner , LKML , lkp@01.org Subject: Re: [lkp-robot] [mm] aefd950b83: divide_error:#[##] Message-Id: <20170531135226.0a1b403a7a4e3f76f8f9d6bc@linux-foundation.org> In-Reply-To: <20170531063116.GD1795@yexl-desktop> References: <20170531063116.GD1795@yexl-desktop> 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 On Wed, 31 May 2017 14:31:16 +0800 kernel test robot wrote: > > FYI, we noticed the following commit: > > commit: aefd950b83d2d8cf4d3c270546c8725f866da191 ("mm: make kswapd try harder to keep active pages in cache") > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master > > in testcase: boot > > ... > > [ 160.541829] divide error: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC > > ... > > [ 160.587334] RIP: shrink_node+0x47f/0x5a0 RSP: ffffc900001bbd78 > > ... hm. This? --- a/mm/vmscan.c~mm-make-kswapd-try-harder-to-keep-active-pages-in-cache-fix-2 +++ a/mm/vmscan.c @@ -2724,7 +2724,7 @@ static bool shrink_node(pg_data_t *pgdat if (sc->nr_reclaimed - nr_reclaimed) { reclaimable = true; } else if (sc->inactive_only && !skip_slab) { - unsigned long percent; + unsigned long percent = 100; /* * We didn't reclaim anything this go around, so the @@ -2735,7 +2735,8 @@ static bool shrink_node(pg_data_t *pgdat * hoping that eventually we'll start freeing enough * objects to reclaim space. */ - percent = (slab_reclaimed * 100 / slab_scanned); + if (slab_scanned) + percent = (slab_reclaimed * 100 / slab_scanned); if (percent < 50) sc->inactive_only = 0; else Or this? --- a/mm/vmscan.c~mm-make-kswapd-try-harder-to-keep-active-pages-in-cache-fix-3 +++ a/mm/vmscan.c @@ -2628,7 +2628,7 @@ static bool shrink_node(pg_data_t *pgdat }; unsigned long node_lru_pages = 0; unsigned long slab_reclaimed = 0; - unsigned long slab_scanned = 0; + unsigned long slab_scanned = 1; /* Avoid div-by-zero */ struct mem_cgroup *memcg; nr_reclaimed = sc->nr_reclaimed; _