lkml.org 
[lkml]   [2006]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] Allow NULL pointers in percpu_free
    From
    Date
    On Fri, 2006-11-17 at 13:07 -0500, Alan Stern wrote:
    > On Fri, 17 Nov 2006, Daniel Walker wrote:
    >
    > > On Fri, 2006-11-17 at 12:36 -0500, Alan Stern wrote:
    > >
    > > > void percpu_free(void *__pdata)
    > > > {
    > > > + if (!__pdata)
    > > > + return;
    > >
    > > Should be unlikely() right?
    >
    > It certainly could be. I tend not to put such annotations in my code, but
    > it wouldn't hurt.

    It's actually a really good idea to add them .. I've noticed they tend
    to make my kernels smaller, although I wouldn't expect that to always be
    the case.. Another reason is that in -mm we can track how often this
    condition is triggered with likely profiling. With kfree, for instance,
    there were a number of callers that frequently called kfree(NULL), which
    IMO isn't good.

    Daniel

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-11-17 19:17    [W:0.021 / U:30.040 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site