Sleeping in RCU list traversal

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <a.p.zijlstra@...>
Cc: <linux-kernel@...>, <linux-security-module@...>
Date: Sunday, October 7, 2007 - 6:38 am

Hello.

Peter Zijlstra wrote:

Something like this?

  rcu_read_lock();
  list_for_each_rcu(p, ...) {
    ptr = list_entry(p, struct ..., list);
    /* Grab a reference to "ptr". */
    rcu_read_unlock();
    my_task_that_may_sleep(ptr);
    rcu_read_lock();
    /* Drop a reference to "ptr". */
  }
  rcu_read_unlock();

Regarding my case, memory region pointed by "ptr" never be removed.
Do I need to grab a reference to "ptr" ?

Regards.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[TOMOYO 14/15](repost) LSM expansion for TOMOYO Linux., Kentaro Takeda, (Tue Oct 2, 3:39 am)
[TOMOYO 13/15](repost) Conditional permission support., Kentaro Takeda, (Tue Oct 2, 3:39 am)
[TOMOYO 12/15](repost) LSM adapter for TOMOYO., Kentaro Takeda, (Tue Oct 2, 3:38 am)
[TOMOYO 08/15](repost) Argv[0] access control functions., Kentaro Takeda, (Tue Oct 2, 3:35 am)
[TOMOYO 07/15](repost) File access control functions., Kentaro Takeda, (Tue Oct 2, 3:34 am)
[TOMOYO 06/15](repost) Auditing interface., Kentaro Takeda, (Tue Oct 2, 3:33 am)
Re: [TOMOYO 05/15](repost) Domain transition handler functio..., YOSHIFUJI Hideaki / , (Wed Oct 3, 7:43 am)
Sleeping in RCU list traversal, Tetsuo Handa, (Sun Oct 7, 6:38 am)
Re: [TOMOYO 05/15](repost) Domain transition handler functio..., YOSHIFUJI Hideaki / , (Wed Oct 3, 10:32 am)
Re: [TOMOYO 05/15](repost) Domain transition handler functio..., YOSHIFUJI Hideaki / , (Wed Oct 3, 9:11 am)
Re: [TOMOYO 05/15](repost) Domain transition handler functio..., YOSHIFUJI Hideaki / , (Tue Oct 2, 9:00 am)