From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Berthier Subject: memory leak while reading /proc/scsi/gdth/1 Date: Wed, 28 Apr 2004 04:10:04 -0700 (PDT) Sender: linux-scsi-owner@vger.kernel.org Message-ID: <20040428111004.78451.qmail@web41208.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from web41208.mail.yahoo.com ([66.218.93.41]:44681 "HELO web41208.mail.yahoo.com") by vger.kernel.org with SMTP id S264029AbUD1LKG (ORCPT ); Wed, 28 Apr 2004 07:10:06 -0400 List-Id: linux-scsi@vger.kernel.org To: linux-scsi@vger.kernel.org Dear Linux-SCSI people, I noticed a bug in the driver for GDT controler. It seems to me to be a kind of memory leak, but I am not an expert. Here is my bug report. Pierre [1.] One line summary of the problem: 'cat /proc/scsi/gdth/1' prints two "__alloc_pages: 0-order allocation failed (gfp=0x21/0)" lines in the log. [2.] Full description of the problem/report: I am reading every two minutes the content of '/proc/scsi/gdth/1' to produce a 'status report' of my server. After doing a 'cat /proc/scsi/gdth/1' ~3300 times without problem, each subsequent call prints two lines "__alloc_pages: 0-order allocation failed (gfp=0x21/0)" in the log. In this case, the result is only: # cat /proc/scsi/gdth/1 Driver Parameters: reserve_mode: 1 reserve_list: -- max_ids: 127 hdr_channel: 0 Disk Array Controller Information: Number: 0 Name: GDT6513RS Driver Ver.: 2.05 Firmware Ver.: 2.28.02-R044 Serial No.: 0x44C175F1 Cache RAM size: 131072 KB Physical Devices: without the list of disks, volumes, etc. During this, the machine works as good as usually. After the log message appears, if one goes on reading the proc file ~1000 times, the machine finally hangs. The problem arises using kernel from 2.4.23 to 2.4.26. No problems with kernel 2.4.21 (uptime up to 100+ days) -- at least no messages in the log, I think that I remember that the output was also disappearing after some time. I did not try 2.4.22. [3.] Keywords (i.e., modules, networking, kernel): proc, gdth, memory leak [4.] Kernel version (from /proc/version): Linux version 2.4.26-1 (root@zooblythii) (gcc version 2.95.3 20010315 (release)) #1 SMP Mon Apr 19 11:06:23 CEST 2004 [5.] Output of Oops.. message (if applicable) with symbolic information resolved (see Documentation/oops-tracing.txt) [6.] A small shell script or example program which triggers the problem (if possible) read enough times '/proc/scsi/gdth/1'. I suppose it depends on the amount of memory of the machine? On mine, it needs ~3300 reads to trigger the problem. [7.] Environment [7.1.] Software (add the output of the ver_linux script here) If some fields are empty or look unusual you may have an old version. Compare to the current minimal requirements in Documentation/Changes. Linux zooblythii 2.4.26-1 #1 SMP Mon Apr 19 11:06:23 CEST 2004 i686 unknown Gnu C 2.95.3 Gnu make 3.79.1 util-linux 2.11r mount 2.11r modutils 2.4.6 e2fsprogs 1.34 PPP 2.4.1 Linux C Library 2.2.5 Dynamic linker (ldd) 2.2.5 Procps 3.1.13 Net-tools 1.60 Kbd 1.06 Sh-utils 2.0 Modules Loaded nfs i2c-proc i2c-core appletalk nfsd lockd sunrpc ipt_state ipt_LOG ipt_limit iptable_nat iptable_filter ip_conntrack_ftp ip_conntrack ip_tables binfmt_misc binfmt_aout bcm5700 lp parport_pc parport rtc [7.2.] Processor information (from /proc/cpuinfo): # cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Xeon(TM) CPU 2.80GHz stepping : 7 cpu MHz : 2791.038 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid bogomips : 5570.56 processor : 1 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Xeon(TM) CPU 2.80GHz stepping : 7 cpu MHz : 2791.038 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid bogomips : 5570.56 [7.3.] Module information (from /proc/modules): # cat /proc/modules nfs 68016 1 (autoclean) i2c-proc 6016 0 i2c-core 14832 0 [i2c-proc] appletalk 23088 13 nfsd 67632 200 lockd 48416 1 [nfs nfsd] sunrpc 67808 1 [nfs nfsd lockd] ipt_state 608 194 (autoclean) ipt_LOG 3376 6 (autoclean) ipt_limit 1072 7 (autoclean) iptable_nat 17616 1 (autoclean) iptable_filter 1760 1 (autoclean) ip_conntrack_ftp 3936 0 (unused) ip_conntrack 21840 1 [ipt_state iptable_nat ip_conntrack_ftp] ip_tables 12192 7 [ipt_state ipt_LOG ipt_limit iptable_nat iptable_filter] binfmt_misc 5952 1 binfmt_aout 4064 0 bcm5700 88912 2 lp 6208 0 (unused) parport_pc 11984 1 parport 15360 1 [lp parport_pc] rtc 6720 0 (autoclean) [7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) # cat /proc/ioports 0000-001f : dma1 0020-003f : pic1 0040-005f : timer 0060-006f : keyboard 0070-007f : rtc 0080-008f : dma page reg 00a0-00bf : pic2 00c0-00df : dma2 00f0-00ff : fpu 02f8-02ff : serial(auto) 0378-037a : parport0 03a0-03af : Intel Corp. 82801CA Ultra ATA Storage Controller 03a0-03a7 : ide0 03a8-03af : ide1 03c0-03df : vga+ 03f8-03ff : serial(auto) 0580-059f : Intel Corp. 82801CA/CAM SMBus Controller 0cf8-0cff : PCI conf1 1000-10ff : ATI Technologies Inc Rage XL 1400-14ff : Adaptec AHA-7850 2000-2fff : PCI Bus #02 2000-2fff : PCI Bus #04 2000-203f : Intel Corp. 82546EB Gigabit Ethernet Controller (Copper) (#2) 2040-207f : Intel Corp. 82546EB Gigabit Ethernet Controller (Copper) 3000-301f : Intel Corp. 82801CA/CAM USB (Hub #3) 3020-303f : Intel Corp. 82801CA/CAM USB (Hub #2) 3040-305f : Intel Corp. 82801CA/CAM USB (Hub #1) # cat /proc/iomem 00000000-0009efff : System RAM 0009f000-0009ffff : reserved 000a0000-000bffff : Video RAM area 000c0000-000c7fff : Video ROM 000c8000-000c97ff : Extension ROM 000c9800-000cafff : Extension ROM 000cb000-000cfbff : Extension ROM 000f0000-000fffff : System ROM 00100000-3ffeffff : System RAM 00100000-0025755a : Kernel code 0025755b-002f6bff : Kernel data 3fff0000-3fffefff : ACPI Tables 3ffff000-3fffffff : ACPI Non-volatile Storage 40000000-400003ff : Intel Corp. 82801CA Ultra ATA Storage Controller fc7f0000-fc7f3fff : ICP Vortex Computersysteme GmbH GDT 6113RS/6513RS fd000000-fdffffff : ATI Technologies Inc Rage XL fe5f0000-fe5f0fff : ATI Technologies Inc Rage XL fe6f0000-fe6f0fff : Adaptec AHA-7850 fe6f0000-fe6f0fff : aic7xxx fe900000-febfffff : PCI Bus #02 fe900000-fe9fffff : PCI Bus #03 fe9f0000-fe9fffff : Broadcom Corporation NetXtreme BCM5701 Gigabit Ethernet (#2) fe9f0000-fe9fffff : bcm5700 fea00000-feafffff : PCI Bus #04 fea60000-fea7ffff : Intel Corp. 82546EB Gigabit Ethernet Controller (Copper) fea80000-fea9ffff : Intel Corp. 82546EB Gigabit Ethernet Controller (Copper) (#2) feaf0000-feafffff : Broadcom Corporation NetXtreme BCM5701 Gigabit Ethernet feaf0000-feafffff : bcm5700 febe0000-febe0fff : Intel Corp. 82870P2 P64H2 I/OxAPIC febf0000-febf0fff : Intel Corp. 82870P2 P64H2 I/OxAPIC (#2) fec00000-fecfffff : reserved fee00000-fee00fff : reserved fff00000-ffffffff : reserved [7.5.] PCI information ('lspci -vvv' as root) 00:00.0 Host bridge: Intel Corporation: Unknown device 254c (rev 01) Subsystem: Intel Corporation: Unknown device 3424 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- SERR- TAbort- SERR- TAbort- SERR- Reset- FastB2B- 00:03.1 Class ff00: Intel Corporation: Unknown device 2546 (rev 01) Subsystem: Intel Corporation: Unknown device 3424 Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- Reset- FastB2B- 00:1f.0 ISA bridge: Intel Corporation: Unknown device 2480 (rev 02) Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- Region 1: I/O ports at Region 2: I/O ports at Region 3: I/O ports at Region 4: I/O ports at 03a0 [size=16] Region 5: Memory at 40000000 (32-bit, non-prefetchable) [size=1K] 00:1f.3 SMBus: Intel Corporation: Unknown device 2483 (rev 02) Subsystem: Intel Corporation: Unknown device 3424 Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- Reset- FastB2B- Capabilities: [50] #07 [0083] 02:1e.0 PIC: Intel Corporation: Unknown device 1461 (rev 04) (prog-if 20 [IO(X)-APIC]) Subsystem: Intel Corporation: Unknown device 3424 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- TAbort- SERR- Reset- FastB2B- Capabilities: [50] #07 [0083] 03:02.0 Ethernet controller: BROADCOM Corporation: Unknown device 1645 (rev 15) Subsystem: 3Com Corporation: Unknown device 1006 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR-