[lttng-dev] [lttng-tools PATCH] Fix double PID registration race

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Mar 13 14:25:50 EDT 2012


* David Goulet (dgoulet at efficios.com) wrote:
[...]
> @@ -1475,15 +1486,21 @@ void ust_app_clean_list(void)
>  		assert(!ret);
>  		call_rcu(&node->head, delete_ust_app_rcu);
>  	}
> -	/* Destroy is done only when the ht is empty */
> -	lttng_ht_destroy(ust_app_ht);
>  
> -	cds_lfht_for_each_entry(ust_app_sock_key_map->ht, &iter.iter, node, node) {
> -		ret = lttng_ht_del(ust_app_sock_key_map, &iter);
> +	/* Cleanup socket hash table */
> +	cds_lfht_for_each_entry(ust_app_ht_by_sock->ht, &iter.iter, node, node) {
> +		ret = lttng_ht_del(ust_app_ht_by_sock, &iter);
>  		assert(!ret);
>  	}
> +
>  	/* Destroy is done only when the ht is empty */
> -	lttng_ht_destroy(ust_app_sock_key_map);
> +	lttng_ht_destroy(ust_app_ht);
> +
> +	/*
> +	 * Emptying the previous hash table makes sure this table is also ready for
> +	 * destruction.
> +	 */

The comment above does not match the code anymore.

Mathieu

> +	lttng_ht_destroy(ust_app_ht_by_sock);
>  
>  	rcu_read_unlock();
>  }

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list