From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754420Ab3BVNmJ (ORCPT ); Fri, 22 Feb 2013 08:42:09 -0500 Received: from mx0.parallels.com ([199.115.104.20]:53175 "EHLO mx0.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752070Ab3BVNmG (ORCPT ); Fri, 22 Feb 2013 08:42:06 -0500 Message-ID: <512775CA.2030603@parallels.com> Date: Fri, 22 Feb 2013 17:42:34 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Aaron Tomlin CC: , , Rik Subject: Re: [PATCH] mm: slab: Verify the nodeid passed to ____cache_alloc_node References: <943811281.6485888.1361484478519.JavaMail.root@redhat.com> In-Reply-To: <943811281.6485888.1361484478519.JavaMail.root@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/22/2013 02:07 AM, Aaron Tomlin wrote: > The addition of this BUG_ON should make debugging easier. > While I understand that this code path is "hot", surely > it is better to assert the condition than to wait until > some random NULL pointer dereference or page fault. If the > caller passes an invalid nodeid, at this stage in my opinion > it's already a BUG. If you assert with VM_BUG_ON, it will be active on debugging kernels only, which I believe is better suited for a hotpath.