diff for duplicates of <20100713101928.2835.65030.sendpatchset@danny.redhat> diff --git a/a/1.txt b/N1/1.txt index 0f039b9..7db967d 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -181,9 +181,3 @@ index 5ebc27e..cb8bd13 100644 seq = ntohl(th->ack_seq); -- 1.7.1.1 - --- -To unsubscribe, send a message with 'unsubscribe linux-mm' in -the body to majordomo@kvack.org. For more info on Linux MM, -see: http://www.linux-mm.org/ . -Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N1/content_digest index 0725663..a53782e 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -198,12 +198,6 @@ " \tif (th->ack)\n" " \t\tseq = ntohl(th->ack_seq);\n" "-- \n" - "1.7.1.1\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" + 1.7.1.1 -9a05570af85c9bb5792a98ae9ab592eb6ade0651176c3af156a3bdd2886d90e9 +b80caa9657a6461b2f9c17f794c65a02401360d01bd4d65f9d3ade91c219695b
diff --git a/a/1.txt b/N2/1.txt index 0f039b9..8b13789 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -1,189 +1 @@ ->From 3bc4f5211d8716267891ff85385177f181e418ea Mon Sep 17 00:00:00 2001 -From: Xiaotian Feng <dfeng@redhat.com> -Date: Tue, 13 Jul 2010 11:04:45 +0800 -Subject: [PATCH 14/30] net: sk_allocation() - concentrate socket related allocations -Introduce sk_allocation(), this function allows to inject sock specific -flags to each sock related allocation. - -Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> -Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> -Signed-off-by: Xiaotian Feng <dfeng@redhat.com> ---- - include/linux/skbuff.h | 3 +++ - include/net/sock.h | 5 +++++ - net/ipv4/tcp.c | 3 ++- - net/ipv4/tcp_output.c | 11 ++++++----- - net/ipv6/tcp_ipv6.c | 15 +++++++++++---- - 5 files changed, 27 insertions(+), 10 deletions(-) - -diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index ac74ee0..988a4dc 100644 ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -1119,6 +1119,9 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i, - extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, - int off, int size); - -+extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, -+ int off, int size); -+ - #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) - #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frags(skb)) - #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) -diff --git a/include/net/sock.h b/include/net/sock.h -index 4f26f2f..9ddb37b 100644 ---- a/include/net/sock.h -+++ b/include/net/sock.h -@@ -563,6 +563,11 @@ static inline int sock_flag(struct sock *sk, enum sock_flags flag) - return test_bit(flag, &sk->sk_flags); - } - -+static inline gfp_t sk_allocation(struct sock *sk, gfp_t gfp_mask) -+{ -+ return gfp_mask; -+} -+ - static inline void sk_acceptq_removed(struct sock *sk) - { - sk->sk_ack_backlog--; -diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c -index 4e6ddfb..8ffe2c8 100644 ---- a/net/ipv4/tcp.c -+++ b/net/ipv4/tcp.c -@@ -683,7 +683,8 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp) - /* The TCP header must be at least 32-bit aligned. */ - size = ALIGN(size, 4); - -- skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp); -+ skb = alloc_skb_fclone(size + sk->sk_prot->max_header, -+ sk_allocation(sk, gfp)); - if (skb) { - if (sk_wmem_schedule(sk, skb->truesize)) { - /* -diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c -index 25ff62e..a5ca337 100644 ---- a/net/ipv4/tcp_output.c -+++ b/net/ipv4/tcp_output.c -@@ -2307,7 +2307,7 @@ void tcp_send_fin(struct sock *sk) - /* Socket is locked, keep trying until memory is available. */ - for (;;) { - skb = alloc_skb_fclone(MAX_TCP_HEADER, -- sk->sk_allocation); -+ sk_allocation(sk, sk->sk_allocation)); - if (skb) - break; - yield(); -@@ -2333,7 +2333,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority) - struct sk_buff *skb; - - /* NOTE: No TCP options attached and we never retransmit this. */ -- skb = alloc_skb(MAX_TCP_HEADER, priority); -+ skb = alloc_skb(MAX_TCP_HEADER, sk_allocation(sk, priority)); - if (!skb) { - NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTFAILED); - return; -@@ -2406,7 +2406,8 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, - - if (cvp != NULL && cvp->s_data_constant && cvp->s_data_desired) - s_data_desired = cvp->s_data_desired; -- skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, GFP_ATOMIC); -+ skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, -+ sk_allocation(sk, GFP_ATOMIC)); - if (skb == NULL) - return NULL; - -@@ -2686,7 +2687,7 @@ void tcp_send_ack(struct sock *sk) - * tcp_transmit_skb() will set the ownership to this - * sock. - */ -- buff = alloc_skb(MAX_TCP_HEADER, GFP_ATOMIC); -+ buff = alloc_skb(MAX_TCP_HEADER, sk_allocation(sk, GFP_ATOMIC)); - if (buff == NULL) { - inet_csk_schedule_ack(sk); - inet_csk(sk)->icsk_ack.ato = TCP_ATO_MIN; -@@ -2721,7 +2722,7 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent) - struct sk_buff *skb; - - /* We don't queue it, tcp_transmit_skb() sets ownership. */ -- skb = alloc_skb(MAX_TCP_HEADER, GFP_ATOMIC); -+ skb = alloc_skb(MAX_TCP_HEADER, sk_allocation(sk, GFP_ATOMIC)); - if (skb == NULL) - return -1; - -diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c -index 5ebc27e..cb8bd13 100644 ---- a/net/ipv6/tcp_ipv6.c -+++ b/net/ipv6/tcp_ipv6.c -@@ -589,7 +589,8 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, - } else { - /* reallocate new list if current one is full. */ - if (!tp->md5sig_info) { -- tp->md5sig_info = kzalloc(sizeof(*tp->md5sig_info), GFP_ATOMIC); -+ tp->md5sig_info = kzalloc(sizeof(*tp->md5sig_info), -+ sk_allocation(sk, GFP_ATOMIC)); - if (!tp->md5sig_info) { - kfree(newkey); - return -ENOMEM; -@@ -602,7 +603,8 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, - } - if (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) { - keys = kmalloc((sizeof (tp->md5sig_info->keys6[0]) * -- (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC); -+ (tp->md5sig_info->entries6 + 1)), -+ sk_allocation(sk, GFP_ATOMIC)); - - if (!keys) { - tcp_free_md5sig_pool(); -@@ -726,7 +728,8 @@ static int tcp_v6_parse_md5_keys (struct sock *sk, char __user *optval, - struct tcp_sock *tp = tcp_sk(sk); - struct tcp_md5sig_info *p; - -- p = kzalloc(sizeof(struct tcp_md5sig_info), GFP_KERNEL); -+ p = kzalloc(sizeof(struct tcp_md5sig_info), -+ sk_allocation(sk, GFP_KERNEL)); - if (!p) - return -ENOMEM; - -@@ -997,6 +1000,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, - unsigned int tot_len = sizeof(struct tcphdr); - struct dst_entry *dst; - __be32 *topt; -+ gfp_t gfp_mask = GFP_ATOMIC; - - if (ts) - tot_len += TCPOLEN_TSTAMP_ALIGNED; -@@ -1006,7 +1010,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, - #endif - - buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len, -- GFP_ATOMIC); -+ gfp_mask); - if (buff == NULL) - return; - -@@ -1083,6 +1087,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) - struct tcphdr *th = tcp_hdr(skb); - u32 seq = 0, ack_seq = 0; - struct tcp_md5sig_key *key = NULL; -+ gfp_t gfp_mask = GFP_ATOMIC; - - if (th->rst) - return; -@@ -1094,6 +1099,8 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) - if (sk) - key = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr); - #endif -+ if (sk) -+ gfp_mask = sk_allocation(sk, gfp_mask); - - if (th->ack) - seq = ntohl(th->ack_seq); --- -1.7.1.1 - --- -To unsubscribe, send a message with 'unsubscribe linux-mm' in -the body to majordomo@kvack.org. For more info on Linux MM, -see: http://www.linux-mm.org/ . -Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N2/content_digest index 0725663..af43ad4 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -16,194 +16,5 @@ " davem@davemloft.net\0" "\00:1\0" "b\0" - ">From 3bc4f5211d8716267891ff85385177f181e418ea Mon Sep 17 00:00:00 2001\n" - "From: Xiaotian Feng <dfeng@redhat.com>\n" - "Date: Tue, 13 Jul 2010 11:04:45 +0800\n" - "Subject: [PATCH 14/30] net: sk_allocation() - concentrate socket related allocations\n" - "\n" - "Introduce sk_allocation(), this function allows to inject sock specific\n" - "flags to each sock related allocation.\n" - "\n" - "Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>\n" - "Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>\n" - "Signed-off-by: Xiaotian Feng <dfeng@redhat.com>\n" - "---\n" - " include/linux/skbuff.h | 3 +++\n" - " include/net/sock.h | 5 +++++\n" - " net/ipv4/tcp.c | 3 ++-\n" - " net/ipv4/tcp_output.c | 11 ++++++-----\n" - " net/ipv6/tcp_ipv6.c | 15 +++++++++++----\n" - " 5 files changed, 27 insertions(+), 10 deletions(-)\n" - "\n" - "diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h\n" - "index ac74ee0..988a4dc 100644\n" - "--- a/include/linux/skbuff.h\n" - "+++ b/include/linux/skbuff.h\n" - "@@ -1119,6 +1119,9 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i,\n" - " extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,\n" - " \t\t\t int off, int size);\n" - " \n" - "+extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,\n" - "+\t\t\t int off, int size);\n" - "+\n" - " #define SKB_PAGE_ASSERT(skb) \tBUG_ON(skb_shinfo(skb)->nr_frags)\n" - " #define SKB_FRAG_ASSERT(skb) \tBUG_ON(skb_has_frags(skb))\n" - " #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb))\n" - "diff --git a/include/net/sock.h b/include/net/sock.h\n" - "index 4f26f2f..9ddb37b 100644\n" - "--- a/include/net/sock.h\n" - "+++ b/include/net/sock.h\n" - "@@ -563,6 +563,11 @@ static inline int sock_flag(struct sock *sk, enum sock_flags flag)\n" - " \treturn test_bit(flag, &sk->sk_flags);\n" - " }\n" - " \n" - "+static inline gfp_t sk_allocation(struct sock *sk, gfp_t gfp_mask)\n" - "+{\n" - "+\treturn gfp_mask;\n" - "+}\n" - "+\n" - " static inline void sk_acceptq_removed(struct sock *sk)\n" - " {\n" - " \tsk->sk_ack_backlog--;\n" - "diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c\n" - "index 4e6ddfb..8ffe2c8 100644\n" - "--- a/net/ipv4/tcp.c\n" - "+++ b/net/ipv4/tcp.c\n" - "@@ -683,7 +683,8 @@ struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp)\n" - " \t/* The TCP header must be at least 32-bit aligned. */\n" - " \tsize = ALIGN(size, 4);\n" - " \n" - "-\tskb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);\n" - "+\tskb = alloc_skb_fclone(size + sk->sk_prot->max_header,\n" - "+\t\t\t sk_allocation(sk, gfp));\n" - " \tif (skb) {\n" - " \t\tif (sk_wmem_schedule(sk, skb->truesize)) {\n" - " \t\t\t/*\n" - "diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c\n" - "index 25ff62e..a5ca337 100644\n" - "--- a/net/ipv4/tcp_output.c\n" - "+++ b/net/ipv4/tcp_output.c\n" - "@@ -2307,7 +2307,7 @@ void tcp_send_fin(struct sock *sk)\n" - " \t\t/* Socket is locked, keep trying until memory is available. */\n" - " \t\tfor (;;) {\n" - " \t\t\tskb = alloc_skb_fclone(MAX_TCP_HEADER,\n" - "-\t\t\t\t\t sk->sk_allocation);\n" - "+\t\t\t\t\t sk_allocation(sk, sk->sk_allocation));\n" - " \t\t\tif (skb)\n" - " \t\t\t\tbreak;\n" - " \t\t\tyield();\n" - "@@ -2333,7 +2333,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority)\n" - " \tstruct sk_buff *skb;\n" - " \n" - " \t/* NOTE: No TCP options attached and we never retransmit this. */\n" - "-\tskb = alloc_skb(MAX_TCP_HEADER, priority);\n" - "+\tskb = alloc_skb(MAX_TCP_HEADER, sk_allocation(sk, priority));\n" - " \tif (!skb) {\n" - " \t\tNET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTFAILED);\n" - " \t\treturn;\n" - "@@ -2406,7 +2406,8 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,\n" - " \n" - " \tif (cvp != NULL && cvp->s_data_constant && cvp->s_data_desired)\n" - " \t\ts_data_desired = cvp->s_data_desired;\n" - "-\tskb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, GFP_ATOMIC);\n" - "+\tskb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1,\n" - "+\t\t\tsk_allocation(sk, GFP_ATOMIC));\n" - " \tif (skb == NULL)\n" - " \t\treturn NULL;\n" - " \n" - "@@ -2686,7 +2687,7 @@ void tcp_send_ack(struct sock *sk)\n" - " \t * tcp_transmit_skb() will set the ownership to this\n" - " \t * sock.\n" - " \t */\n" - "-\tbuff = alloc_skb(MAX_TCP_HEADER, GFP_ATOMIC);\n" - "+\tbuff = alloc_skb(MAX_TCP_HEADER, sk_allocation(sk, GFP_ATOMIC));\n" - " \tif (buff == NULL) {\n" - " \t\tinet_csk_schedule_ack(sk);\n" - " \t\tinet_csk(sk)->icsk_ack.ato = TCP_ATO_MIN;\n" - "@@ -2721,7 +2722,7 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent)\n" - " \tstruct sk_buff *skb;\n" - " \n" - " \t/* We don't queue it, tcp_transmit_skb() sets ownership. */\n" - "-\tskb = alloc_skb(MAX_TCP_HEADER, GFP_ATOMIC);\n" - "+\tskb = alloc_skb(MAX_TCP_HEADER, sk_allocation(sk, GFP_ATOMIC));\n" - " \tif (skb == NULL)\n" - " \t\treturn -1;\n" - " \n" - "diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c\n" - "index 5ebc27e..cb8bd13 100644\n" - "--- a/net/ipv6/tcp_ipv6.c\n" - "+++ b/net/ipv6/tcp_ipv6.c\n" - "@@ -589,7 +589,8 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,\n" - " \t} else {\n" - " \t\t/* reallocate new list if current one is full. */\n" - " \t\tif (!tp->md5sig_info) {\n" - "-\t\t\ttp->md5sig_info = kzalloc(sizeof(*tp->md5sig_info), GFP_ATOMIC);\n" - "+\t\t\ttp->md5sig_info = kzalloc(sizeof(*tp->md5sig_info),\n" - "+\t\t\t\t\tsk_allocation(sk, GFP_ATOMIC));\n" - " \t\t\tif (!tp->md5sig_info) {\n" - " \t\t\t\tkfree(newkey);\n" - " \t\t\t\treturn -ENOMEM;\n" - "@@ -602,7 +603,8 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,\n" - " \t\t}\n" - " \t\tif (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) {\n" - " \t\t\tkeys = kmalloc((sizeof (tp->md5sig_info->keys6[0]) *\n" - "-\t\t\t\t (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC);\n" - "+\t\t\t\t (tp->md5sig_info->entries6 + 1)),\n" - "+\t\t\t\t sk_allocation(sk, GFP_ATOMIC));\n" - " \n" - " \t\t\tif (!keys) {\n" - " \t\t\t\ttcp_free_md5sig_pool();\n" - "@@ -726,7 +728,8 @@ static int tcp_v6_parse_md5_keys (struct sock *sk, char __user *optval,\n" - " \t\tstruct tcp_sock *tp = tcp_sk(sk);\n" - " \t\tstruct tcp_md5sig_info *p;\n" - " \n" - "-\t\tp = kzalloc(sizeof(struct tcp_md5sig_info), GFP_KERNEL);\n" - "+\t\tp = kzalloc(sizeof(struct tcp_md5sig_info),\n" - "+\t\t\t\t sk_allocation(sk, GFP_KERNEL));\n" - " \t\tif (!p)\n" - " \t\t\treturn -ENOMEM;\n" - " \n" - "@@ -997,6 +1000,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,\n" - " \tunsigned int tot_len = sizeof(struct tcphdr);\n" - " \tstruct dst_entry *dst;\n" - " \t__be32 *topt;\n" - "+\tgfp_t gfp_mask = GFP_ATOMIC;\n" - " \n" - " \tif (ts)\n" - " \t\ttot_len += TCPOLEN_TSTAMP_ALIGNED;\n" - "@@ -1006,7 +1010,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,\n" - " #endif\n" - " \n" - " \tbuff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len,\n" - "-\t\t\t GFP_ATOMIC);\n" - "+\t\t\t gfp_mask);\n" - " \tif (buff == NULL)\n" - " \t\treturn;\n" - " \n" - "@@ -1083,6 +1087,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)\n" - " \tstruct tcphdr *th = tcp_hdr(skb);\n" - " \tu32 seq = 0, ack_seq = 0;\n" - " \tstruct tcp_md5sig_key *key = NULL;\n" - "+\tgfp_t gfp_mask = GFP_ATOMIC;\n" - " \n" - " \tif (th->rst)\n" - " \t\treturn;\n" - "@@ -1094,6 +1099,8 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)\n" - " \tif (sk)\n" - " \t\tkey = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr);\n" - " #endif\n" - "+\tif (sk)\n" - "+\t\tgfp_mask = sk_allocation(sk, gfp_mask);\n" - " \n" - " \tif (th->ack)\n" - " \t\tseq = ntohl(th->ack_seq);\n" - "-- \n" - "1.7.1.1\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" -9a05570af85c9bb5792a98ae9ab592eb6ade0651176c3af156a3bdd2886d90e9 +06ca66bf04061d592ad4105f7b547d501502e153f8623bf88f404c2342033720
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.