Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755893AbaJNXed (ORCPT ); Tue, 14 Oct 2014 19:34:33 -0400 Received: from mga01.intel.com ([192.55.52.88]:21022 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755437AbaJNXec (ORCPT ); Tue, 14 Oct 2014 19:34:32 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="400330272" Date: Tue, 14 Oct 2014 16:35:06 -0700 From: David Cohen To: Sasha Levin Cc: Yu Zhao , Andrew Morton , "Kirill A. Shutemov" , Mel Gorman , Rik van Riel , Ingo Molnar , Hugh Dickins , Bob Liu , Johannes Weiner , David Rientjes , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm: verify compound order when freeing a page Message-ID: <20141014233506.GB2889@psi-dev26.jf.intel.com> References: <1413317800-25450-1-git-send-email-yuzhao@google.com> <1413317800-25450-2-git-send-email-yuzhao@google.com> <20141014202955.GA2889@psi-dev26.jf.intel.com> <543DACFB.2060405@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <543DACFB.2060405@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 14, 2014 at 07:08:43PM -0400, Sasha Levin wrote: > On 10/14/2014 04:29 PM, David Cohen wrote: > >> + VM_BUG_ON(PageTail(page)); > >> > + VM_BUG_ON(PageHead(page) && compound_order(page) != order); > > It may be too severe. AFAIU we're not talking about a fatal error. > > How about VM_WARN_ON()? > > VM_BUG_ON() should catch anything which is not "supposed" to happen, > and not just the severe stuff. Unlike BUG_ON, VM_BUG_ON only gets > hit with mm debugging enabled. Thanks for pointing that out :) VM_WARN_ON*() is recent, so there isn't much examples when to use it. I considered the below case similar to this patch. But your point does make sense anyway. commit 82f71ae4a2b829a25971bdf54b4d0d3d69d3c8b7 Author: Konstantin Khlebnikov Date: Wed Aug 6 16:06:36 2014 -0700 mm: catch memory commitment underflow Print a warning (if CONFIG_DEBUG_VM=y) when memory commitment becomes too negative. This shouldn't happen any more - the previous two patches fixed the committed_as underflow issues. [akpm@linux-foundation.org: use VM_WARN_ONCE, per Dave] Br, David > > > Thanks, > Sasha > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/