lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 20 Dec 2007 19:32:45 +0100
From:	Ingo Oeser <netdev@...eo.de>
To:	Pavel Emelyanov <xemul@...nvz.org>
Cc:	David Miller <davem@...emloft.net>,
	Linux Netdev List <netdev@...r.kernel.org>, devel@...nvz.org
Subject: Re: [PATCH net-2.6.25 3/3] Uninline the inet_twsk_put function

Pavel Emelyanov schrieb:
> This one is not that big, but is widely used: saves 1200 bytes 
> from net/ipv4/built-in.o
> +void inet_twsk_put(struct inet_timewait_sock *tw)
> +{
> +	if (atomic_dec_and_test(&tw->tw_refcnt)) {
> +		struct module *owner = tw->tw_prot->owner;
> +		twsk_destructor((struct sock *)tw);
> +#ifdef SOCK_REFCNT_DEBUG
> +		printk(KERN_DEBUG "%s timewait_sock %p released\n",
> +		       tw->tw_prot->name, tw);
> +#endif
> +		kmem_cache_free(tw->tw_prot->twsk_prot->twsk_slab, tw);
> +		module_put(owner);
> +	}
> +}
> +EXPORT_SYMBOL_GPL(inet_twsk_put);

More correct fix seems to be conversion to kref.

Just create out of line inet_twsk_release() containing
sth. similiar to the code inside these braces and modify 
inet_twsk_put() to sth. like this:

static inline inet_twsk_put(struct inet_timewait_sock *tw)
{
	kref_put(&tw->kref, inet_twsk_release);
}

David, can you see any reason (e.g. some crazy lock stuff) NOT to do this?


Best Regards

Ingo Oeser
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ