Re: [patch 0/5] Support for sanitization flag in low-level page allocator

Peter Zijlstra
2009-05-28T19:44:33Z

On Thu, 2009-05-28 at 12:50 +0100, Alan Cox wrote:
> The performance cost of such a security action are NIL when the feature
> is disabled. So the performance cost in the general case is irrelevant.

Not really, much of the code posted in this thread has the form:

int sanitize_all_mem; /* note the lack of __read_mostly */

void some_existing_function()
{
if (sanitize_all_mem) { /* extra branch */
/* do stuff */
}
}

void sanitize_obj(void *obj)
{
if (!sanitize_all_mem) /* extra branch */
return;

/* do stuff */
}

void another_existing_function()
{
sanitize_obj(obj); /* extra call */
}

That doesn't equal NIL, that equals extra function calls and branches.