All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net_sched: sch_fq: use hash_ptr()
@ 2016-11-17 17:48 Eric Dumazet
  2016-11-17 18:29 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2016-11-17 17:48 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Hugh Dickins

From: Eric Dumazet <edumazet@google.com>

When I wrote sch_fq.c, hash_ptr() on 64bit arches was awful,
and I chose hash_32().

Linus Torvalds and George Spelvin fixed this issue, so we can
use hash_ptr() to get more entropy on 64bit arches with Terabytes
of memory, and avoid the cast games.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Hugh Dickins <hughd@google.com>
---
 net/sched/sch_fq.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index 18e752439f6f..86309a3156a5 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -245,7 +245,7 @@ static struct fq_flow *fq_classify(struct sk_buff *skb, struct fq_sched_data *q)
 		skb_orphan(skb);
 	}
 
-	root = &q->fq_root[hash_32((u32)(long)sk, q->fq_trees_log)];
+	root = &q->fq_root[hash_ptr(sk, q->fq_trees_log)];
 
 	if (q->flows >= (2U << q->fq_trees_log) &&
 	    q->inactive_flows > q->flows/2)
@@ -599,7 +599,7 @@ static void fq_rehash(struct fq_sched_data *q,
 				kmem_cache_free(fq_flow_cachep, of);
 				continue;
 			}
-			nroot = &new_array[hash_32((u32)(long)of->sk, new_log)];
+			nroot = &new_array[hash_ptr(of->sk, new_log)];
 
 			np = &nroot->rb_node;
 			parent = NULL;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net_sched: sch_fq: use hash_ptr()
  2016-11-17 17:48 [PATCH net-next] net_sched: sch_fq: use hash_ptr() Eric Dumazet
@ 2016-11-17 18:29 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-11-17 18:29 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, hughd

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 17 Nov 2016 09:48:30 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> When I wrote sch_fq.c, hash_ptr() on 64bit arches was awful,
> and I chose hash_32().
> 
> Linus Torvalds and George Spelvin fixed this issue, so we can
> use hash_ptr() to get more entropy on 64bit arches with Terabytes
> of memory, and avoid the cast games.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Hugh Dickins <hughd@google.com>

Applied, thanks Eric.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-17 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-17 17:48 [PATCH net-next] net_sched: sch_fq: use hash_ptr() Eric Dumazet
2016-11-17 18:29 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.