Re: Re: Changing the state of a process

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

 



On Sat, Dec 31, 2005 at 01:25:12PM -0500, Mulyadi Santosa wrote:
> Hello Mr McKinney...
> 
> > set_task_state() ensures that no later memory references will be reordered,
> > either by the CPU or by the compiler, to occur before the assignment
> > to task_struct->state.
> >
> > A simple assignment does -not- make this guarantee.
> 
> In this case, AFAIK HT is also considered as SMP....if it is, then
> set_task_state() is the correct way to go?

HT is indeed SMP as far as memory barriers are concerned.

However, this does not necessarily mean that each and every assignment
to task_struct->state is a bug.  You need to look at the context -- what
locks are held, whether the task structure in question is accessible
to other CPUs (e.g., during initialization), and so on.  Of course, if
you have a test case that forces a failure, and changing to use
set_task_state() prevents that failure, please submit the patch to
LKML.

						Thanx, Paul

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux