| To: | herbert@xxxxxxxxxxxxxxxxxxx |
|---|---|
| Subject: | Re: [NET] Fix neighbour tbl->entries race |
| From: | YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx> |
| Date: | Wed, 03 Nov 2004 10:14:03 +0900 (JST) |
| Cc: | hadi@xxxxxxxxxx, davem@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx, yoshfuji@xxxxxxxxxxxxxx |
| In-reply-to: | <20041102210259.GA12642@gondor.apana.org.au> |
| Organization: | USAGI Project |
| References: | <1099404823.1021.15.camel@jzny.localdomain> <20041102203720.GA12108@gondor.apana.org.au> <20041102210259.GA12642@gondor.apana.org.au> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
In article <20041102210259.GA12642@xxxxxxxxxxxxxxxxxxx> (at Wed, 3 Nov 2004
08:02:59 +1100), Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> says:
> - if (tbl->entries > tbl->gc_thresh3 ||
> - (tbl->entries > tbl->gc_thresh2 &&
> + entries = atomic_inc_return(&tbl->entries) - 1;
> + if (entries >= tbl->gc_thresh3 ||
> + (entries >= tbl->gc_thresh2 &&
Why don't you do something like this?
entries = atomic_inc_return(&tbl->entries);
if (entries > tbl->gc_thresh3 ||
(entries > tbl->gc_thresh2 &&
--yoshfuji
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [NET] Move local_bh_disable back in dev_queue_xmit, Ingo Molnar |
|---|---|
| Next by Date: | Re: [NET] Fix neighbour tbl->entries race, Herbert Xu |
| Previous by Thread: | Re: [NET] Fix neighbour tbl->entries race, David S. Miller |
| Next by Thread: | Re: [NET] Fix neighbour tbl->entries race, Herbert Xu |
| Indexes: | [Date] [Thread] [Top] [All Lists] |