From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 1 Mar 2010 06:59:55 +0100 From: Andrew Lunn Message-ID: <20100301055955.GC15286@lunn.ch> References: <20100123174616.GA4795@Sellars> <20100126061311.GA12697@Sellars> <20100129082545.GI7844@lunn.ch> <201001291659.59677.lindner_marek@yahoo.de> <20100130165059.GV24649@lunn.ch> <20100211094659.GH2900@lunn.ch> <20100211100156.GI2900@lunn.ch> <20100228163428.GA15370@pandem0nium> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100228163428.GA15370@pandem0nium> Subject: Re: [B.A.T.M.A.N.] slowpath warning Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: The list for a Better Approach To Mobile Ad-hoc Networking Hi Simon > @@ -503,15 +550,23 @@ > unsigned long flags; > > spin_lock_irqsave(&vis_hash_lock, flags); > + > purge_vis_packets(); > > - if (generate_vis_packet() == 0) > + if (generate_vis_packet() == 0) { > /* schedule if generation was successful */ > + kref_get(&my_vis_info->refcount); > list_add_tail(&my_vis_info->send_list, &send_list); > + } > > list_for_each_entry_safe(info, temp, &send_list, send_list) { > + spin_unlock_irqrestore(&vis_hash_lock, flags); > + > + send_vis_packet(info); > + > + spin_lock_irqsave(&vis_hash_lock, flags); > list_del_init(&info->send_list); > - send_vis_packet(info); > + kref_put(&info->refcount, free_info); > } > spin_unlock_irqrestore(&vis_hash_lock, flags); > start_vis_timer(); Although you say this works, i just looks wrong. It looks unbalanced. Where is the kref_put for my_vis_info->refcount? There is a kref_put inside what looks like a loop, but no kref_get inside the loop. Can you explain this is more detail? Can we make it look correctly balanced? Thanks Andrew