From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934402AbcATPz1 (ORCPT ); Wed, 20 Jan 2016 10:55:27 -0500 Received: from resqmta-ch2-05v.sys.comcast.net ([69.252.207.37]:53920 "EHLO resqmta-ch2-05v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933838AbcATPzY (ORCPT ); Wed, 20 Jan 2016 10:55:24 -0500 Date: Wed, 20 Jan 2016 09:55:22 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: Sasha Levin cc: Michal Hocko , LKML , "linux-mm@kvack.org" , Andrew Morton Subject: Re: mm, vmstat: kernel BUG at mm/vmstat.c:1408! In-Reply-To: <569FAC90.5030407@oracle.com> Message-ID: References: <5674A5C3.1050504@oracle.com> <20160120143719.GF14187@dhcp22.suse.cz> <569FA01A.4070200@oracle.com> <20160120151007.GG14187@dhcp22.suse.cz> <569FAC90.5030407@oracle.com> Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Jan 2016, Sasha Levin wrote: > > As I've mentioned - this reproduces frequently. I'd be happy to add in debug > information into the kernel that might help you reproduce it, but as it seems > like a timing issue, I can't provide a simple reproducer. This isnt really important I think. Lets remove it. Subject: vmstat: Remove BUG_ON from vmstat_update If we detect that there is nothing to do just set the flag and do not check if it was already set before. Races really do not matter. If the flag is set by any code then the shepherd will start dealing with the situation and reenable the vmstat workers when necessary again. Concurrent actions could be onlining and offlining of processors or be a result of concurrency issues when updating the cpumask from multiple processors. Signed-off-by: Christoph Lameter Index: linux/mm/vmstat.c =================================================================== --- linux.orig/mm/vmstat.c +++ linux/mm/vmstat.c @@ -1408,17 +1408,7 @@ static void vmstat_update(struct work_st * Defer the checking for differentials to the * shepherd thread on a different processor. */ - int r; - /* - * Shepherd work thread does not race since it never - * changes the bit if its zero but the cpu - * online / off line code may race if - * worker threads are still allowed during - * shutdown / startup. - */ - r = cpumask_test_and_set_cpu(smp_processor_id(), - cpu_stat_off); - VM_BUG_ON(r); + cpumask_set_cpu(smp_processor_id(), cpu_stat_off); } }