From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754297AbdCJAp2 (ORCPT ); Thu, 9 Mar 2017 19:45:28 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:50753 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983AbdCJAp0 (ORCPT ); Thu, 9 Mar 2017 19:45:26 -0500 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Fri, 10 Mar 2017 09:45:22 +0900 From: Minchan Kim To: Andrew Morton Cc: Sergey Senozhatsky , Johannes Weiner , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: "mm: fix lazyfree BUG_ON check in try_to_unmap_one()" build error Message-ID: <20170310004522.GA12267@bbox> References: <20170309042908.GA26702@jagdpanzerIV.localdomain> <20170309060226.GB854@bbox> <20170309132706.1cb4fc7d2e846923eedf788c@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170309132706.1cb4fc7d2e846923eedf788c@linux-foundation.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 Hi Andrew, On Thu, Mar 09, 2017 at 01:27:06PM -0800, Andrew Morton wrote: > On Thu, 9 Mar 2017 15:02:26 +0900 Minchan Kim wrote: > > > Sergey reported VM_WARN_ON_ONCE returns void with !CONFIG_DEBUG_VM > > so we cannot use it as if's condition unlike WARN_ON. > > Can we instead fix VM_WARN_ON_ONCE()? I thought the direction but the reason to decide WARN_ON_ONCE in this case is losing of benefit with using CONFIG_DEBU_VM if we go that way. I think the benefit with VM_WARN_ON friends is that it should be completely out from the binary in !CONFIG_DEBUG_VM. However, if we fix VM_WARN_ON like WARN_ON to !!condition, at least, compiler should generate condition check and return so it's not what CONFIG_DEBUG_VM want, IMHO. However, if guys believe it's okay to add some instructions to debug VM although we disable CONFIG_DEBUG_VM, we can go that way. It's a just policy matter. ;-) Anyway, Even though we fix VM_WARN_ON_ONCE, in my case, WARN_ON_ONCE is better because we should do !!condition regardless of CONFIG_DEBUG_VM and if so, WARN_ON is more wide coverage than VM_WARN_ON which only works with CONFIG_DEBUG_VM. Thanks.