linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mdadm memory leak?
@ 2005-07-05  4:24 David Kowis
  2005-07-05  4:30 ` David Kowis
  2005-07-05  4:57 ` Neil Brown
  0 siblings, 2 replies; 20+ messages in thread
From: David Kowis @ 2005-07-05  4:24 UTC (permalink / raw)
  To: linux-raid; +Cc: Eric Sandall

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm not entirely sure if this is mdadm's fault, but I cannot find anything else that would cause the problem, since mdadm is the only new
thing and I'm pretty sure it's not 2.6.11.12's fault. Anyways, on to my issue:
I'm running samba, apache2, mysql, postgresql, and a few other things. I've got an Athlon-XP 1700+ with 768Mb RAM. Right after startup I've
got about 600Mb of free memory, and as time progresses, and I use samba for things (playing an MP3,) my amount of free memory declines
rather rapidly. It hovers around 8Mb of free ram, with no swap usage. The computer has bogged down bad enough that oom-killer has had to
kill just about everything. ps and top don't show anything eating up all my memory. I'm very impressed with mdadm and I'd like to keep using
it, but i'd also like to have a bit of free memory on my computer. I'm using an XFS file system on a 200Gb mirrored RAID array, two drives,
on seperate IDE channels (seperate cables.)
Thanks for your time,
- --
David Kowis

ISO Team Lead - www.sourcemage.org
SourceMage GNU/Linux

One login to rule them all, one login to find them. One login to bring them all, and in the web bind them.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFCygt+tgErhgxHMHsRAqr+AJ9BtFcFXGKJtE7Ec5mZ25rRn7SD0ACePwzo
C86x7ogIqvFbtQRsgUZihwg=
=gX4c
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 20+ messages in thread
* RE: mdadm memory leak?
@ 2005-07-06 16:09 Bailey, Scott
  0 siblings, 0 replies; 20+ messages in thread
From: Bailey, Scott @ 2005-07-06 16:09 UTC (permalink / raw)
  To: Neil Brown, Eric Sandall; +Cc: David Kowis, linux-raid

>diff -Nru a/drivers/md/md.c b/drivers/md/md.c
>--- a/drivers/md/md.c	2005-01-22 00:16:02 -08:00
>+++ b/drivers/md/md.c	2005-01-22 00:16:02 -08:00
>@@ -332,29 +332,26 @@
> static int sync_page_io(struct block_device *bdev, sector_t sector,
int size,
> 		   struct page *page, int rw)
> {
>-	struct bio bio;
>-	struct bio_vec vec;
>+	struct bio *bio = bio_alloc(GFP_KERNEL, 1);
> 	struct completion event;
>+	int ret;
>+
>+	bio_get(bio);
>....
>+	bio_put(bio);
>+	return ret;
> }
>
>bio_alloc sets the refcount to 1.
>bio_get increments it to 2.
>bio_put sets it back to 1.  But it never reaches zero.
>
>You want to get rid of that bio_get near the top of sync_page_io.

I had been wondering why my Alphaserver running Debian kernel 2.6.10-5
had been OOMing every week or so. :-) When I started reading this
thread, nearly a week since the last reboot, I found I had more than 3GB
of memory tied up in bio and biovec-1 slab. (!)

With the offending "bio_get(bio);" removed as described above, the
system is looking much better. With unpatched kernel, I rebooted system
and started synchronization of 9GB RAID-1 drive - at completion, the bio
slab had grown to something like 15,000+ entries. With patched kernel, I
rebooted and am doing another RAID-1 rebuild now - with that about 50%
complete, there are only 992 bio entries. (And only half of those are in
use - this never went below 99% before.)

Many thanks,

	Scott Bailey
	scott.bailey@eds.com

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

end of thread, other threads:[~2005-07-17  4:52 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-05  4:24 mdadm memory leak? David Kowis
2005-07-05  4:30 ` David Kowis
2005-07-05  4:59   ` Guy
2005-07-05 15:49     ` Eric Sandall
2005-07-05 15:56     ` David Kowis
2005-07-05  4:57 ` Neil Brown
2005-07-05 15:36   ` Eric Sandall
2005-07-05 21:08     ` Neil Brown
2005-07-05 22:04       ` Eric Sandall
2005-07-06  1:30         ` Neil Brown
2005-07-09 20:11           ` Eric Sandall
2005-07-17  4:52           ` Eric Sandall
2005-07-05 15:52   ` David Kowis
2005-07-05 21:23     ` Neil Brown
2005-07-05 21:50       ` David Kowis
2005-07-08 22:04       ` David Kowis
2005-07-08 23:15         ` Tyler
2005-07-09  4:20           ` David Kowis
2005-07-05 21:41   ` David Kowis
  -- strict thread matches above, loose matches on Subject: below --
2005-07-06 16:09 Bailey, Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).