Re: Thread Affinity structure

2011-02-04 Thread Sri Ram Vemulpali
Hi Christoph,

  Thanks for response. Can you please explain in little bit elaborate
what do you mean

 "The value returned  from a call to gettid(2) can be passed in the argument
 pid.  Specifying pid as 0 will set the attribute for the calling thread,
 and passing the value returned from a call to getpid(2) will set the
 attribute for the main thread of the thread group."

To whom I should pass the id. I did not understood.

Thanks,
Sri.

On Fri, Feb 4, 2011 at 2:29 PM, Christoph Lameter  wrote:
> On Fri, 4 Feb 2011, Sri Ram Vemulpali wrote:
>
>>     I have doubt regarding how the thread affinity (to processor) is
>> defined in a process (task). If there is only single thread in a
>> process, then when process calls itself on binding to a core, will let
>> run on that core forever. But, what if there are multiple threads, in
>> a process (task). If the main thread calls set affinity to a core, is
>> it going to get inherited to all other threads, or just the calling
>> thread in a task. What happens when forked a process with threads that
>> has affinity to a core. Please can anyone point me to the literature
>> on this. Thanks in advance.
>
> See "man sched_setaffinity"
>
> "
> The affinity mask is actually a per-thread attribute that can be
> adjusted independently for each of the threads in a thread group.  The
> value returned  from a call to gettid(2) can be passed in the argument
> pid.  Specifying pid as 0 will set the attribute for the calling thread,
> and passing the value returned from a call to getpid(2) will set the
> attribute for the main thread of the thread group.  (If you  are  using
> the  POSIX threads API, then use pthread_setaffinity_np(3) instead of
> sched_setaffinity().)
> "
>
>
>
> The setting of the affinity occurs for the running thread if pid == 0.
> Affinity masks are inherited across forks.
>
>
>
>
>
>



-- 
Regards,
Sri.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: page size change on MIPS

2011-02-04 Thread David Daney
On 02/03/2011 08:16 PM, naveen yadav wrote:
> Hi, I am adding readelf info also .
>
> mips-linux-gnu-readelf -S squashfs-root/bin/busybox
> There are 35 section headers, starting at offset 0x174290:
>

Section headers are not relevant to any of this.  You need to look at 
the program headers.  Try 'readelf -l'

David Daney


[...]
>>
>>
>> On Mon, Jan 31, 2011 at 6:38 PM, Ralf Baechle  wrote:
>>> On Sun, Jan 30, 2011 at 08:32:43PM +0530, Himanshu Aggarwal wrote:
>>>
 Why should the application or the toolchains depend on pagesize? I am
 not very clear on this. Can someone explain it?
>>>
>>> To allow loading directly with mmap the executable file's layout must
>>> be such that it's it's segments are on offsets that are a multiple of
>>> the page size so in turn the linker must know that alignment.
>>>
>>>   Ralf
>>>
>>
>


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Thread Affinity structure

2011-02-04 Thread Sri Ram Vemulpali
Hi all,

I have doubt regarding how the thread affinity (to processor) is
defined in a process (task). If there is only single thread in a
process, then when process calls itself on binding to a core, will let
run on that core forever. But, what if there are multiple threads, in
a process (task). If the main thread calls set affinity to a core, is
it going to get inherited to all other threads, or just the calling
thread in a task. What happens when forked a process with threads that
has affinity to a core. Please can anyone point me to the literature
on this. Thanks in advance.

-- 
Regards,
Sri.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies