Re: [PATCH 6/7] rt_test.h: add numa_available() for !NUMA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 18, 2015 at 04:27:07PM -0500, Josh Cartwright wrote:
> On Fri, Sep 18, 2015 at 06:52:49PM +0200, Henrik Austad wrote:
> > Code will snould not call numa_available(), but compiler will complain
> 
> snould -> should.
> 
> Why should it not call it?

Because if numa is 0, it will stop evaluating the conditional and never get 
to numa_available()

        if (numa && (numa_available() == -1))
                fatal("--numa specified and numa functions not available.\n");

Even so, the compiler will try to find the symbol, which it couldn't. So 
the warning was legit, but the problem would never arise in practice (as 
you state below).

> > with:
> > 
> >   src/cyclictest/rt_numa.h:263: warning: implicit declaration of function ???numa_available???
> > 
> > Signed-off-by: Henrik Austad <haustad@xxxxxxxxx>
> > ---
> >  src/cyclictest/rt_numa.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/src/cyclictest/rt_numa.h b/src/cyclictest/rt_numa.h
> > index 06c9420..172d9b2 100644
> > --- a/src/cyclictest/rt_numa.h
> > +++ b/src/cyclictest/rt_numa.h
> > @@ -200,6 +200,7 @@ struct bitmask {
> >  };
> >  #define BITS_PER_LONG    (8*sizeof(long))
> >  
> > +static inline int numa_available(void) { return 0; }
> 
> I would have expected this to return -1, as libnuma isn't available...

Ah, you're right, should have been -1.

> John and I were talking about this earlier this week:
> 
> http://lkml.kernel.org/r/787515a5a59861a892ac3a44b6c6c502cfc102fd.1441038216.git.joshc@xxxxxx

I agree, that is a much better way of dealing with it! 

Thanks!

-- 
Henrik Austad
TIPBU Eng
Cisco Systems Norway
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux