[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1305305190.3866.57.camel@edumazet-laptop>
Date: Fri, 13 May 2011 18:46:30 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Shaohua Li <shaohua.li@...el.com>
Cc: Tejun Heo <tj@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"cl@...ux.com" <cl@...ux.com>,
"npiggin@...nel.dk" <npiggin@...nel.dk>
Subject: Re: [patch V2] percpu_counter: scalability works
Le vendredi 13 mai 2011 à 18:35 +0200, Eric Dumazet a écrit :
If you want to try this patch, please note I missed in
__percpu_counter_init() :
fbc->sum_cnt = 0;
> int __percpu_counter_init(struct percpu_counter *fbc, s64 amount,
> struct lock_class_key *key)
> {
> - spin_lock_init(&fbc->lock);
> - lockdep_set_class(&fbc->lock, key);
> - fbc->count = amount;
> + struct percpu_counter_rw *pcrw;
> +
> + pcrw = kzalloc(sizeof(*pcrw), GFP_KERNEL);
> + if (!pcrw)
> + return -ENOMEM;
> + atomic64_set(&pcrw->count, amount);
> +
> fbc->counters = alloc_percpu(s32);
> - if (!fbc->counters)
> + if (!fbc->counters) {
> + kfree(pcrw);
> return -ENOMEM;
> + }
> + fbc->pcrw = pcrw;
fbc->sum_cnt = 0;
>
> debug_percpu_counter_activate(fbc);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists