[Top] [All Lists]

Re: [PATCH v2 2/2] hugetlb: Provide safer dummy values for HPAGE_MASK an

To: Sergei Shtylyov <>, Andrew Morton <>
Subject: Re: [PATCH v2 2/2] hugetlb: Provide safer dummy values for HPAGE_MASK and HPAGE_SIZE
From: David Daney <>
Date: Fri, 18 Nov 2011 09:14:17 -0800
Cc:,,, David Daney <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=C4wsFfYEn13/ruHNhUKwGkPltcavw8TkzVDcw3e33tc=; b=PxZGKV67RXMXM8CEGsYB1B4DjkRyuw7NZsWQ9+AQP+6bN9hF2BzH0LqIpR0HZVmSGq Z2rHDnH10wci8R9O91LnJlO0nHYeB38VgJXpzuFnU1z+A13yNPJMNnvSfelJecxm2N2J 9QO48pa/PC3dgQcq3hqM3PxHspB4LHk2GYpqM=
In-reply-to: <>
References: <> <> <>
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10
On 11/18/2011 12:56 AM, Sergei Shtylyov wrote:

On 18-11-2011 1:57, David Daney wrote:

From: David Daney<>

It was pointed out by David Rientjes that the dummy values for
HPAGE_MASK and HPAGE_SIZE are quite unsafe. It they are inadvertently
used with !CONFIG_HUGETLB_PAGE, compilation would succeed, but the
resulting code would surly not do anything sensible.

Place BUG() in the these dummy definitions, as we do in similar
circumstances in other places, so any abuse can be easily detected.

Since the only sane place to use these symbols when
!CONFIG_HUGETLB_PAGE is on dead code paths, the BUG() cause any actual
code to be emitted by the compiler.

You mean "doesn't cause"?


I mentioned this in a different message to akpm, but I am not sure if I should resend the patch with a corrected change log.

David Daney

Cc: David Rientjes<>
Signed-off-by: David Daney<>

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>