Re: [GIT]: Networking

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, June 16, 2009 - 11:59 am

On Tue, 16 Jun 2009, Eric Dumazet wrote:

I think this is incredibly ugly and hacky.


Seriously, look at that code, and tell me it makes sense.

No, it does not. The code looks like totally random line noise, and that 
whole "> 1" test makes no conceptual sense what-so-ever.

It _will_ result in random bugs later on, because code that doesn't make 
sense will never be good in the long run.

At the very least, add a helper function for "do I actually have 
outstanding allocations" or something like that. IOW, do a 

	/*
	 * Comment here about that magical "1"
	 */
	static inline int sk_has_allocations(struct sock *sk)
	{
		return atomic_read(&sk->sk_wmem_alloc) > 1 ||
			atomic_read(&sk->sk_rmem_alloc);
	}

and then make the various network protocols use that, rather than 
open-coding some random internal implementation magic.

		Linus
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT]: Networking, David Miller, (Mon Jun 15, 5:04 am)
Re: [GIT]: Networking, Ingo Molnar, (Tue Jun 16, 2:15 am)
Re: [GIT]: Networking, David Miller, (Tue Jun 16, 2:19 am)
Re: [GIT]: Networking, David Miller, (Tue Jun 16, 2:21 am)
Re: [GIT]: Networking, Ingo Molnar, (Tue Jun 16, 2:26 am)
Re: [GIT]: Networking, Ingo Molnar, (Tue Jun 16, 2:33 am)
Re: [GIT]: Networking, Alan Cox, (Tue Jun 16, 2:44 am)
Re: [GIT]: Networking, Ingo Molnar, (Tue Jun 16, 2:44 am)
Re: [GIT]: Networking, Ingo Molnar, (Tue Jun 16, 2:48 am)
Re: [GIT]: Networking, David Miller, (Tue Jun 16, 2:56 am)
Re: [GIT]: Networking, Ingo Molnar, (Tue Jun 16, 3:11 am)
Re: [GIT]: Networking, David Miller, (Tue Jun 16, 3:35 am)
Re: [GIT]: Networking, David Miller, (Tue Jun 16, 3:47 am)
Re: [GIT]: Networking, Ingo Molnar, (Tue Jun 16, 3:53 am)
Re: [GIT]: Networking, Ingo Molnar, (Tue Jun 16, 5:24 am)
Re: [GIT]: Networking, David Miller, (Tue Jun 16, 5:39 am)
Re: [GIT]: Networking, Eric Dumazet, (Tue Jun 16, 6:38 am)
Re: [GIT]: Networking, Eric Dumazet, (Tue Jun 16, 7:19 am)
Re: [GIT]: Networking, Linus Torvalds, (Tue Jun 16, 11:59 am)
Re: [GIT]: Networking, David Miller, (Tue Jun 16, 12:08 pm)
Re: [GIT]: Networking, Eric Dumazet, (Tue Jun 16, 12:37 pm)
Re: [GIT]: Networking, Eric Dumazet, (Tue Jun 16, 1:12 pm)
[PATCH] net: correct off-by-one write allocations reports, Eric Dumazet, (Tue Jun 16, 11:41 pm)
[PATCH] atm: sk_wmem_alloc initial value is one, Eric Dumazet, (Wed Jun 17, 4:31 am)
Re: [GIT]: Networking, David Miller, (Wed Jun 17, 4:32 am)
Re: [PATCH] atm: sk_wmem_alloc initial value is one, David Miller, (Wed Jun 17, 7:06 pm)
Re: [bug] __nf_ct_refresh_acct(): WARNING: at lib/list_deb ..., Pablo Neira Ayuso, (Thu Jun 18, 9:13 am)
[PATCH] netfilter: conntrack: death_by_timeout() fix, Eric Dumazet, (Thu Jun 18, 3:46 pm)
Re: [GIT]: Networking, Tilman Schmidt, (Thu Jun 18, 4:18 pm)
Re: [GIT]: Networking, David Miller, (Thu Jun 18, 8:36 pm)
Re: [PATCH] netfilter: conntrack: death_by_timeout() fix, Patrick McHardy, (Fri Jun 19, 4:15 am)