Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 299793 Details for
Bug 439923
Avoid multi-page allocations in IP fragmentation
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Avoid multi-page allocations in IP fragmentation
linux-2.6.9-zab_mtu_u6_2.patch (text/plain), 2.90 KB, created by
Greg Marsden
on 2008-03-31 23:47:08 UTC
(
hide
)
Description:
Avoid multi-page allocations in IP fragmentation
Filename:
MIME Type:
Creator:
Greg Marsden
Created:
2008-03-31 23:47:08 UTC
Size:
2.90 KB
patch
obsolete
>From: Olaf Kirch <olaf.kirch@oracle.com> >Subject: Avoid multi-page allocations in IP fragmentation > >This patch is based on a patch by Zach Brown. The idea is to avoid >multi-order allocations in the fragment handling code, because that >will fail on heavily loaded machines where memory tends to become >rather fragmented. Original posting can be found here: > >http://marc.info/?l=linux-netdev&m=114425947024500&w=2 > >This modified patch addresses a problem encountered on ppc - the >original patch caused skb_shared_info to become unaligned, which causes >crashes on ppc (see bug #6140918). The first iteration introduced a new >problem (described in bug #6845794). > >Olaf Kirch <olaf.kirch@oracle.com> >--- > net/ipv4/ip_output.c | 40 +++++++++++++++++++++++++++------------- > 1 file changed, 27 insertions(+), 13 deletions(-) > >Index: linux-2.6.9/net/ipv4/ip_output.c >=================================================================== >--- linux-2.6.9.orig/net/ipv4/ip_output.c >+++ linux-2.6.9/net/ipv4/ip_output.c >@@ -824,32 +824,46 @@ alloc_new_skb: > datalen = length + fraggap; > if (datalen > mtu - fragheaderlen) > datalen = maxfraglen - fragheaderlen; >- fraglen = datalen + fragheaderlen; > >- if ((flags & MSG_MORE) && >- !(rt->u.dst.dev->features&NETIF_F_SG)) >- alloclen = mtu; >- else >- alloclen = datalen + fragheaderlen; >+ alloclen = fragheaderlen + hh_len + 15; > > /* The last fragment gets additional space at tail. > * Note, with MSG_MORE we overallocate on fragments, > * because we have no idea what fragment will be > * the last. > */ >- if (datalen == length) >+ if (datalen == length + fraggap) > alloclen += rt->u.dst.trailer_len; >+ if ((rt->u.dst.dev->features&NETIF_F_SG) && >+ datalen > SKB_MAX_ORDER(alloclen, 0)) { >+ /* If we added a trailer, we have to remove >+ * it again. >+ * However, this may actually increase >+ * SKB_MAX_ORDER(alloclen) signficantly - >+ * ie by SMP_CACHE_BYTES - so we need to make >+ * sure we don't accidentally increase datalen. >+ */ >+ if (datalen == length + fraggap) >+ alloclen -= rt->u.dst.trailer_len; >+ datalen = min_t(unsigned int, datalen, >+ SKB_MAX_ORDER(alloclen, 0)); >+ } >+ >+ fraglen = datalen + fragheaderlen; >+ >+ if ((flags & MSG_MORE) && >+ !(rt->u.dst.dev->features&NETIF_F_SG)) >+ alloclen += mtu - fragheaderlen; >+ else >+ alloclen += datalen; > > if (transhdrlen) { >- skb = sock_alloc_send_skb(sk, >- alloclen + hh_len + 15, >+ skb = sock_alloc_send_skb(sk, alloclen, > (flags & MSG_DONTWAIT), &err); > } else { > skb = NULL; >- if (atomic_read(&sk->sk_wmem_alloc) <= >- 2 * sk->sk_sndbuf) >- skb = sock_wmalloc(sk, >- alloclen + hh_len + 15, 1, >+ if (atomic_read(&sk->sk_wmem_alloc) <= 2 * sk->sk_sndbuf) >+ skb = sock_wmalloc(sk, alloclen, 1, > sk->sk_allocation); > if (unlikely(skb == NULL)) > err = -ENOBUFS;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 439923
: 299793