From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163854AbdAIQ5Q (ORCPT ); Mon, 9 Jan 2017 11:57:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40234 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163839AbdAIQ5O (ORCPT ); Mon, 9 Jan 2017 11:57:14 -0500 Date: Mon, 9 Jan 2017 11:57:12 -0500 From: Jerome Glisse To: Dave Hansen Cc: Balbir Singh , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, John Hubbard , Dan Williams , Ross Zwisler Subject: Re: [HMM v15 01/16] mm/free_hot_cold_page: catch ZONE_DEVICE pages Message-ID: <20170109165712.GA3058@redhat.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <591ef5e3-54a9-da61-bca6-f30641bebe88@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 09 Jan 2017 16:57:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cheers, Jérôme