public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix leak with bounced bio's
@ 2004-09-09  8:42 Jens Axboe
  2004-09-09 14:34 ` Frank Steiner
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2004-09-09  8:42 UTC (permalink / raw)
  To: Linux Kernel

Hi,

This might fix the last leak of memory reported with cd writing, the
current highmem bounce code will leak n-1 pages for any n page bio where
n > 1. CD writing typically uses 16 pages bios, so it is affected.

===== mm/highmem.c 1.51 vs edited =====
--- 1.51/mm/highmem.c	2004-07-29 06:58:32 +02:00
+++ edited/mm/highmem.c	2004-09-08 21:18:57 +02:00
@@ -284,7 +284,7 @@
 	struct bio_vec *tovec, *fromvec;
 	int i;
 
-	bio_for_each_segment(tovec, to, i) {
+	__bio_for_each_segment(tovec, to, i, 0) {
 		fromvec = from->bi_io_vec + i;
 
 		/*
@@ -316,7 +316,7 @@
 	/*
 	 * free up bounce indirect pages used
 	 */
-	bio_for_each_segment(bvec, bio, i) {
+	__bio_for_each_segment(bvec, bio, i, 0) {
 		org_vec = bio_orig->bi_io_vec + i;
 		if (bvec->bv_page == org_vec->bv_page)
 			continue;

-- 
Jens Axboe


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

* Re: [PATCH] fix leak with bounced bio's
  2004-09-09  8:42 [PATCH] fix leak with bounced bio's Jens Axboe
@ 2004-09-09 14:34 ` Frank Steiner
  2004-09-09 14:36   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Steiner @ 2004-09-09 14:34 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Linux Kernel

Jens Axboe wrote:
> Hi,
> 
> This might fix the last leak of memory reported with cd writing, the
> current highmem bounce code will leak n-1 pages for any n page bio where
> n > 1. CD writing typically uses 16 pages bios, so it is affected.


it fixes the leak for us that I described a while back
http://marc.theaimsgroup.com/?l=linux-kernel&m=109360958318479&w=2

Great :-))

cu,
Frank

-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049


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

* Re: [PATCH] fix leak with bounced bio's
  2004-09-09 14:34 ` Frank Steiner
@ 2004-09-09 14:36   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2004-09-09 14:36 UTC (permalink / raw)
  To: Frank Steiner; +Cc: Linux Kernel

On Thu, Sep 09 2004, Frank Steiner wrote:
> Jens Axboe wrote:
> >Hi,
> >
> >This might fix the last leak of memory reported with cd writing, the
> >current highmem bounce code will leak n-1 pages for any n page bio where
> >n > 1. CD writing typically uses 16 pages bios, so it is affected.
> 
> 
> it fixes the leak for us that I described a while back
> http://marc.theaimsgroup.com/?l=linux-kernel&m=109360958318479&w=2
> 
> Great :-))

Great, thanks for confirming!

Maybe we should unconditionally bounce all bios for a while in a test
kernel, to make sure that all bouncing bugs are shaken out ;-)

-- 
Jens Axboe


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

end of thread, other threads:[~2004-09-09 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-09  8:42 [PATCH] fix leak with bounced bio's Jens Axboe
2004-09-09 14:34 ` Frank Steiner
2004-09-09 14:36   ` Jens Axboe

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