From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id E166F6B026A for ; Mon, 9 Jan 2017 12:00:38 -0500 (EST) Received: by mail-pf0-f198.google.com with SMTP id 80so41498082pfy.2 for ; Mon, 09 Jan 2017 09:00:38 -0800 (PST) Received: from mga06.intel.com (mga06.intel.com. [134.134.136.31]) by mx.google.com with ESMTPS id d3si62579432plj.109.2017.01.09.09.00.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jan 2017 09:00:37 -0800 (PST) Subject: Re: [HMM v15 01/16] mm/free_hot_cold_page: catch ZONE_DEVICE pages References: <1483721203-1678-1-git-send-email-jglisse@redhat.com> <1483721203-1678-2-git-send-email-jglisse@redhat.com> <20170109091952.GA9655@localhost.localdomain> <591ef5e3-54a9-da61-bca6-f30641bebe88@intel.com> <20170109165712.GA3058@redhat.com> From: Dave Hansen Message-ID: Date: Mon, 9 Jan 2017 09:00:34 -0800 MIME-Version: 1.0 In-Reply-To: <20170109165712.GA3058@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Jerome Glisse Cc: Balbir Singh , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, John Hubbard , Dan Williams , Ross Zwisler On 01/09/2017 08:57 AM, Jerome Glisse wrote: > On Mon, Jan 09, 2017 at 08:21:25AM -0800, Dave Hansen wrote: >> On 01/09/2017 01:19 AM, Balbir Singh wrote: >>>> + /* >>>> + * This should never happen ! Page from ZONE_DEVICE always must have an >>>> + * active refcount. Complain about it and try to restore the refcount. >>>> + */ >>>> + if (is_zone_device_page(page)) { >>>> + VM_BUG_ON_PAGE(is_zone_device_page(page), page); >>> This can be VM_BUG_ON_PAGE(1, page), hopefully the compiler does the right thing >>> here. I suspect this should be a BUG_ON, independent of CONFIG_DEBUG_VM >> BUG_ON() means "kill the machine dead". Do we really want a guaranteed >> dead machine if someone screws up their refcounting? > VM_BUG_ON_PAGE ok with you ? It is just a safety net, i can simply drop that > patch if people have too much feeling about it. Enough distros turn on DEBUG_VM that there's basically no difference between VM_BUG_ON() and BUG_ON(). I also think it would be much nicer if you buried the check in the allocator in a slow path somewhere instead of sticking it in one of the hottest paths in the whole kernel. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org