The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: john stultz <johnstul@us.ibm.com>,
	Gunter Ohrner <G.Ohrner@post.rwth-aachen.de>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.15-rc5-rt2 slowness
Date: Fri, 16 Dec 2005 22:33:20 -0500	[thread overview]
Message-ID: <1134790400.13138.160.camel@localhost.localdomain> (raw)
In-Reply-To: <dnu8ku$ie4$1@sea.gmane.org>

Ingo,

After searching all over to find out where the slowness is, I finally
discovered it.  It's the SLOB!

I noticed a that a make install of the kernel over NFS took on
2.6.15-rc5 ~26 seconds to complete, and on 2.6.15-rc5-rt2 it took almost
2 minutes for the same operation on the same machine.

I added my logdev device to record lots of output, and it found the
place that is taking the longest:

In 2.6.15-rc5-rt2:

[  789.171773] cpu:0 kfree_skbmem:291 in
[  789.171873] cpu:0 kfree_skbmem:295 1
[  789.172357] cpu:0 kfree_skbmem:320 out

in 2.6.15-rc5:

[  343.253988] cpu:0 kfree_skbmem:291 in
[  343.253990] cpu:0 kfree_skbmem:295 1
[  343.253991] cpu:0 kfree_skbmem:320 out

Here's the code for both systems (they are identical here):

void kfree_skbmem(struct sk_buff *skb)
{
	struct sk_buff *other;
	atomic_t *fclone_ref;

	edprint("in");
	skb_release_data(skb);
	switch (skb->fclone) {
	case SKB_FCLONE_UNAVAILABLE:
	edprint("1");
		kmem_cache_free(skbuff_head_cache, skb);
		break;

	case SKB_FCLONE_ORIG:
	edprint("2");
		fclone_ref = (atomic_t *) (skb + 2);
		if (atomic_dec_and_test(fclone_ref))
			kmem_cache_free(skbuff_fclone_cache, skb);
		break;

	case SKB_FCLONE_CLONE:
	edprint("3");
		fclone_ref = (atomic_t *) (skb + 1);
		other = skb - 1;

		/* The clone portion is available for
		 * fast-cloning again.
		 */
		skb->fclone = SKB_FCLONE_UNAVAILABLE;

		if (atomic_dec_and_test(fclone_ref))
			kmem_cache_free(skbuff_fclone_cache, other);
		break;
	};
	edprint("out");
}

My edprint records in a ring buffer (much like relayfs), and produces
the above output.  The time in brackets is in seconds. We see the
difference between "1" and "out" is greatly different.  (Note, I have a
edprint in all interrupts, so I would know if one was taken, and these
times are not a one time deal, but show up like this every time).

So for 2.6.15-rc5 the time difference is 343.253991 - 343.253990 or
1 usec, where as the time for 2.6.15-rc5-rt2 is 789.172357 - 789.171873
or 484 usecs!  We're talking about a 48,400% increase here!

The difference here is that the kmem_cache_free in rt is a SLOB where as
the vanilla kernel still uses SLABs,  What's the rational for SLOB now?

The patches used are here:

For the logdev device:
http://www.kihontech.com/logdev/logdev-2.6.15-rc5-rt2.patch
http://www.kihontech.com/logdev/logdev-2.6.15-rc5.patch

For debugging (on top of logdev):
http://www.kihontech.com/logdev/debug-2.6.15-rc5-rt2.patch
http://www.kihontech.com/logdev/debug-2.6.15-rc5.patch

(I also added my patches previously posted to get it to compile and
handle the softirq hrtimer problems).

Thanks,

-- Steve



  parent reply	other threads:[~2005-12-17  3:33 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-16 11:30 2.6.15-rc5-rt2 slowness Gunter Ohrner
2005-12-16 11:42 ` Gunter Ohrner
2005-12-16 12:04   ` Gunter Ohrner
2005-12-16 12:34   ` Steven Rostedt
2005-12-16 12:32 ` Steven Rostedt
2005-12-16 22:58   ` john stultz
2005-12-17  0:22     ` Gunter Ohrner
2005-12-17  3:51     ` Steven Rostedt
2005-12-17  3:33 ` Steven Rostedt [this message]
2005-12-17 22:57   ` Steven Rostedt
2005-12-18 16:05     ` K.R. Foley
2005-12-20 13:32     ` Ingo Molnar
2005-12-20 13:38       ` Steven Rostedt
2005-12-20 13:57         ` Ingo Molnar
2005-12-20 14:04           ` Steven Rostedt
2005-12-20 14:33             ` Steven Rostedt
2005-12-20 15:07               ` Ingo Molnar
2005-12-20 15:16                 ` Steven Rostedt
2005-12-20 15:44             ` [PATCH RT 00/02] SLOB optimizations Steven Rostedt
2005-12-20 15:56               ` Steven Rostedt
2005-12-20 15:58                 ` Ingo Molnar
2005-12-20 16:13               ` Ingo Molnar
2005-12-20 16:29                 ` Steven Rostedt
2005-12-20 16:39                   ` Steven Rostedt
2005-12-20 18:19               ` Matt Mackall
2005-12-20 19:15                 ` Steven Rostedt
2005-12-20 19:43                   ` Matt Mackall
2005-12-20 20:06                     ` Steven Rostedt
2005-12-20 20:15                   ` Pekka Enberg
2005-12-20 21:42                     ` Steven Rostedt
2005-12-20 21:52                       ` Christoph Lameter
2005-12-20 22:11                         ` Steven Rostedt
2005-12-21  6:36                           ` Ingo Molnar
2005-12-21 12:50                             ` Steven Rostedt
2005-12-21  6:56                       ` Ingo Molnar
2005-12-21  7:16                         ` Pekka J Enberg
2005-12-21  7:50                           ` Ingo Molnar
2005-12-21 13:13                           ` Steven Rostedt
2005-12-21 15:34                             ` [PATCH] SLAB - have index_of bug at compile time Steven Rostedt
2005-12-21  7:20                         ` [PATCH RT 00/02] SLOB optimizations Eric Dumazet
2005-12-21  7:43                           ` Ingo Molnar
2005-12-21  8:02                             ` Eric Dumazet
2005-12-22 18:02                               ` Zwane Mwaikambo
2005-12-22 21:11                               ` Ingo Molnar
2005-12-22 21:39                                 ` Eric Dumazet
2005-12-22 21:44                                 ` George Anzinger
2005-12-22 22:00                                   ` Eric Dumazet
2005-12-22 22:08                                 ` Eric Dumazet
2005-12-23 19:22                                   ` Zwane Mwaikambo
2005-12-21 13:02                         ` Steven Rostedt
2005-12-21  2:30                   ` Nick Piggin
2005-12-21  2:41                     ` Steven Rostedt
2005-12-20 15:44             ` [PATCH RT 01/02] SLOB - remove bigblock list Steven Rostedt
2005-12-20 15:44             ` [PATCH RT 02/02] SLOB - break SLOB up by caches Steven Rostedt
2005-12-20 14:07           ` 2.6.15-rc5-rt2 slowness Steven Rostedt
2005-12-20 15:26           ` K.R. Foley

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=1134790400.13138.160.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=G.Ohrner@post.rwth-aachen.de \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox