mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 00/11] sched/wait: Replace wait_on_atomic_t() with wait_var_event()
@ 2018-03-15 12:19 Peter Zijlstra
  2018-03-15 12:19 ` [PATCH 01/11] sched/wait: Introduce wait_var_event() Peter Zijlstra
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: Peter Zijlstra @ 2018-03-15 12:19 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: Dan Williams, David Howells, Daniel Vetter, David Airlie,
	Stanimir Varbanov, Chris Mason, Anna Schumaker, Joel Becker,
	James Hogan, Ralf Baechle, Linus Torvalds, George Spelvin,
	Peter Zijlstra (Intel)

I never really liked the whole wait_on_atomic_t() because of the hard-coded
type and condition. And when Dan proposed to add 50+ lines of duplication to
implement wait_on_atomic_one() I figured that was it.

Instead implement wait_var_event(), which at the fundamental level is much the
same hashed-waitqueue as wait_on_atomic_t() is, but it doesn't care about the
type or condition.

It is further modelled on the existing wait_event() API and is otherwise
consistent with that.

The existing:

  wait_for_atomic_t(&my_atomic, wait_atomic_t, TASK_UNINTERRUPTIBLE);
  wake_up_atomic_t(&my_atomic);

can be replaced with:

  wait_var_event(&my_atomic, !atomic_read(&my_atomic));
  wake_up_var(&my_atomic);

And Dan can do what he needs done using:

  wait_var_event(&my_atomic, atomic_read(&my_atomic) == 1);


---
 arch/mips/kernel/process.c                         |   2 +
 arch/mips/kernel/traps.c                           |   4 +-
 drivers/gpu/drm/drm_dp_aux_dev.c                   |  13 +--
 drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c |  14 +--
 drivers/media/platform/qcom/venus/hfi.c            |   8 +-
 fs/afs/cell.c                                      |   6 +-
 fs/afs/rxrpc.c                                     |   6 +-
 fs/afs/server.c                                    |   6 +-
 fs/btrfs/extent-tree.c                             |  14 ++-
 fs/btrfs/ioctl.c                                   |   2 +-
 fs/fscache/cookie.c                                |   7 +-
 fs/nfs/inode.c                                     |   5 -
 fs/nfs/pagelist.c                                  |   6 +-
 fs/nfs/pnfs_nfs.c                                  |   2 +-
 fs/nfs/write.c                                     |   6 +-
 fs/ocfs2/filecheck.c                               |   9 +-
 include/linux/fscache-cache.h                      |   2 +-
 include/linux/wait_bit.h                           |  95 +++++++++++++-----
 kernel/sched/wait_bit.c                            | 110 +++++----------------
 19 files changed, 147 insertions(+), 170 deletions(-)

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-03-19 16:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 09/11] sched/wait,mips: Fix and replace " Peter Zijlstra
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

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®