Re: mm: slab - __cache_alloc NULL prefetch fix

From: Valdis . Kletnieks
Date: Thu Nov 20 2008 - 14:59:20 EST


On Thu, 20 Nov 2008 19:44:00 +0300, Cyrill Gorcunov said:

> - prefetchw(objp);
>
> - if (likely(objp))
> + if (likely(objp)) {
> + prefetchw(objp);
> kmemcheck_slab_alloc(cachep, flags, objp, obj_size(cachep));
> + }

Although it probably makes sense to not bother prefetching NULL, I also
need to wonder how useful it is to prefetch something that we then
turn around and dereference in the very next line of code.

Maybe we should just lose the prefetch entirely?

Attachment: pgp00000.pgp
Description: PGP signature