From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755179AbcCOGSd (ORCPT ); Tue, 15 Mar 2016 02:18:33 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:35548 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754579AbcCOGSY (ORCPT ); Tue, 15 Mar 2016 02:18:24 -0400 Date: Tue, 15 Mar 2016 15:19:46 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, jlayton@poochiereds.net, bfields@fieldses.org, Vlastimil Babka , Joonsoo Kim , koct9i@gmail.com, aquini@redhat.com, virtualization@lists.linux-foundation.org, Mel Gorman , Hugh Dickins , Sergey Senozhatsky , rknize@motorola.com, Rik van Riel , Gioh Kim Subject: Re: [PATCH v1 06/19] zsmalloc: clean up many BUG_ON Message-ID: <20160315061946.GB1464@swordfish> References: <1457681423-26664-1-git-send-email-minchan@kernel.org> <1457681423-26664-7-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457681423-26664-7-git-send-email-minchan@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (03/11/16 16:30), Minchan Kim wrote: > There are many BUG_ON in zsmalloc.c which is not recommened so > change them as alternatives. > > Normal rule is as follows: > > 1. avoid BUG_ON if possible. Instead, use VM_BUG_ON or VM_BUG_ON_PAGE > 2. use VM_BUG_ON_PAGE if we need to see struct page's fields > 3. use those assertion in primitive functions so higher functions > can rely on the assertion in the primitive function. > 4. Don't use assertion if following instruction can trigger Oops > > Signed-off-by: Minchan Kim Reviewed-by: Sergey Senozhatsky -ss