public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Allocation of sk_buffs in the kernel
@ 2001-08-23  9:01 Jens Hoffrichter
  2001-08-23  9:12 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Jens Hoffrichter @ 2001-08-23  9:01 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel

Hi,

> Maybe Jens should use something like WAITQUEUE_DEBUG if he want to know
> where alloc_skb and friends were called, see include/linux/wait.h 8)
Do you mean I should use something LIKE the WAITQUEUE_DEBUG (eg.
implementing something like that in skbuff.c) or I should use
WAITQUEUE_DEBUG?

The code in wait.h mainly seems to consist of issuing BUG() calls, and
thats not quite what I want to ;) But how is it to use? I don't know much
about waitqueues in the Linux kernel, I mainly played with the network
stack...

Are there any examples how to use the WAITQUEUE_DEBUG?

CU,
Jens


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Allocation of sk_buffs in the kernel
@ 2001-08-23  9:29 Jens Hoffrichter
  2001-08-23  9:46 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Jens Hoffrichter @ 2001-08-23  9:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel

> > > Maybe Jens should use something like WAITQUEUE_DEBUG if he want to
know
> > > where alloc_skb and friends were called, see include/linux/wait.h 8)
> > Do you mean I should use something LIKE the WAITQUEUE_DEBUG (eg.
> > implementing something like that in skbuff.c) or I should use
> > WAITQUEUE_DEBUG?
> no, just use the same idea that is used to debug wait_queues
OK, then I interpreted the code in wait.h right ;)

> > Are there any examples how to use the WAITQUEUE_DEBUG?

> oops, I mean the __waker thing, for debugging you could get the address
of
> the caller with current_text_addr() and store it in an extra sk_buff
field
> so that later on you could know who create the skb.
But where should I fill this field in the sk_buff? I know that alloc_skb
creates an sk_buff, so this would be of no use for me. Or do you mean to
add something like that to the initialization of the sk_buff struct, like a
"long allocator = current_text_addr()" in skbuff.h? Is something like this
possible? I'm not sure about it....

> About the example of WAITQUEUE_DEBUG:
>
> after being awaken you could do this:

>                 dprintk("sleeper=%p, waker=%lx\n",
>                          current_text_addr(), wait.__waker);

> in a inline function does the trick, but this is just an example of a
> function that uses an extra debug field in a structure that is alocated
> somewhere and you want to know who allocated it later on.

> Yes, you'll have to decode the address from syslog, gotcha?
But the __waker member is filled by a macro from wait.h, if I had seen it
right. Where would you issue such a dprintk call?

Sorry about my missing knowledge about wait queues, but I don't get the
point where to fill the member. That I could print it later on, thats
clear, but how to fill it?

CU,
Jens


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Allocation of sk_buffs in the kernel
@ 2001-08-23  9:07 Jens Hoffrichter
  0 siblings, 0 replies; 8+ messages in thread
From: Jens Hoffrichter @ 2001-08-23  9:07 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

> > I'm currently writing a kernel patch where it is essential to get
known>
> > when a sk_buff is allocated. Or better said I have to get known when a
> > sk_buff is effectively a new packet in the kernel-
>I don't want to guess why you need that...
I'm currently writing a stack profiler as my diploma thesis. It should give
a statistic how long a packet takes from one part of the network stack to
the other. So I have to watch the sk_buffs travelling through the kernel
and I need badly to know when they are allocated :) And, on top, the
deadline is in one week, and there are really strange things going on ;)

> > I currently identified 3 functions in the kernel where sk_buffs are
> > allocated: alloc_skb (of course), skb_linearize and pskb_expand_head.
Or at
> > least there new data is defined for the sk_buffs.
> >
> > Now I monitor a TCP session, a FTP download better said, and on the
> > interface arrives around 30000 packets for 50 MB of data. But in my
kernel
> > patch only 2000 packets are allocated, or at least I see only the
> > allocation of 2000 packets.
> >
> > Can anyone help me where I can find my missing packets? ;)) I need them
> > badly! *GG*

> There should be no skbuff allocation outside net/core/skbuff.c and all
> normal[1] networking drivers also don't use private pools. Perhaps
> you forgot to instrument a case there.
I have done some bit more testing yesterday, and the problem occurs in
either sending and receiving way, on two different ethernet drivers
(eepro100 and


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <OF55D2E221.5E62CB41-ONC1256AB0.0052D2D3@de.ibm.com.suse.lists.linux.kernel>]
* Allocation of sk_buffs in the kernel
@ 2001-08-22 15:10 Jens Hoffrichter
  0 siblings, 0 replies; 8+ messages in thread
From: Jens Hoffrichter @ 2001-08-22 15:10 UTC (permalink / raw)
  To: linux-kernel

Hello everyone,

I'm currently writing a kernel patch where it is essential to get known
when a sk_buff is allocated. Or better said I have to get known when a
sk_buff is effectively a new packet in the kernel-

I currently identified 3 functions in the kernel where sk_buffs are
allocated: alloc_skb (of course), skb_linearize and pskb_expand_head. Or at
least there new data is defined for the sk_buffs.

Now I monitor a TCP session, a FTP download better said, and on the
interface arrives around 30000 packets for 50 MB of data. But in my kernel
patch only 2000 packets are allocated, or at least I see only the
allocation of 2000 packets.

Can anyone help me where I can find my missing packets? ;)) I need them
badly! *GG*

It's not quite easy to look into the TCP code, because its quite big and a
bit complicated.....

Thanks in advance!

Regards,
Jens


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-08-23  9:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-23  9:01 Allocation of sk_buffs in the kernel Jens Hoffrichter
2001-08-23  9:12 ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2001-08-23  9:29 Jens Hoffrichter
2001-08-23  9:46 ` Arnaldo Carvalho de Melo
2001-08-23  9:07 Jens Hoffrichter
     [not found] <OF55D2E221.5E62CB41-ONC1256AB0.0052D2D3@de.ibm.com.suse.lists.linux.kernel>
2001-08-23  3:14 ` Andi Kleen
2001-08-23  3:42   ` Arnaldo Carvalho de Melo
2001-08-22 15:10 Jens Hoffrichter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox