From: Stephan von Krawczynski <skraw@ithnet.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: willy@w.ods.org, gibbs@scsiguy.com, marcelo@conectiva.com.br,
green@namesys.com
Subject: Re: Undo aic7xxx changes (now rc7+aic20030603)
Date: Sun, 8 Jun 2003 13:19:01 +0200 [thread overview]
Message-ID: <20030608131901.7cadf9ea.skraw@ithnet.com> (raw)
In-Reply-To: <20030605181423.GA17277@alpha.home.local>
Hello all,
looking at code around my problem I discovered this:
static inline void * __kmem_cache_alloc (kmem_cache_t *cachep, int flags)
{
unsigned long save_flags;
void* objp;
kmem_cache_alloc_head(cachep, flags);
try_again:
local_irq_save(save_flags);
#ifdef CONFIG_SMP
{
cpucache_t *cc = cc_data(cachep);
if (cc) {
if (cc->avail) {
STATS_INC_ALLOCHIT(cachep);
objp = cc_entry(cc)[--cc->avail];
} else {
STATS_INC_ALLOCMISS(cachep);
objp = kmem_cache_alloc_batch(cachep,cc,flags);
if (!objp)
goto alloc_new_slab_nolock;
}
} else {
spin_lock(&cachep->spinlock);
objp = kmem_cache_alloc_one(cachep);
spin_unlock(&cachep->spinlock);
}
}
#else
objp = kmem_cache_alloc_one(cachep);
#endif
local_irq_restore(save_flags);
return objp;
alloc_new_slab:
#ifdef CONFIG_SMP
spin_unlock(&cachep->spinlock);
alloc_new_slab_nolock:
#endif
local_irq_restore(save_flags);
if (kmem_cache_grow(cachep, flags))
/* Someone may have stolen our objs. Doesn't matter, we'll
* just come back here again.
*/
goto try_again;
return NULL;
}
I suggest it for most-absurd-goto-usage-award.
1) There seems to be no reference for symbol "alloc_new_slab"
2) "spin_unlock" (right below) is never reached
3) The not-ifdef'ed code below is only used if CONFIG_SMP
4) The code "alloc_new_slab_nolock" is referenced only once by a goto
(why not simply pasted there?)
This does not look like a problem, it only is damn ugly. I have no idea
what this code actually does, but it looks patched-to-the-limit. Has
anybody reviewed slab regarding CONFIG_SMP?
Regards,
Stephan
next prev parent reply other threads:[~2003-06-08 11:05 UTC|newest]
Thread overview: 110+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-07 20:22 Undo aic7xxx changes Marcelo Tosatti
2003-05-09 0:45 ` Justin T. Gibbs
2003-05-09 10:06 ` Stephan von Krawczynski
2003-05-09 12:06 ` Willy Tarreau
2003-05-09 13:02 ` Stephan von Krawczynski
2003-05-09 13:27 ` Willy Tarreau
2003-05-09 13:46 ` Stephan von Krawczynski
2003-05-09 14:56 ` Willy Tarreau
2003-05-09 15:08 ` Arjan van de Ven
2003-05-09 16:27 ` Willy Tarreau
2003-05-09 15:18 ` Andreas Schwab
2003-05-09 15:19 ` William Lee Irwin III
2003-05-09 14:11 ` Stephan von Krawczynski
2003-05-09 14:57 ` Willy Tarreau
2003-05-12 9:02 ` Stephan von Krawczynski
2003-05-12 15:43 ` Marc-Christian Petersen
2003-05-12 17:25 ` Willy Tarreau
2003-05-23 10:38 ` Stephan von Krawczynski
2003-05-23 12:58 ` Justin T. Gibbs
2003-05-23 13:11 ` Stephan von Krawczynski
2003-05-23 19:57 ` Willy Tarreau
2003-05-24 10:52 ` Stephan von Krawczynski
2003-05-24 11:16 ` Willy Tarreau
2003-05-25 10:58 ` Stephan von Krawczynski
2003-05-25 12:35 ` Willy TARREAU
2003-05-25 12:47 ` Marc-Christian Petersen
2003-05-25 13:50 ` Stephan von Krawczynski
2003-05-25 14:01 ` Marc-Christian Petersen
2003-05-25 14:03 ` Geller Sandor
2003-05-26 15:00 ` Stephan von Krawczynski
2003-05-26 16:44 ` Willy Tarreau
2003-05-30 8:09 ` Stephan von Krawczynski
2003-05-30 8:19 ` Marc-Christian Petersen
2003-05-30 8:21 ` Arjan van de Ven
2003-05-30 8:51 ` Stephan von Krawczynski
2003-05-30 13:34 ` Jeff Garzik
2003-05-30 13:59 ` Stephan von Krawczynski
2003-05-30 13:35 ` Jeff Garzik
2003-05-25 18:30 ` Justin T. Gibbs
2003-06-05 15:05 ` Undo aic7xxx changes (now rc7+aic20030603) Stephan von Krawczynski
2003-06-05 18:14 ` Willy Tarreau
2003-06-06 8:17 ` Oleg Drokin
2003-06-06 9:04 ` Stephan von Krawczynski
2003-06-06 9:17 ` Oleg Drokin
2003-06-06 15:24 ` short freezing while file re-creation Stephan von Krawczynski
2003-06-06 16:02 ` Oleg Drokin
2003-06-06 19:00 ` Chris Mason
2003-06-06 19:10 ` Oleg Drokin
2003-06-06 19:20 ` Chris Mason
2003-06-08 10:15 ` Undo aic7xxx changes (now rc7+aic20030603) Stephan von Krawczynski
2003-06-08 11:19 ` Stephan von Krawczynski [this message]
2003-06-08 11:49 ` Stephan von Krawczynski
2003-06-08 16:07 ` Stephan von Krawczynski
2003-06-09 15:10 ` Stephan von Krawczynski
2003-06-09 15:32 ` Justin T. Gibbs
2003-06-10 10:23 ` Stephan von Krawczynski
2003-06-10 15:38 ` Justin T. Gibbs
2003-06-10 17:11 ` Stephan von Krawczynski
2003-06-10 18:07 ` Justin T. Gibbs
2003-06-11 0:51 ` Stephan von Krawczynski
2003-06-11 4:39 ` Justin T. Gibbs
2003-06-11 20:23 ` Stephan von Krawczynski
2003-06-11 21:01 ` John Stoffel
2003-06-13 9:45 ` Stephan von Krawczynski
2003-06-15 12:56 ` Stephan von Krawczynski
2003-06-15 13:26 ` John Stoffel
2003-06-17 20:47 ` Marcelo Tosatti
2003-06-18 11:05 ` Stephan von Krawczynski
2003-06-18 14:21 ` John Stoffel
2003-06-18 14:54 ` Stephan von Krawczynski
2003-06-20 19:59 ` Marcelo Tosatti
2003-06-20 20:59 ` Kevin P. Fleming
2003-06-20 21:13 ` Marcelo Tosatti
2003-06-20 22:03 ` Willy Tarreau
2003-06-20 23:48 ` Stephan von Krawczynski
2003-06-21 10:50 ` Willy TARREAU
2003-06-22 19:00 ` Stephan von Krawczynski
2003-06-23 11:30 ` Stephan von Krawczynski
2003-06-24 11:11 ` Stephan von Krawczynski
2003-06-24 17:43 ` Willy Tarreau
2003-06-24 21:26 ` Stephan von Krawczynski
2003-06-24 22:03 ` Willy Tarreau
2003-06-24 23:43 ` Stephan von Krawczynski
2003-06-25 19:16 ` Willy Tarreau
2003-06-25 19:42 ` Stephan von Krawczynski
2003-06-25 20:30 ` John Stoffel
2003-06-26 9:36 ` Stephan von Krawczynski
2003-06-26 11:34 ` Stephan von Krawczynski
2003-06-30 10:10 ` Stephan von Krawczynski
2003-06-30 11:39 ` Marcelo Tosatti
2003-06-30 12:08 ` Stephan von Krawczynski
2003-06-25 23:04 ` Bernd Eckenfels
2003-06-25 2:22 ` Valdis.Kletnieks
2003-06-24 18:31 ` Bill Davidsen
2003-06-12 13:54 ` Stephan von Krawczynski
2003-06-10 1:38 ` Zwane Mwaikambo
2003-06-10 10:30 ` Stephan von Krawczynski
2003-06-10 12:51 ` Zwane Mwaikambo
2003-06-10 13:38 ` Stephan von Krawczynski
2003-06-10 13:51 ` Zwane Mwaikambo
2003-06-10 15:55 ` Stephan von Krawczynski
2003-06-10 16:23 ` Oleg Drokin
2003-06-10 17:44 ` Stephan von Krawczynski
2003-06-10 18:15 ` Zwane Mwaikambo
2003-06-10 23:55 ` Stephan von Krawczynski
2003-06-10 18:20 ` Zwane Mwaikambo
2003-05-23 18:30 ` Undo aic7xxx changes Marcelo Tosatti
2003-05-23 19:25 ` Stephan von Krawczynski
[not found] <20030507203025$6f60@gated-at.bofh.it>
[not found] ` <20030509005011$6cee@gated-at.bofh.it>
[not found] ` <20030509101012$732a@gated-at.bofh.it>
[not found] ` <20030509122007$758f@gated-at.bofh.it>
[not found] ` <20030509131009$00f3@gated-at.bofh.it>
[not found] ` <20030611045008$03cf@gated-at.bofh.it>
[not found] ` <20030611203031$12de@gated-at.bofh.it>
[not found] ` <20030611211012$34cf@gated-at.bofh.it>
[not found] ` <20030613095017$1680@gated-at.bofh.it>
[not found] ` <20030617210022$3e37@gated-at.bofh.it>
[not found] ` <20030618111010$154f@gated-at.bofh.it>
2003-06-18 12:46 ` Undo aic7xxx changes (now rc7+aic20030603) Pascal Schmidt
2003-06-18 12:49 ` Stephan von Krawczynski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030608131901.7cadf9ea.skraw@ithnet.com \
--to=skraw@ithnet.com \
--cc=gibbs@scsiguy.com \
--cc=green@namesys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=willy@w.ods.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.