Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78629
b: refs/heads/master
c: 21371f7
h: refs/heads/master
i:
  78627: 86a8ec5
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 28, 2008
1 parent 286fae6 commit 3caf9ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b15c4bcd15741b31019379298edfca28dc78029d
refs/heads/master: 21371f768bf7127ee45bfaadd17899df6a439e8f
3 changes: 2 additions & 1 deletion trunk/include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,11 @@ extern void __sk_stream_mem_reclaim(struct sock *sk);
extern int sk_stream_mem_schedule(struct sock *sk, int size, int kind);

#define SK_STREAM_MEM_QUANTUM ((int)PAGE_SIZE)
#define SK_STREAM_MEM_QUANTUM_SHIFT ilog2(SK_STREAM_MEM_QUANTUM)

static inline int sk_stream_pages(int amt)
{
return DIV_ROUND_UP(amt, SK_STREAM_MEM_QUANTUM);
return (amt + SK_STREAM_MEM_QUANTUM - 1) >> SK_STREAM_MEM_QUANTUM_SHIFT;
}

static inline void sk_stream_mem_reclaim(struct sock *sk)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/core/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ EXPORT_SYMBOL(sk_stream_error);

void __sk_stream_mem_reclaim(struct sock *sk)
{
atomic_sub(sk->sk_forward_alloc / SK_STREAM_MEM_QUANTUM,
atomic_sub(sk->sk_forward_alloc >> SK_STREAM_MEM_QUANTUM_SHIFT,
sk->sk_prot->memory_allocated);
sk->sk_forward_alloc &= SK_STREAM_MEM_QUANTUM - 1;
if (*sk->sk_prot->memory_pressure &&
Expand Down

0 comments on commit 3caf9ca

Please sign in to comment.