From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
To: Matthew Fortune <Matthew.Fortune@imgtec.com>,
Paul Burton <Paul.Burton@imgtec.com>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Cc: Markos Chandras <Markos.Chandras@imgtec.com>
Subject: Re: MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options for MIPS
Date: Fri, 9 Jan 2015 10:42:29 -0800 [thread overview]
Message-ID: <54B02115.7090609@imgtec.com> (raw)
In-Reply-To: <6D39441BF12EF246A7ABCE6654B0235320F9B4C3@LEMAIL01.le.imgtec.org>
On 01/09/2015 12:34 AM, Matthew Fortune wrote:
> Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> writes:
>>
>> This piece of thread walking seems to be not thread safe for newly
>> created thread.
>> Thread creation is not locked between points of copy_thread which copies
>> task thread flags and makeing thread visible to walking via
>> "for_each_thread".
>>
>> So it is possible in environment with two threads - one is creating an
>> another thread, another one switching FPU mode and waiting and race
>> condition may causes a newly thread in old mode but the rest of thread
>> group is in new mode.
>>
>> Besides that, it looks like in kernel with tickless mode a scheduler may
>> no come a long time in idle system, in extreme case - forever.
> Only commenting on the tickless issue... The requirement for the
> PR_SET_FP_MODE call is that all threads in the current thread group switch
> to the new mode prior to it returning. I believe that simply means there
> is no alternative other than for the tickless case to wait as long as it
> has to wait? If the prctl failed in tickless mode (or timed out) then that
> is likely to lead to a program failing to load its libraries and aborting.
There is another design, which doesn't use walk through all thread group
and any scheduler wait.
It is based on IPI call to kick off threads-from-this-memory-map from
FPU usage in all CPUs and keeping/updating the real FPU mode flag in
memory map "context".
I have it and will post it to internal IMG mail list (currently, it
doesn't use "prctl" but "sysmips" syscall, and is designed around 3.10
kernel).
- Leonid.
next prev parent reply other threads:[~2015-01-09 18:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 12:17 [PATCH] MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options for MIPS Paul Burton
2015-01-08 12:17 ` Paul Burton
2015-01-08 12:54 ` Matthew Fortune
2015-01-09 2:25 ` Leonid Yegoshin
2015-01-09 2:25 ` Leonid Yegoshin
2015-01-09 8:34 ` Matthew Fortune
2015-01-09 18:42 ` Leonid Yegoshin [this message]
[not found] ` <54B024AA.1020400@imgtec.com>
2015-01-09 21:25 ` Matthew Fortune
2015-01-09 21:25 ` Matthew Fortune
[not found] ` <1420719457-690-1-git-send-email-paul.burton-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-01-13 13:12 ` [PATCH] " Markos Chandras
2015-01-13 13:12 ` Markos Chandras
2015-01-13 13:12 ` Markos Chandras
[not found] ` <54B519B6.5040604-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-01-16 15:43 ` Markos Chandras
2015-01-16 15:43 ` Markos Chandras
2015-01-16 15:43 ` Markos Chandras
2015-01-18 21:47 ` Paul Burton
2015-01-18 21:47 ` Paul Burton
2015-01-18 21:47 ` Paul Burton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54B02115.7090609@imgtec.com \
--to=leonid.yegoshin@imgtec.com \
--cc=Markos.Chandras@imgtec.com \
--cc=Matthew.Fortune@imgtec.com \
--cc=Paul.Burton@imgtec.com \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.