Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1536267

Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake to not use wait-queues

From Davidlohr Bueso <dave@stgolabs.net>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake to not use wait-queues
Date 2016-12-05 18:40 +0100
Message-ID <sL5p8-7ud-19@gated-at.bofh.it> (permalink)
References <sEWye-2tW-9@gated-at.bofh.it> <sEWye-2tW-29@gated-at.bofh.it> <sK85H-3yk-1@gated-at.bofh.it> <sKWYx-2e2-17@gated-at.bofh.it> <sKZD4-3S7-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 05 Dec 2016, Oleg Nesterov wrote:

>Yes. But percpu_down_write() should not be used after exit_notify(), so we
>can rely on rcu_read_lock(), release_task()->call_rcu(delayed_put_task_struct)
>can't be called until an exiting task passes exit_notify().
>
>But then we probably need WARN_ON(current->exit_state) in percpu_down_write().

Hmm, my immediate thought would have been doing a PF_EXITING check, but of course
this enlarges the window of the warn being triggered, yet maintains what you are
saying in that percpu_down_write should not be used after do_exit/exit_notify.
Furthermore, reading the comment in task_rcu_dereference, I get your point and
we can loose the reference to the task, iow busted rcu read cr.

>
>And personally I think this change should add the new helpers, they can have
>more users. Something like
>
>	struct xxx {

What do you think of s/xxx/rcuwait?

Thanks,
Davidlohr

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake to not  use wait-queues Davidlohr Bueso <dave@stgolabs.net> - 2016-12-03 03:20 +0100
  Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake to  not use wait-queues Peter Zijlstra <peterz@infradead.org> - 2016-12-05 09:40 +0100
    Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake         to not use wait-queues Oleg Nesterov <oleg@redhat.com> - 2016-12-05 12:30 +0100
      Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake         to not use wait-queues Oleg Nesterov <oleg@redhat.com> - 2016-12-05 12:50 +0100
      Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake to  not use wait-queues Davidlohr Bueso <dave@stgolabs.net> - 2016-12-05 18:40 +0100
    Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake         to not use wait-queues Oleg Nesterov <oleg@redhat.com> - 2016-12-05 18:20 +0100
  Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake         to not use wait-queues Oleg Nesterov <oleg@redhat.com> - 2016-12-05 18:20 +0100

csiph-web