From: Eric Dumazet <hidden> Date: 2011-10-20 20:10:09
skb->truesize must account for allocated memory, not the used part of
it. Doing this work is important to avoid unexpected OOM situations.
Signed-off-by: Eric Dumazet <redacted>
CC: Jon Mason <redacted>
---
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Jon Mason <hidden> Date: 2011-10-20 20:33:59
On Thu, Oct 20, 2011 at 3:10 PM, Eric Dumazet [off-list ref] wrote:
skb->truesize must account for allocated memory, not the used part of
it. Doing this work is important to avoid unexpected OOM situations.
Signed-off-by: Eric Dumazet <redacted>
From: Eric Dumazet <hidden> Date: 2011-10-20 20:44:08
Le jeudi 20 octobre 2011 à 15:33 -0500, Jon Mason a écrit :
On Thu, Oct 20, 2011 at 3:10 PM, Eric Dumazet [off-list ref] wrote:
quoted
skb->truesize must account for allocated memory, not the used part of
it. Doing this work is important to avoid unexpected OOM situations.
Signed-off-by: Eric Dumazet <redacted>
From: Andrew Gallatin <hidden> Date: 2011-10-20 20:45:16
On 10/20/11 16:44, Eric Dumazet wrote:
Le jeudi 20 octobre 2011 à 15:33 -0500, Jon Mason a écrit :
quoted
On Thu, Oct 20, 2011 at 3:10 PM, Eric Dumazet[off-list ref] wrote:
quoted
skb->truesize must account for allocated memory, not the used part of
it. Doing this work is important to avoid unexpected OOM situations.
Signed-off-by: Eric Dumazet<redacted>
Acked-by: Jon Mason<redacted>
Thanks for reviewing Jon !
Please wait a second.. I think the patch is incorrect.
There is already code in myri10ge_rx_skb_build() which
attempts to set the truesize. However, it sets it to
the used, rather than the allocated size so it is apparently
incorrect.
I'd prefer we fix that code.
Thanks,
Drew
From: Eric Dumazet <hidden> Date: 2011-10-20 20:59:21
Le jeudi 20 octobre 2011 à 16:45 -0400, Andrew Gallatin a écrit :
On 10/20/11 16:44, Eric Dumazet wrote:
quoted
Le jeudi 20 octobre 2011 à 15:33 -0500, Jon Mason a écrit :
quoted
On Thu, Oct 20, 2011 at 3:10 PM, Eric Dumazet[off-list ref] wrote:
quoted
skb->truesize must account for allocated memory, not the used part of
it. Doing this work is important to avoid unexpected OOM situations.
Signed-off-by: Eric Dumazet<redacted>
Acked-by: Jon Mason<redacted>
Thanks for reviewing Jon !
Please wait a second.. I think the patch is incorrect.
There is already code in myri10ge_rx_skb_build() which
attempts to set the truesize. However, it sets it to
the used, rather than the allocated size so it is apparently
incorrect.
I'd prefer we fix that code.
Well, I believe I did exactly that :)
truesize of initial skb is fine.
Then for everay frag added, you must add to skb-truesize the allocated
memory for this frag.
You add frags of a given size (small or big)
In the end, its truesize += bytes * number_of_frags
(bytes being small_size or big_size)
From: David Miller <davem@davemloft.net> Date: 2011-10-20 21:03:51
From: Eric Dumazet <redacted>
Date: Thu, 20 Oct 2011 22:59:16 +0200
Le jeudi 20 octobre 2011 à 16:45 -0400, Andrew Gallatin a écrit :
quoted
On 10/20/11 16:44, Eric Dumazet wrote:
quoted
Le jeudi 20 octobre 2011 à 15:33 -0500, Jon Mason a écrit :
quoted
On Thu, Oct 20, 2011 at 3:10 PM, Eric Dumazet[off-list ref] wrote:
quoted
skb->truesize must account for allocated memory, not the used part of
it. Doing this work is important to avoid unexpected OOM situations.
Signed-off-by: Eric Dumazet<redacted>
Acked-by: Jon Mason<redacted>
Thanks for reviewing Jon !
Please wait a second.. I think the patch is incorrect.
There is already code in myri10ge_rx_skb_build() which
attempts to set the truesize. However, it sets it to
the used, rather than the allocated size so it is apparently
incorrect.
I'd prefer we fix that code.
Well, I believe I did exactly that :)
truesize of initial skb is fine.
Then for everay frag added, you must add to skb-truesize the allocated
memory for this frag.
You add frags of a given size (small or big)
In the end, its truesize += bytes * number_of_frags
(bytes being small_size or big_size)
Right, I believe Eric's patch is correct, and I intend to apply it.
From: Andrew Gallatin <hidden> Date: 2011-10-20 21:04:13
On 10/20/11 16:59, Eric Dumazet wrote:
Le jeudi 20 octobre 2011 à 16:45 -0400, Andrew Gallatin a écrit :
quoted
On 10/20/11 16:44, Eric Dumazet wrote:
quoted
Le jeudi 20 octobre 2011 à 15:33 -0500, Jon Mason a écrit :
quoted
On Thu, Oct 20, 2011 at 3:10 PM, Eric Dumazet[off-list ref] wrote:
quoted
skb->truesize must account for allocated memory, not the used part of
it. Doing this work is important to avoid unexpected OOM situations.
Signed-off-by: Eric Dumazet<redacted>
Acked-by: Jon Mason<redacted>
Thanks for reviewing Jon !
Please wait a second.. I think the patch is incorrect.
There is already code in myri10ge_rx_skb_build() which
attempts to set the truesize. However, it sets it to
the used, rather than the allocated size so it is apparently
incorrect.
I'd prefer we fix that code.
Well, I believe I did exactly that :)
truesize of initial skb is fine.
Then for everay frag added, you must add to skb-truesize the allocated
memory for this frag.
You add frags of a given size (small or big)
In the end, its truesize += bytes * number_of_frags
(bytes being small_size or big_size)
OK, I'm feeling foolish. I somehow missed the first hunk
of your patch (some local change made it not apply cleanly, and
I did not notice that).
Yes, your patch is correct. Sorry for the hassle!
Acked-by: Andrew Gallatin <redacted>
From: Eric Dumazet <hidden> Date: 2011-10-20 21:06:13
Le jeudi 20 octobre 2011 à 17:04 -0400, Andrew Gallatin a écrit :
OK, I'm feeling foolish. I somehow missed the first hunk
of your patch (some local change made it not apply cleanly, and
I did not notice that).
Yes, your patch is correct. Sorry for the hassle!
From: David Miller <davem@davemloft.net> Date: 2011-10-20 21:42:36
From: Eric Dumazet <redacted>
Date: Thu, 20 Oct 2011 22:10:03 +0200
skb->truesize must account for allocated memory, not the used part of
it. Doing this work is important to avoid unexpected OOM situations.
Signed-off-by: Eric Dumazet <redacted>