Re: Sparse annotation for "context imbalance" false positives?
- Date: Thu, 15 May 2008 10:54:23 +0200
- From: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
- Subject: Re: Sparse annotation for "context imbalance" false positives?
You could, for example, insert this:
> static void mlx4_ib_lock_cqs(struct mlx4_ib_cq *send_cq, struct mlx4_ib_cq *recv_cq)
> {
> if (send_cq == recv_cq)
{
> spin_lock_irq(&send_cq->lock);
/* pretend to have acquired both for sparse */
__acquire(&recv_cq->lock);
}
> else if (send_cq->mcq.cqn < recv_cq->mcq.cqn) {
> spin_lock_irq(&send_cq->lock);
> spin_lock_nested(&recv_cq->lock, SINGLE_DEPTH_NESTING);
> } else {
> spin_lock_irq(&recv_cq->lock);
> spin_lock_nested(&send_cq->lock, SINGLE_DEPTH_NESTING);
> }
> }
and then declare that you take "both" locks. Not sure if that will bite
you in the callers again though.
The exact syntax is still a bit under discussion though, whether to use
&recv_cq->lock or leave out the "&" there, I'm favouring the approach
with & but the kernel uses no & in some places.
johannes
Attachment:
signature.asc
Description: This is a digitally signed message part
- Follow-Ups:
- Re: Sparse annotation for "context imbalance" false positives?
- From: Roland Dreier
- Re: Sparse annotation for "context imbalance" false positives?
- References:
- Sparse annotation for "context imbalance" false positives?
- From: Roland Dreier
- Sparse annotation for "context imbalance" false positives?
- Prev by Date: Re: [announce] "kill the Big Kernel Lock (BKL)" tree
- Next by Date: Re: [PATCH 0/2] x86: per-device dma_mapping_ops
- Previous by thread: Sparse annotation for "context imbalance" false positives?
- Next by thread: Re: Sparse annotation for "context imbalance" false positives?
- Index(es):