From: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@kernel.org>, linux-kernel@vger.kernel.org
Cc: Dan Williams <dan.j.williams@intel.com>,
David Howells <dhowells@redhat.com>,
Daniel Vetter <daniel.vetter@intel.com>,
David Airlie <airlied@linux.ie>,
Stanimir Varbanov <stanimir.varbanov@linaro.org>,
Chris Mason <clm@fb.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
Joel Becker <jlbec@evilplan.org>, James Hogan <jhogan@kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
George Spelvin <linux@sciencehorizons.net>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>
Subject: [PATCH 09/11] sched/wait,mips: Fix and replace wait_on_atomic_t usage
Date: Thu, 15 Mar 2018 13:19:11 +0100 [thread overview]
Message-ID: <20180315123202.787477034@infradead.org> (raw)
In-Reply-To: <20180315121902.942902000@infradead.org>
[-- Attachment #1: peterz-wait_var-9.patch --]
[-- Type: text/plain, Size: 1169 bytes --]
Convert the wait_on_atomic_t() usage to the new wait_var_event() API.
And while there, add the missing wakeup...
Cc: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
arch/mips/kernel/process.c | 2 ++
arch/mips/kernel/traps.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -781,6 +781,8 @@ int mips_set_process_fp_mode(struct task
atomic_set(&task->mm->context.fp_mode_switching, 0);
preempt_enable();
+ wake_up_var(&task->mm->context.fp_mode_switching);
+
return 0;
}
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1248,8 +1248,8 @@ static int enable_restore_fp_context(int
* If an FP mode switch is currently underway, wait for it to
* complete before proceeding.
*/
- wait_on_atomic_t(¤t->mm->context.fp_mode_switching,
- atomic_t_wait, TASK_KILLABLE);
+ wait_var_event(¤t->mm->context.fp_mode_switching,
+ !atomic_read(¤t->mm->context.fp_mode_switching));
if (!used_math()) {
/* First time FP context user. */
next prev parent reply other threads:[~2018-03-15 12:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-15 12:19 [PATCH 00/11] sched/wait: Replace wait_on_atomic_t() with wait_var_event() Peter Zijlstra
2018-03-15 12:19 ` [PATCH 01/11] sched/wait: Introduce wait_var_event() Peter Zijlstra
2018-03-19 16:45 ` Dan Williams
2018-03-15 12:19 ` [PATCH 02/11] sched/wait,drm: Replace wait_on_atomic_t usage Peter Zijlstra
2018-03-15 12:50 ` Chris Wilson
2018-03-15 12:19 ` [PATCH 03/11] sched/wait,media: " Peter Zijlstra
2018-03-15 12:19 ` [PATCH 04/11] sched/wait,afs: " Peter Zijlstra
2018-03-15 12:19 ` [PATCH 05/11] sched/wait,btrfs: " Peter Zijlstra
2018-03-15 20:17 ` David Sterba
2018-03-15 12:19 ` [PATCH 06/11] sched/wait,fscache: " Peter Zijlstra
2018-03-15 12:19 ` [PATCH 07/11] sched/wait,nfs: " Peter Zijlstra
2018-03-15 12:19 ` [PATCH 08/11] sched/wait,ocfs2: " Peter Zijlstra
2018-03-15 12:19 ` Peter Zijlstra [this message]
2018-03-15 12:19 ` [PATCH 10/11] sched/wait: Remove wait_on_atomic_t() Peter Zijlstra
2018-03-15 12:19 ` [PATCH 11/11] sched/wait: Improve __var_waitqueue() Peter Zijlstra
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=20180315123202.787477034@infradead.org \
--to=peterz@infradead.org \
--cc=airlied@linux.ie \
--cc=anna.schumaker@netapp.com \
--cc=clm@fb.com \
--cc=dan.j.williams@intel.com \
--cc=daniel.vetter@intel.com \
--cc=dhowells@redhat.com \
--cc=jhogan@kernel.org \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@sciencehorizons.net \
--cc=mingo@kernel.org \
--cc=ralf@linux-mips.org \
--cc=stanimir.varbanov@linaro.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®