[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b9a48945-7fc7-2463-2b56-61ad43e54754@intel.com>
Date: Fri, 14 Feb 2020 12:26:34 -0500
From: Dennis Dalessandro <dennis.dalessandro@...el.com>
To: madhuparnabhowmik04@...il.com, mike.marciniszyn@...el.com,
jgg@...pe.ca, paulmck@...nel.org
Cc: joel@...lfernandes.org, frextrite@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
rcu@...r.kernel.org, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] infiniband: sw: rdmavt: mcast.c: Use built-in RCU
list checking
On 1/14/2020 11:25 AM, madhuparnabhowmik04@...il.com wrote:
> From: Madhuparna Bhowmik <madhuparnabhowmik04@...il.com>
>
> Use built-in RCU and lock-checking for list_for_each_entry_rcu()
> by passing the cond argument.
>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@...il.com>
> ---
> drivers/infiniband/sw/rdmavt/mcast.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rdmavt/mcast.c b/drivers/infiniband/sw/rdmavt/mcast.c
> index dd11c6fcd060..31c7f12c7665 100644
> --- a/drivers/infiniband/sw/rdmavt/mcast.c
> +++ b/drivers/infiniband/sw/rdmavt/mcast.c
> @@ -224,7 +224,7 @@ static int rvt_mcast_add(struct rvt_dev_info *rdi, struct rvt_ibport *ibp,
> }
>
> /* Search the QP list to see if this is already there. */
> - list_for_each_entry_rcu(p, &tmcast->qp_list, list) {
> + list_for_each_entry_rcu(p, &tmcast->qp_list, list, lockdep_is_held(&(ibp->lock))) {
> if (p->qp == mqp->qp) {
> ret = ESRCH;
> goto bail;
>
This one is OK. The lock is held and it is the correct one to use when
updating the list.
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@...el.com>
Powered by blists - more mailing lists