[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070228.222341.74751530.davem@davemloft.net>
Date: Wed, 28 Feb 2007 22:23:41 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: akpm@...ux-foundation.org
Cc: compudj@...gle.com, mbligh@...gle.com,
linux-kernel@...r.kernel.org, ak@...e.de, paulus@...ba.org,
tony.luck@...el.com, hskinnemoen@...el.com
Subject: Re: Thread flags modified without set_thread_flag() (non
atomically)
From: Andrew Morton <akpm@...ux-foundation.org>
Date: Wed, 28 Feb 2007 22:03:49 -0800
> On Mon, 26 Feb 2007 12:10:37 -0800 Mathieu Desnoyers <compudj@...gle.com> wrote:
>
> > Other examples :
> >
> > sparc64/kernel/ptrace.c: if
> > ((task_thread_info(child)->flags & _TIF_32BIT) != 0) {
> > sparc64/kernel/process.c: t->flags ^= (_TIF_ABI_PENDING |
> > _TIF_32BIT);
> > sparc64/kernel/process.c: t->flags &= ~_TIF_PERFCTR;
> >
> > sparc/kernel/process.c: current_thread_info()->flags &=
> > ~_TIF_USEDFPU;
> > sparc/kernel/process.c: current_thread_info()->flags &=
> > ~_TIF_USEDFPU;
> > sparc/kernel/process.c: current_thread_info()->flags &=
> > ~_TIF_USEDFPU;
> > sparc/kernel/process.c: current_thread_info()->flags &=
> > ~(_TIF_USEDFPU);
> > sparc/kernel/traps.c: current_thread_info()->flags |= _TIF_USEDFPU;
> > sparc/kernel/traps.c: task_thread_info(fpt)->flags &= ~_TIF_USEDFPU;
>
> That all looks rather deliberate.
>
> > powerpc/kernel/process.c: t->flags ^= (_TIF_ABI_PENDING |
> > _TIF_32BIT);
> >
> > ia64/kernel/mca.c: ti->flags = _TIF_MCA_INIT;
> >
> > avr32/kernel/ptrace.c: ti->flags |= _TIF_BREAKPOINT;
>
> No, I don't immediately see anything in the flush_old_exec() code path
> which tells us that nobody else can look up this thread_info (or be holding
> a ref to it) in this context.
Provide the counter example, what other threads of control can modify
relevant flags while a thread is exec()'ing? It's essentially frozen
outside of these code paths, otherwise we wouldn't be able to make all
of these modifications to the task state.
I think these cases are very safe.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists