[ofa-general] Re: [patch] fix SDP page leak in sdp_bz_cleanup

Amir Vadai amirv at mellanox.co.il
Wed Jul 1 06:02:17 PDT 2009


Hi Lars,

This is the right place for posting patches.

I will commit it ASAP into both branches.

-- 
Amir Vadai
Software Eng.
Mellanox Technologies
mailto: amirv at mellanox.co.il
Tel +972-3-6259539


On 07/01/2009 03:52 PM, Lars Ellenberg wrote:
> Hi there.
>
> Please direct me to the right place for posting patches
> and contacting developers, in case this is not it.
>
> A few days ago I started to try using SDP as DRBD replication transport.
> (http://www.drbd.org for those of you that do not know us yet)
>
> As block traffic naturally is mostly large messages (several pages),
> I noticed pretty quickly a large memory leak in SDP.
>
> I think I can pin it down on sdp_bz_cleanup not doing the put_page().
>
> patch against current ofed 1.5,
> also applies to the 1.4 branch.
>
> All the best,
>
> 	Lars
>
> from git://git.openfabrics.org/ofed_1_5/linux-2.6.git
>
> diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c
> index 8e1a6d7..1740408 100644
> --- a/drivers/infiniband/ulp/sdp/sdp_main.c
> +++ b/drivers/infiniband/ulp/sdp/sdp_main.c
> @@ -1368,7 +1368,8 @@ static inline struct bzcopy_state *sdp_bz_cleanup(struct bzcopy_state *bz)
>  	}
>  
>  	if (bz->pages) {
> -		for (i = bz->cur_page; i < bz->page_cnt; i++)
> +		/* match get_page() calls in sdp_bz_setup() */
> +		for (i = 0; i < bz->page_cnt; i++)
>  			put_page(bz->pages[i]);
>  
>  		kfree(bz->pages);
>
>
>
>   



More information about the general mailing list