2009-05-16 13:54:52     slab and custom kernel drivers

Document created by Aaronwu Employee on Aug 15, 2013
Version 1Show Document
  • View in full screen mode

2009-05-16 13:54:52     slab and custom kernel drivers

Jan Kowalski (POLAND)

Message: 74131   

 

Hi,

 

I am in the middle of kernel driver development and now I have a problem with slab. I do not know how to handle slab inside my kernel driver and when remove it from memory and try to ifconfig eth0 10.12.13.2 up I got kernel panic with info failure mm/slab.c 2890 cache alloc refill().

 

Definetly it is my driver problem but I need same source of knowledge how to properly use slab inside kernel module.

 

 

 

Please advise

 

Regards

 

Marek

QuoteReplyEditDelete

 

 

2009-05-16 14:27:57     Re: slab and custom kernel drivers

Mike Frysinger (UNITED STATES)

Message: 74132   

 

your driver shouldnt have to worry about the memory implementation being used.  you should just being using kmalloc/kfree like normal.

QuoteReplyEditDelete

 

 

2009-05-16 14:41:47     Re: slab and custom kernel drivers

Jan Kowalski (POLAND)

Message: 74133   

 

Thanks for prompt reply,  the driver is OK with  kmalloc and kfree and unfortunately I got a problem with slab, when I cat /proc/slabinfo before and after using my kernel-user space couple I see a lot of s... still existing in cache area without any reason.

 

Regards

 

Marek

QuoteReplyEditDelete

 

 

2009-05-16 15:12:03     Re: slab and custom kernel drivers

Mike Frysinger (UNITED STATES)

Message: 74134   

 

a lot of what ?  i dont know what "s..." means.

QuoteReplyEditDelete

 

 

2009-05-17 05:00:26     Re: slab and custom kernel drivers

Jan Kowalski (POLAND)

Message: 74158   

 

here is part of slabinfo after test

 

bio 2 59 64 59 1 : tunables 120 60 0 : sl0

 

I do apologize I wasnt exact in my last post.

 

Best Regards

 

Marek

 

 

 

sock_inode_cache 14 24 320 12 1 : tunables 54 27 0 : sl0

 

skbuff_fclone_cache 0 0 320 12 1 : tunables 54 27 0 : 0

 

skbuff_head_cache 4294967253 24 160 24 1 : tunables 120 60 0 0

 

file_lock_cache 0 0 92 42 1 : tunables 120 60 0 : sl0

QuoteReplyEditDelete

 

 

2009-05-17 12:42:43     Re: slab and custom kernel drivers

Mike Frysinger (UNITED STATES)

Message: 74161   

 

and are there problems if you use the unmodified network driver ?  that suggests that something is using the cache incorrectly.  the memory implementation probably wouldnt fix that.

QuoteReplyEditDelete

 

 

2009-05-18 10:08:40     Re: slab and custom kernel drivers

Jan Kowalski (POLAND)

Message: 74196   

 

exactly I'm using netlink to transmit data from kernel to usr space. This transmison and driver workes perfect with exception to last step rmmod and a specially to ifconfig eth0 10.12.12.2 up after it I got slab failure and kernel panic.

Attachments

    Outcomes