You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Igor Galić <i....@brainsware.org> on 2012/09/18 14:48:01 UTC

Getting Solaris buildbot to compile again + CPU affinity

Hey folks,

I put in some effort to get the Solaris buildbot to
compile again. This basically consisted of upgrading the
installed OpenCSW packages from "testing" to "unstable",
and, aside from a tiny patch to configure.ac, getting
the ./configure arguments right:

  ./configure --prefix=$HOME/tserver-solaris-trunk/build/ats-install \
    --with-user=buildbot --with-group=other --with-expat=/opt/csw \
    --with-pcre=/opt/csw --with-tcl=/opt/csw/lib/amd64 \
    --with-lua=/opt/csw  --with-openssl=/opt/csw/include:/opt/csw/lib/amd64

This gets us now through configure, YAY! only to nosedive into this:

   Making all in eventsystem
   gmake[2]: Entering directory `/export/home/igalic/trafficserver/iocore/eventsystem'
   source='UnixEventProcessor.cc' object='UnixEventProcessor.o' libtool=no \
        DEPDIR=.deps depmode=none /bin/bash ../../build/aux/depcomp \
        CC -DHAVE_CONFIG_H  -I. -I../../lib/ts  -I../../lib -I../../lib/records -I../../lib/ts -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_REENTRANT -Dsolaris -I/opt/csw/include -I/usr/local/include  -g -mt -m64 -D__WORDSIZE=64 -O3 -library=stlport4 -erroff -c -o UnixEventProcessor.o UnixEventProcessor.cc
   "UnixEventProcessor.cc", line 103: Error: cpu_set_t is not defined.
   "UnixEventProcessor.cc", line 118: Error: The function "CPU_ZERO" must have a prototype.
   "UnixEventProcessor.cc", line 120: Error: The function "CPU_SET" must have a prototype.
   "UnixEventProcessor.cc", line 122: Error: cpu_set_t is not defined.
   4 Error(s) detected.
   gmake[2]: *** [UnixEventProcessor.o] Error 2
   gmake[2]: Leaving directory `/export/home/igalic/trafficserver/iocore/eventsystem'
   gmake[1]: *** [all-recursive] Error 1
   gmake[1]: Leaving directory `/export/home/igalic/trafficserver/iocore'
   gmake: *** [all-recursive] Error 1


cpu_set_t and CPU_ZERO is a gcc-ism/glibc-ism, but other platforms support it
setting CPU affinity. See for reference:

   https://github.com/facebook/xhprof/blob/master/extension/xhprof.c
   http://csl.stanford.edu/~christos/sw/phoenix/MapReduceScheduler.linux.c

So long,

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Leif Hedstrom <zw...@apache.org>.
On 9/21/12 12:46 AM, Mladen Turk wrote:
>
> There is a question of which GCC should be supported.
> IMHO the gcc Oracle ships with some Solaris version is pretty old
> (eg. 3.4.3 for Solaris 10)

Just to be clear, we stopped supporting any gcc prior to gcc-4.1.2 quite a 
while ago (due to atomic's).

Cheers,

-- Leif


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> On 09/21/2012 11:14 AM, Igor Galić wrote:
> >
> >> Just notice that we won't be able to redistribute those binary
> >> artefacts since they have OpenCSW library dependencies, but I
> >> suppose we don't have intention to ship binaries anyhow.
> >
> > With my OpenCSW Hat:
> 
> Are you member of OpenCSW team?

Yes, but I only support the packages which surround trafficserver
And only now that we have tcl8.5 out are we even able to compile
trafficserver..
 
> Regards
> --
> ^TM

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Mladen Turk <mt...@apache.org>.
On 09/21/2012 11:14 AM, Igor Galić wrote:
>
>> Just notice that we won't be able to redistribute those binary
>> artefacts since they have OpenCSW library dependencies, but I
>> suppose we don't have intention to ship binaries anyhow.
>
> With my OpenCSW Hat:

Are you member of OpenCSW team?


Regards
-- 
^TM

Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> On 09/21/2012 10:59 AM, Igor Galić wrote:
> >
> >
> > I also installed GCC 4.7 from OpenCSW repos.
> >
> > Moving forward, I'd like to setup the trunk release and debug build
> > with GCC, while keeping a 3.2 release build with Solaris studio.
> >
> 
> Sure, that's fine.
> Just notice that we won't be able to redistribute those binary
> artefacts since they have OpenCSW library dependencies, but I
> suppose we don't have intention to ship binaries anyhow.

With my Apache Hat: Nope we don't. We ship source.
With my OpenCSW Hat: Yeah, but we do that anyway ;)

> Regards
> --
> ^TM

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Mladen Turk <mt...@apache.org>.
On 09/21/2012 10:59 AM, Igor Galić wrote:
>
>
> I also installed GCC 4.7 from OpenCSW repos.
>
> Moving forward, I'd like to setup the trunk release and debug build
> with GCC, while keeping a 3.2 release build with Solaris studio.
>

Sure, that's fine.
Just notice that we won't be able to redistribute those binary
artefacts since they have OpenCSW library dependencies, but I
suppose we don't have intention to ship binaries anyhow.


Regards
-- 
^TM

Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Igor Galić <i....@brainsware.org>.
 
> There is a question of which GCC should be supported.
> IMHO the gcc Oracle ships with some Solaris version is pretty old
> (eg. 3.4.3 for Solaris 10)
> So I'm either using OpenCSW or Blastwave since Sunfreeware is just
> too
> complex to install and maintain.

We have OpenCSW tcl, iconv, openssl, lua, hwloc and other packages
installed on the buildbot, which we're using right now for the trunk
release build.
 
I also installed GCC 4.7 from OpenCSW repos.

Moving forward, I'd like to setup the trunk release and debug build
with GCC, while keeping a 3.2 release build with Solaris studio.

> Regards
> --
> ^TM

So long,

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Mladen Turk <mt...@apache.org>.
On 09/20/2012 06:09 PM, Igor Galić wrote:
>>
>
> This saga has come to an End.
>

+1

> With 97fd7b5..319d54 landed on master, we now support Sun Studio 5.9
> through Solaris Studio 12.3 again.
>
> That being said, I agree, that, unless the very unlikely happens and
> Oracle gets their shit together and Solaris Studio catches up on C++,
> we should drop its support for 3.4
>

There is a question of which GCC should be supported.
IMHO the gcc Oracle ships with some Solaris version is pretty old
(eg. 3.4.3 for Solaris 10)
So I'm either using OpenCSW or Blastwave since Sunfreeware is just too
complex to install and maintain.


Regards
-- 
^TM

Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Igor Galić <i....@brainsware.org>.
> 
> I wrote it here:
> https://cwiki.apache.org/confluence/display/TS/3.4+Development%2C+Features+and+Requirements
> 
> > 
> > Someone would have to volunteer to maintain a SunStudio "port" for
> > us to bring it back (IMO at least). I believe we currently support
> > 
> >    gcc 4.1.2 and later (RHEL5 I think?)
> >    clang 3.x (which version specifically?)
> >    Intel ICC (11.x and later?)

This saga has come to an End.

With 97fd7b5..319d54 landed on master, we now support Sun Studio 5.9
through Solaris Studio 12.3 again.

That being said, I agree, that, unless the very unlikely happens and
Oracle gets their shit together and Solaris Studio catches up on C++,
we should drop its support for 3.4 

As I've already mentioned in a previous email: We should backport
this to 3.2, and then rip it out from trunk again.

> When was the last time anyone tested ICC?

I wanted to suggest to add a buildbot for that, but, ugh,
Licensing...

> J

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by James Peach <jp...@apache.org>.
On 20/09/2012, at 8:51 AM, Leif Hedstrom <zw...@apache.org> wrote:

> On 9/19/12 5:15 PM, James Peach wrote:
>> On 19/09/2012, at 3:09 PM, Leif Hedstrom <zw...@apache.org> wrote:
>> 
>>> On 9/18/12 10:29 PM, James Peach wrote:
>>>> On 18/09/2012, at 9:16 PM, Mladen Turk <mt...@apache.org> wrote:
>>>> 
>>>>> On 09/19/2012 02:02 AM, Igor Galić wrote:
>>>>>> On Solaris this got me through the CPU affinity stuff, but hung on:
>>>>>> 
>>>>>>    "SplitDNS.cc", line 639: Error: Could not find a match for ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*, SplitDNSConfigInfo*) needed in SplitDNSConfigProcessor::set(unsigned, SplitDNSConfigInfo*).
>>>>>> 
>>>>> Think that's the casting issue.
>>>>> ink_atomic_cas is declared as ink_atomic_cas(void **, void *, void *)
>>>>> so that won't work without explicit casting.
>>>> Yep. For all platforms except Solaris I changed ink_atomic_cas over to be a template so that casting would not be required. If this is building with GCC on solaris, then the existing template implementation will work, otherwise it will be more interesting :)
>>> 
>>> I thought we agreed to drop explicit support for Oracle's SunStudio compilers?
>> Great! I didn't see that written down anywhere ...
> 
> We probably should?

I wrote it here: https://cwiki.apache.org/confluence/display/TS/3.4+Development%2C+Features+and+Requirements

> 
> Someone would have to volunteer to maintain a SunStudio "port" for us to bring it back (IMO at least). I believe we currently support
> 
>    gcc 4.1.2 and later (RHEL5 I think?)
>    clang 3.x (which version specifically?)
>    Intel ICC (11.x and later?)

When was the last time anyone tested ICC?

J

Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Leif Hedstrom <zw...@apache.org>.
On 9/19/12 5:15 PM, James Peach wrote:
> On 19/09/2012, at 3:09 PM, Leif Hedstrom <zw...@apache.org> wrote:
>
>> On 9/18/12 10:29 PM, James Peach wrote:
>>> On 18/09/2012, at 9:16 PM, Mladen Turk <mt...@apache.org> wrote:
>>>
>>>> On 09/19/2012 02:02 AM, Igor Galić wrote:
>>>>> On Solaris this got me through the CPU affinity stuff, but hung on:
>>>>>
>>>>>     "SplitDNS.cc", line 639: Error: Could not find a match for ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*, SplitDNSConfigInfo*) needed in SplitDNSConfigProcessor::set(unsigned, SplitDNSConfigInfo*).
>>>>>
>>>> Think that's the casting issue.
>>>> ink_atomic_cas is declared as ink_atomic_cas(void **, void *, void *)
>>>> so that won't work without explicit casting.
>>> Yep. For all platforms except Solaris I changed ink_atomic_cas over to be a template so that casting would not be required. If this is building with GCC on solaris, then the existing template implementation will work, otherwise it will be more interesting :)
>>
>> I thought we agreed to drop explicit support for Oracle's SunStudio compilers?
> Great! I didn't see that written down anywhere ...

We probably should?

Someone would have to volunteer to maintain a SunStudio "port" for us to 
bring it back (IMO at least). I believe we currently support

     gcc 4.1.2 and later (RHEL5 I think?)
     clang 3.x (which version specifically?)
     Intel ICC (11.x and later?)

-- Leif

Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Brainsware <i....@brainsware.org>.
Thing is: if this code made it to 3.2, I'd like to fix it

James Peach <jp...@apache.org> wrote:

>On 19/09/2012, at 3:09 PM, Leif Hedstrom <zw...@apache.org> wrote:
>
>> On 9/18/12 10:29 PM, James Peach wrote:
>>> On 18/09/2012, at 9:16 PM, Mladen Turk <mt...@apache.org> wrote:
>>> 
>>>> On 09/19/2012 02:02 AM, Igor Galić wrote:
>>>>> 
>>>>> On Solaris this got me through the CPU affinity stuff, but hung
>on:
>>>>> 
>>>>>    "SplitDNS.cc", line 639: Error: Could not find a match for
>ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*,
>SplitDNSConfigInfo*) needed in SplitDNSConfigProcessor::set(unsigned,
>SplitDNSConfigInfo*).
>>>>> 
>>>> Think that's the casting issue.
>>>> ink_atomic_cas is declared as ink_atomic_cas(void **, void *, void
>*)
>>>> so that won't work without explicit casting.
>>> Yep. For all platforms except Solaris I changed ink_atomic_cas over
>to be a template so that casting would not be required. If this is
>building with GCC on solaris, then the existing template implementation
>will work, otherwise it will be more interesting :)
>> 
>> 
>> I thought we agreed to drop explicit support for Oracle's SunStudio
>compilers?
>
>Great! I didn't see that written down anywhere ...
>
>J

-- 
I

Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by James Peach <jp...@apache.org>.
On 19/09/2012, at 3:09 PM, Leif Hedstrom <zw...@apache.org> wrote:

> On 9/18/12 10:29 PM, James Peach wrote:
>> On 18/09/2012, at 9:16 PM, Mladen Turk <mt...@apache.org> wrote:
>> 
>>> On 09/19/2012 02:02 AM, Igor Galić wrote:
>>>> 
>>>> On Solaris this got me through the CPU affinity stuff, but hung on:
>>>> 
>>>>    "SplitDNS.cc", line 639: Error: Could not find a match for ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*, SplitDNSConfigInfo*) needed in SplitDNSConfigProcessor::set(unsigned, SplitDNSConfigInfo*).
>>>> 
>>> Think that's the casting issue.
>>> ink_atomic_cas is declared as ink_atomic_cas(void **, void *, void *)
>>> so that won't work without explicit casting.
>> Yep. For all platforms except Solaris I changed ink_atomic_cas over to be a template so that casting would not be required. If this is building with GCC on solaris, then the existing template implementation will work, otherwise it will be more interesting :)
> 
> 
> I thought we agreed to drop explicit support for Oracle's SunStudio compilers?

Great! I didn't see that written down anywhere ...

J

Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Leif Hedstrom <zw...@apache.org>.
On 9/18/12 10:29 PM, James Peach wrote:
> On 18/09/2012, at 9:16 PM, Mladen Turk <mt...@apache.org> wrote:
>
>> On 09/19/2012 02:02 AM, Igor Galić wrote:
>>>
>>> On Solaris this got me through the CPU affinity stuff, but hung on:
>>>
>>>     "SplitDNS.cc", line 639: Error: Could not find a match for ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*, SplitDNSConfigInfo*) needed in SplitDNSConfigProcessor::set(unsigned, SplitDNSConfigInfo*).
>>>
>> Think that's the casting issue.
>> ink_atomic_cas is declared as ink_atomic_cas(void **, void *, void *)
>> so that won't work without explicit casting.
> Yep. For all platforms except Solaris I changed ink_atomic_cas over to be a template so that casting would not be required. If this is building with GCC on solaris, then the existing template implementation will work, otherwise it will be more interesting :)


I thought we agreed to drop explicit support for Oracle's SunStudio 
compilers?

-- Leif


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by James Peach <jp...@apache.org>.
On 18/09/2012, at 9:16 PM, Mladen Turk <mt...@apache.org> wrote:

> On 09/19/2012 02:02 AM, Igor Galić wrote:
>> 
>> 
>> On Solaris this got me through the CPU affinity stuff, but hung on:
>> 
>>    "SplitDNS.cc", line 639: Error: Could not find a match for ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*, SplitDNSConfigInfo*) needed in SplitDNSConfigProcessor::set(unsigned, SplitDNSConfigInfo*).
>> 
> 
> Think that's the casting issue.
> ink_atomic_cas is declared as ink_atomic_cas(void **, void *, void *)
> so that won't work without explicit casting.

Yep. For all platforms except Solaris I changed ink_atomic_cas over to be a template so that casting would not be required. If this is building with GCC on solaris, then the existing template implementation will work, otherwise it will be more interesting :)

> 
> Think something in that direction was was done in the LogObject::_checkout_write
> but I see no why it's casted to 64-bit always in that method.
> 
> 
> Regards
> -- 
> ^TM


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Mladen Turk <mt...@apache.org>.
On 09/19/2012 02:02 AM, Igor Galić wrote:
>
>
> On Solaris this got me through the CPU affinity stuff, but hung on:
>
>     "SplitDNS.cc", line 639: Error: Could not find a match for ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*, SplitDNSConfigInfo*) needed in SplitDNSConfigProcessor::set(unsigned, SplitDNSConfigInfo*).
>

Think that's the casting issue.
ink_atomic_cas is declared as ink_atomic_cas(void **, void *, void *)
so that won't work without explicit casting.

Think something in that direction was was done in the LogObject::_checkout_write
but I see no why it's casted to 64-bit always in that method.


Regards
-- 
^TM

Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Igor Galić <i....@brainsware.org>.

I have committed a patch which works on Linux/Solaris/FreeBSD

https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=commitdiff;h=eefd111a8e841b4a73d934ff81487317e640af13

n.b.: This is untested on OS X!

On Solaris this got me through the CPU affinity stuff, but hung on:

   "SplitDNS.cc", line 639: Error: Could not find a match for ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*, SplitDNSConfigInfo*) needed in SplitDNSConfigProcessor::set(unsigned, SplitDNSConfigInfo*).

Fortunately, Alan is planning to drop the bomb on DNS/ so, maybe
that'll fix it ;)

meanwhile, our buildbot, on which I developed and tested these
changes still doesn't build. And no, I have no friggin idea why.

So long,

i

----- Original Message -----
> 
> 
> ----- Original Message -----
> > j0!
> >
> > Humbedooh and moa have managed to gobble something together that
> > compiles on both, FreeBSD and Solaris. But maybe someone who
> > actually knows how to program would like to review this before
> > I commit the Solaris portion of the patch:
> >
> >
> > diff --git a/iocore/eventsystem/UnixEventProcessor.cc
> > b/iocore/eventsystem/UnixEventProcessor.cc
> > index 78f6f7d..95c0835 100644
> > --- a/iocore/eventsystem/UnixEventProcessor.cc
> > +++ b/iocore/eventsystem/UnixEventProcessor.cc
> > @@ -26,10 +26,14 @@
> >  #if TS_USE_HWLOC
> >  #include <hwloc.h>
> >  // TODO: (humbedooh): Make this build on Solaris with hwloc.
> > -#if defined(freebsd) || defined(solaris)
> > +#if defined(freebsd) || defined(darwin)
> >  #include <sys/cpuset.h>
> >  #define cpu_set_t cpuset_t
> >  #include <pthread_np.h>
> > +#elif defined(solaris)
> > +#include <sys/procset.h>
> > +#include <sys/processor.h>
> > +#include <sys/types.h>
> >  #endif
> >  #endif
> >  #include "ink_defs.h"
> > @@ -106,7 +110,9 @@ EventProcessor::start(int n_event_threads)
> >  #if TS_USE_HWLOC
> >    int affinity = 0;
> >    REC_ReadConfigInteger(affinity,
> >    "proxy.config.exec_thread.affinity");
> > +#if !defined(solaris)
> >    cpu_set_t cpuset;
> > +#endif
> >    const hwloc_topology_t *topology = ink_get_topology();
> >    int cu = hwloc_get_nbobjs_by_type(*topology, HWLOC_OBJ_CORE);
> >    int pu = hwloc_get_nbobjs_by_type(*topology, HWLOC_OBJ_PU);
> > @@ -121,11 +127,18 @@ EventProcessor::start(int n_event_threads)
> >
> >  #if TS_USE_HWLOC
> >      if (affinity == 1) {
> > -      CPU_ZERO(&cpuset);
> >        int cpu = (i - 1) % num_cpus;
> > +#if !defined(solaris)
> > +      CPU_ZERO(&cpuset);
> >        CPU_SET(cpu, &cpuset);
> > +#endif
> > +
> >        Debug("iocore_thread", "setaffinity tid: %p, net thread: %d,
> >        cpu: %d", tid, i, cpu);
> > +#if !defined(solaris)
> >        assert(pthread_setaffinity_np(tid, sizeof(cpu_set_t),
> >        &cpuset)
> >        == 0);
> > +#else
> > +      assert(processor_bind(P_LWPID, tid, cpu, NULL));
> > +#endif
> >      }
> >  #endif
> >    }
> >
> 
> btw, after applying this patch, we get the next failure here:
> 
> Making all in dns
> gmake[2]: Entering directory
> `/export/home/igalic/trafficserver/iocore/dns'
> source='SplitDNS.cc' object='SplitDNS.o' libtool=no \
>         DEPDIR=.deps depmode=none /bin/bash ../../build/aux/depcomp \
>         CC -DHAVE_CONFIG_H  -I. -I../../lib/ts
>          -I../../iocore/eventsystem -I../../iocore/net
>         -I../../iocore/aio -I../../iocore/hostdb
>         -I../../iocore/cache -I../../iocore/cluster
>         -I../../iocore/utils -I../../iocore/dns -I../../lib
>         -I../../lib/records -I../../lib/ts -I../../proxy
>         -I../../proxy/http -I../../proxy/hdrs -I../../mgmt
>         -I../../mgmt/utils -I../../mgmt/preparse
>         -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
>         -D_REENTRANT -Dsolaris -I/opt/csw/include
>         -I/usr/local/include  -g -mt -m64 -D__WORDSIZE=64 -O3
>         -library=stlport4 -erroff -c -o SplitDNS.o SplitDNS.cc
> "SplitDNS.cc", line 639: Error: Could not find a match for
> ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*,
> SplitDNSConfigInfo*) needed in
> SplitDNSConfigProcessor::set(unsigned, SplitDNSConfigInfo*).
> 1 Error(s) detected.
> gmake[2]: *** [SplitDNS.o] Error 2
> 
> so long,
> 
> i
> 
> --
> Igor Galić
> 
> Tel: +43 (0) 664 886 22 883
> Mail: i.galic@brainsware.org
> URL: http://brainsware.org/
> GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE
> 
> 

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> j0!
> 
> Humbedooh and moa have managed to gobble something together that
> compiles on both, FreeBSD and Solaris. But maybe someone who
> actually knows how to program would like to review this before
> I commit the Solaris portion of the patch:
> 
> 
> diff --git a/iocore/eventsystem/UnixEventProcessor.cc
> b/iocore/eventsystem/UnixEventProcessor.cc
> index 78f6f7d..95c0835 100644
> --- a/iocore/eventsystem/UnixEventProcessor.cc
> +++ b/iocore/eventsystem/UnixEventProcessor.cc
> @@ -26,10 +26,14 @@
>  #if TS_USE_HWLOC
>  #include <hwloc.h>
>  // TODO: (humbedooh): Make this build on Solaris with hwloc.
> -#if defined(freebsd) || defined(solaris)
> +#if defined(freebsd) || defined(darwin)
>  #include <sys/cpuset.h>
>  #define cpu_set_t cpuset_t
>  #include <pthread_np.h>
> +#elif defined(solaris)
> +#include <sys/procset.h>
> +#include <sys/processor.h>
> +#include <sys/types.h>
>  #endif
>  #endif
>  #include "ink_defs.h"
> @@ -106,7 +110,9 @@ EventProcessor::start(int n_event_threads)
>  #if TS_USE_HWLOC
>    int affinity = 0;
>    REC_ReadConfigInteger(affinity,
>    "proxy.config.exec_thread.affinity");
> +#if !defined(solaris)
>    cpu_set_t cpuset;
> +#endif
>    const hwloc_topology_t *topology = ink_get_topology();
>    int cu = hwloc_get_nbobjs_by_type(*topology, HWLOC_OBJ_CORE);
>    int pu = hwloc_get_nbobjs_by_type(*topology, HWLOC_OBJ_PU);
> @@ -121,11 +127,18 @@ EventProcessor::start(int n_event_threads)
>  
>  #if TS_USE_HWLOC
>      if (affinity == 1) {
> -      CPU_ZERO(&cpuset);
>        int cpu = (i - 1) % num_cpus;
> +#if !defined(solaris)
> +      CPU_ZERO(&cpuset);
>        CPU_SET(cpu, &cpuset);
> +#endif
> +
>        Debug("iocore_thread", "setaffinity tid: %p, net thread: %d,
>        cpu: %d", tid, i, cpu);
> +#if !defined(solaris)
>        assert(pthread_setaffinity_np(tid, sizeof(cpu_set_t), &cpuset)
>        == 0);
> +#else
> +      assert(processor_bind(P_LWPID, tid, cpu, NULL));
> +#endif
>      }
>  #endif
>    }
> 

btw, after applying this patch, we get the next failure here:

Making all in dns
gmake[2]: Entering directory `/export/home/igalic/trafficserver/iocore/dns'
source='SplitDNS.cc' object='SplitDNS.o' libtool=no \
        DEPDIR=.deps depmode=none /bin/bash ../../build/aux/depcomp \
        CC -DHAVE_CONFIG_H  -I. -I../../lib/ts  -I../../iocore/eventsystem -I../../iocore/net -I../../iocore/aio -I../../iocore/hostdb -I../../iocore/cache -I../../iocore/cluster -I../../iocore/utils -I../../iocore/dns -I../../lib -I../../lib/records -I../../lib/ts -I../../proxy -I../../proxy/http -I../../proxy/hdrs -I../../mgmt -I../../mgmt/utils -I../../mgmt/preparse -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_REENTRANT -Dsolaris -I/opt/csw/include -I/usr/local/include  -g -mt -m64 -D__WORDSIZE=64 -O3 -library=stlport4 -erroff -c -o SplitDNS.o SplitDNS.cc
"SplitDNS.cc", line 639: Error: Could not find a match for ink_atomic_cas(SplitDNSConfigInfo**, SplitDNSConfigInfo*, SplitDNSConfigInfo*) needed in SplitDNSConfigProcessor::set(unsigned, SplitDNSConfigInfo*).
1 Error(s) detected.
gmake[2]: *** [SplitDNS.o] Error 2

so long,

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


Re: Getting Solaris buildbot to compile again + CPU affinity

Posted by Igor Galić <i....@brainsware.org>.
j0!

Humbedooh and moa have managed to gobble something together that
compiles on both, FreeBSD and Solaris. But maybe someone who
actually knows how to program would like to review this before
I commit the Solaris portion of the patch:


diff --git a/iocore/eventsystem/UnixEventProcessor.cc b/iocore/eventsystem/UnixEventProcessor.cc
index 78f6f7d..95c0835 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -26,10 +26,14 @@
 #if TS_USE_HWLOC
 #include <hwloc.h>
 // TODO: (humbedooh): Make this build on Solaris with hwloc.
-#if defined(freebsd) || defined(solaris)
+#if defined(freebsd) || defined(darwin)
 #include <sys/cpuset.h>
 #define cpu_set_t cpuset_t
 #include <pthread_np.h>
+#elif defined(solaris)
+#include <sys/procset.h>
+#include <sys/processor.h>
+#include <sys/types.h>
 #endif
 #endif
 #include "ink_defs.h"
@@ -106,7 +110,9 @@ EventProcessor::start(int n_event_threads)
 #if TS_USE_HWLOC
   int affinity = 0;
   REC_ReadConfigInteger(affinity, "proxy.config.exec_thread.affinity");
+#if !defined(solaris)
   cpu_set_t cpuset;
+#endif
   const hwloc_topology_t *topology = ink_get_topology();
   int cu = hwloc_get_nbobjs_by_type(*topology, HWLOC_OBJ_CORE);
   int pu = hwloc_get_nbobjs_by_type(*topology, HWLOC_OBJ_PU);
@@ -121,11 +127,18 @@ EventProcessor::start(int n_event_threads)
 
 #if TS_USE_HWLOC
     if (affinity == 1) {
-      CPU_ZERO(&cpuset);
       int cpu = (i - 1) % num_cpus;
+#if !defined(solaris)
+      CPU_ZERO(&cpuset);
       CPU_SET(cpu, &cpuset);
+#endif
+
       Debug("iocore_thread", "setaffinity tid: %p, net thread: %d, cpu: %d", tid, i, cpu);
+#if !defined(solaris)
       assert(pthread_setaffinity_np(tid, sizeof(cpu_set_t), &cpuset) == 0);
+#else
+      assert(processor_bind(P_LWPID, tid, cpu, NULL));
+#endif
     }
 #endif
   }