From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next-2.6] pkt_sched: gen_estimator: kill est_lock rwlock Date: Mon, 07 Jun 2010 17:30:38 +0200 Message-ID: <1275924638.2545.121.camel@edumazet-laptop> References: <1275921171.2545.102.camel@edumazet-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: David Miller , netdev , Stephen Hemminger , Jarek Poplawski To: Changli Gao Return-path: Received: from mail-ww0-f46.google.com ([74.125.82.46]:50268 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751400Ab0FGPan (ORCPT ); Mon, 7 Jun 2010 11:30:43 -0400 Received: by wwe15 with SMTP id 15so499482wwe.19 for ; Mon, 07 Jun 2010 08:30:42 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Le lundi 07 juin 2010 =C3=A0 22:53 +0800, Changli Gao a =C3=A9crit : > Hmm. I don't think it is correct. >=20 > Look at this code: >=20 > void xt_rateest_put(struct xt_rateest *est) > { > mutex_lock(&xt_rateest_mutex); > if (--est->refcnt =3D=3D 0) { > hlist_del(&est->list); > gen_kill_estimator(&est->bstats, &est->rstats); > kfree(est); > } > mutex_unlock(&xt_rateest_mutex); > } >=20 > est will be released after gen_kill_estimator() returns. After est is > freed, there may still be some other CPUs running in the branch: > if (bstats) { > .... > } >=20 Oh well, I think I knew this from a previous attempt, but then I forgot :) I'll provide an updated patch, so that no other attempt is tried next yer, thanks !