From: Xiaofei Tan <tanxiaofei@huawei.com>
To: James Morse <james.morse@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Linuxarm <linuxarm@huawei.com>, Will Deacon <will@kernel.org>,
Dave Martin <Dave.Martin@arm.com>,
linux-arm-kernel@lists.infradead.org,
Shiju Jose <shiju.jose@huawei.com>
Subject: Re: Question about SEA handling process happened in user space
Date: Sat, 18 Apr 2020 19:25:29 +0800 [thread overview]
Message-ID: <5E9AE3A9.5020904@huawei.com> (raw)
In-Reply-To: <bddb100a-7353-1aac-9877-9c5df5bd2c92@arm.com>
Hi James
On 2020/4/16 21:50, James Morse wrote:
> On 10/04/2020 10:43, Xiaofei Tan wrote:
>> On 2020/4/9 22:28, James Morse wrote:
>>> On 09/04/2020 10:17, Xiaofei Tan wrote:
>>>> On 2020/4/8 0:37, James Morse wrote:
>>>>> With that series, it runs in process-context as task-work. memory_failure() needs to
>>>>> sleep, so it has to run in process-context.
>
>>>>> Doing it as task-work means it runs before the thread returns to user-space.
>>>>
>>>> Sorry, i don't understand this. i thought the task-work need to reschedule, and current thread should
>>>> have returned to user-space before it.
>>>
>>> ret_to_user has a loop around do_notify_resume(), if the _TIF_NOTIFY_RESUME flag is set
>>> and we call tracehook_notify_resume() which ends up in task_work_run()...
>>>
>>> That TIF flag effectively prevents this thread returning to user-space until that task
>>> work has run.
>
>> Got it. This function is great.
>
> I think PeterZ pointed me at it,
>
Great.
>
>> BTW, i have not found the place of setting the flag _TIF_NOTIFY_RESUME. Is it set by default for each thread?
>
> With that series, APEI calls task_work_add(), which calls set_notify_resume() from
> include/linux/tracehook.h
> | if (!test_and_set_tsk_thread_flag(task, TIF_NOTIFY_RESUME))
>
Got it. thanks.
>
> Thanks,
>
> James
>
> .
>
--
thanks
tanxiaofei
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2020-04-18 11:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-30 13:10 Question about SEA handling process happened in user space Xiaofei Tan
2020-03-30 16:49 ` James Morse
2020-03-31 9:41 ` Xiaofei Tan
2020-03-31 17:00 ` James Morse
2020-04-01 3:49 ` Xiaofei Tan
2020-04-07 16:37 ` James Morse
2020-04-09 8:42 ` Xiaofei Tan
2020-04-09 14:28 ` James Morse
2020-04-10 2:55 ` Xiaofei Tan
2020-04-16 13:27 ` James Morse
2020-04-18 10:49 ` Xiaofei Tan
2020-04-02 6:35 ` Xiaofei Tan
2020-04-07 16:37 ` James Morse
2020-04-09 9:17 ` Xiaofei Tan
2020-04-09 14:28 ` James Morse
2020-04-10 9:43 ` Xiaofei Tan
2020-04-16 13:50 ` James Morse
2020-04-18 11:25 ` Xiaofei Tan [this message]
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=5E9AE3A9.5020904@huawei.com \
--to=tanxiaofei@huawei.com \
--cc=Dave.Martin@arm.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linuxarm@huawei.com \
--cc=shiju.jose@huawei.com \
--cc=will@kernel.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.