Corey,

Thanks for chasing that one down.
I have decided to go with the libc call. It should
be okay given this API has been there for a very long
time now.

I fixed the problem in syst.c and syst_np.c

Thanks.


On Wed, Aug 26, 2009 at 2:04 AM, Corey
Ashford<cjash...@linux.vnet.ibm.com> wrote:
> There is an error in syst.c which manifests itself on big-endian machines
> when syst.c is compiled in 32-bit mode.
>
> The bit vector which is used to describe the cpus that you want to set the
> affinity for is an array of 32-bit words (when using the
> compat_sys_sched_setaffinity system call in 32-bit mode).  syst programs a
> vector of 64-bit words.  On a little endian machine, this wouldn't matter,
> because the least significant byte of the 32-bit or 64-bit word is always at
> offset 0.  But on a big-endian machine, the least significant byte is at
> offset 0x3 or 0x7 depending on the word size.  So the result is that the bit
> vector is interpreted as setting the affinity for a cpu which does not
> exist.
>
> There are a couple of ways to fix this, and this patch contains both
> variants, depending on whether the OS_HAS_SCHED_SETAFFINITY_LIB_CALL macro
> is either defined or not.
>
> I assume that when syst.c was originally written, a library call for
> sched_setaffinity wasn't available, and may still not be available on some
> older OS's.  So you can choose how you want to fix this problem, either by
> using the
> library call, or by using the other variant I included which does not use
> the
> library call, but instead uses code that's more flexible to the size of the
> words in the cpu set vector.  You can decide which one you want to commit
> (if either), and then cut out the variant you didn't use.
>
>
> Signed-off-by: Corey Ashford <cjash...@us.ibm.com>
>
> Thanks for your consideration,
>
> - Corey
>
> Corey Ashford
> Software Engineer
> IBM Linux Technology Center, Linux Toolchain
> Beaverton, OR
> 503-578-3507
> cjash...@us.ibm.com
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to