<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/include/net/sock.h, branch v3.5.2</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>memcg: decrement static keys at real destroy time</title>
<updated>2012-05-29T23:22:28+00:00</updated>
<author>
<name>Glauber Costa</name>
<email>glommer@parallels.com</email>
</author>
<published>2012-05-29T22:07:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3f134619393cb6c6dfab7890a617d0ceca6d05d7'/>
<id>3f134619393cb6c6dfab7890a617d0ceca6d05d7</id>
<content type='text'>
We call the destroy function when a cgroup starts to be removed, such as
by a rmdir event.

However, because of our reference counters, some objects are still
inflight.  Right now, we are decrementing the static_keys at destroy()
time, meaning that if we get rid of the last static_key reference, some
objects will still have charges, but the code to properly uncharge them
won't be run.

This becomes a problem specially if it is ever enabled again, because now
new charges will be added to the staled charges making keeping it pretty
much impossible.

We just need to be careful with the static branch activation: since there
is no particular preferred order of their activation, we need to make sure
that we only start using it after all call sites are active.  This is
achieved by having a per-memcg flag that is only updated after
static_key_slow_inc() returns.  At this time, we are sure all sites are
active.

This is made per-memcg, not global, for a reason: it also has the effect
of making socket accounting more consistent.  The first memcg to be
limited will trigger static_key() activation, therefore, accounting.  But
all the others will then be accounted no matter what.  After this patch,
only limited memcgs will have its sockets accounted.

[akpm@linux-foundation.org: move enum sock_flag_bits into sock.h,
                            document enum sock_flag_bits,
                            convert memcg_proto_active() and memcg_proto_activated() to test_bit(),
                            redo tcp_update_limit() comment to 80 cols]
Signed-off-by: Glauber Costa &lt;glommer@parallels.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Acked-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.cz&gt;
Acked-by: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We call the destroy function when a cgroup starts to be removed, such as
by a rmdir event.

However, because of our reference counters, some objects are still
inflight.  Right now, we are decrementing the static_keys at destroy()
time, meaning that if we get rid of the last static_key reference, some
objects will still have charges, but the code to properly uncharge them
won't be run.

This becomes a problem specially if it is ever enabled again, because now
new charges will be added to the staled charges making keeping it pretty
much impossible.

We just need to be careful with the static branch activation: since there
is no particular preferred order of their activation, we need to make sure
that we only start using it after all call sites are active.  This is
achieved by having a per-memcg flag that is only updated after
static_key_slow_inc() returns.  At this time, we are sure all sites are
active.

This is made per-memcg, not global, for a reason: it also has the effect
of making socket accounting more consistent.  The first memcg to be
limited will trigger static_key() activation, therefore, accounting.  But
all the others will then be accounted no matter what.  After this patch,
only limited memcgs will have its sockets accounted.

[akpm@linux-foundation.org: move enum sock_flag_bits into sock.h,
                            document enum sock_flag_bits,
                            convert memcg_proto_active() and memcg_proto_activated() to test_bit(),
                            redo tcp_update_limit() comment to 80 cols]
Signed-off-by: Glauber Costa &lt;glommer@parallels.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Acked-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.cz&gt;
Acked-by: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup</title>
<updated>2012-05-23T00:40:19+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-05-23T00:40:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=88d6ae8dc33af12fe1c7941b1fae2767374046fd'/>
<id>88d6ae8dc33af12fe1c7941b1fae2767374046fd</id>
<content type='text'>
Pull cgroup updates from Tejun Heo:
 "cgroup file type addition / removal is updated so that file types are
  added and removed instead of individual files so that dynamic file
  type addition / removal can be implemented by cgroup and used by
  controllers.  blkio controller changes which will come through block
  tree are dependent on this.  Other changes include res_counter cleanup
  and disallowing kthread / PF_THREAD_BOUND threads to be attached to
  non-root cgroups.

  There's a reported bug with the file type addition / removal handling
  which can lead to oops on cgroup umount.  The issue is being looked
  into.  It shouldn't cause problems for most setups and isn't a
  security concern."

Fix up trivial conflict in Documentation/feature-removal-schedule.txt

* 'for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (21 commits)
  res_counter: Account max_usage when calling res_counter_charge_nofail()
  res_counter: Merge res_counter_charge and res_counter_charge_nofail
  cgroups: disallow attaching kthreadd or PF_THREAD_BOUND threads
  cgroup: remove cgroup_subsys-&gt;populate()
  cgroup: get rid of populate for memcg
  cgroup: pass struct mem_cgroup instead of struct cgroup to socket memcg
  cgroup: make css-&gt;refcnt clearing on cgroup removal optional
  cgroup: use negative bias on css-&gt;refcnt to block css_tryget()
  cgroup: implement cgroup_rm_cftypes()
  cgroup: introduce struct cfent
  cgroup: relocate __d_cgrp() and __d_cft()
  cgroup: remove cgroup_add_file[s]()
  cgroup: convert memcg controller to the new cftype interface
  memcg: always create memsw files if CONFIG_CGROUP_MEM_RES_CTLR_SWAP
  cgroup: convert all non-memcg controllers to the new cftype interface
  cgroup: relocate cftype and cgroup_subsys definitions in controllers
  cgroup: merge cft_release_agent cftype array into the base files array
  cgroup: implement cgroup_add_cftypes() and friends
  cgroup: build list of all cgroups under a given cgroupfs_root
  cgroup: move cgroup_clear_directory() call out of cgroup_populate_dir()
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull cgroup updates from Tejun Heo:
 "cgroup file type addition / removal is updated so that file types are
  added and removed instead of individual files so that dynamic file
  type addition / removal can be implemented by cgroup and used by
  controllers.  blkio controller changes which will come through block
  tree are dependent on this.  Other changes include res_counter cleanup
  and disallowing kthread / PF_THREAD_BOUND threads to be attached to
  non-root cgroups.

  There's a reported bug with the file type addition / removal handling
  which can lead to oops on cgroup umount.  The issue is being looked
  into.  It shouldn't cause problems for most setups and isn't a
  security concern."

Fix up trivial conflict in Documentation/feature-removal-schedule.txt

* 'for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (21 commits)
  res_counter: Account max_usage when calling res_counter_charge_nofail()
  res_counter: Merge res_counter_charge and res_counter_charge_nofail
  cgroups: disallow attaching kthreadd or PF_THREAD_BOUND threads
  cgroup: remove cgroup_subsys-&gt;populate()
  cgroup: get rid of populate for memcg
  cgroup: pass struct mem_cgroup instead of struct cgroup to socket memcg
  cgroup: make css-&gt;refcnt clearing on cgroup removal optional
  cgroup: use negative bias on css-&gt;refcnt to block css_tryget()
  cgroup: implement cgroup_rm_cftypes()
  cgroup: introduce struct cfent
  cgroup: relocate __d_cgrp() and __d_cft()
  cgroup: remove cgroup_add_file[s]()
  cgroup: convert memcg controller to the new cftype interface
  memcg: always create memsw files if CONFIG_CGROUP_MEM_RES_CTLR_SWAP
  cgroup: convert all non-memcg controllers to the new cftype interface
  cgroup: relocate cftype and cgroup_subsys definitions in controllers
  cgroup: merge cft_release_agent cftype array into the base files array
  cgroup: implement cgroup_add_cftypes() and friends
  cgroup: build list of all cgroups under a given cgroupfs_root
  cgroup: move cgroup_clear_directory() call out of cgroup_populate_dir()
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>net: include/net/sock.h cleanup</title>
<updated>2012-05-17T08:50:21+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-05-16T22:48:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dc6b9b78234fecdc6d2ca5e1629185718202bcf5'/>
<id>dc6b9b78234fecdc6d2ca5e1629185718202bcf5</id>
<content type='text'>
bool/const conversions where possible

__inline__ -&gt; inline

space cleanups

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
bool/const conversions where possible

__inline__ -&gt; inline

space cleanups

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: sock_flag() cleanup</title>
<updated>2012-05-16T19:30:26+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-05-16T05:57:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1b23a5dfc20469d4a4bb8a552dd224ac693c407c'/>
<id>1b23a5dfc20469d4a4bb8a552dd224ac693c407c</id>
<content type='text'>
- sock_flag() accepts a const pointer

- sock_flag() returns a boolean

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- sock_flag() accepts a const pointer

- sock_flag() returns a boolean

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2012-05-08T03:35:40+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-05-08T03:35:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0d6c4a2e4641bbc556dd74d3aa158c413a972492'/>
<id>0d6c4a2e4641bbc556dd74d3aa158c413a972492</id>
<content type='text'>
Conflicts:
	drivers/net/ethernet/intel/e1000e/param.c
	drivers/net/wireless/iwlwifi/iwl-agn-rx.c
	drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
	drivers/net/wireless/iwlwifi/iwl-trans.h

Resolved the iwlwifi conflict with mainline using 3-way diff posted
by John Linville and Stephen Rothwell.  In 'net' we added a bug
fix to make iwlwifi report a more accurate skb-&gt;truesize but this
conflicted with RX path changes that happened meanwhile in net-next.

In e1000e a conflict arose in the validation code for settings of
adapter-&gt;itr.  'net-next' had more sophisticated logic so that
logic was used.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	drivers/net/ethernet/intel/e1000e/param.c
	drivers/net/wireless/iwlwifi/iwl-agn-rx.c
	drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
	drivers/net/wireless/iwlwifi/iwl-trans.h

Resolved the iwlwifi conflict with mainline using 3-way diff posted
by John Linville and Stephen Rothwell.  In 'net' we added a bug
fix to make iwlwifi report a more accurate skb-&gt;truesize but this
conflicted with RX path changes that happened meanwhile in net-next.

In e1000e a conflict arose in the validation code for settings of
adapter-&gt;itr.  'net-next' had more sophisticated logic so that
logic was used.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: fix sk_sockets_allocated_read_positive</title>
<updated>2012-04-30T17:37:59+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-04-28T23:21:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=518fbf9cdf17875d808596afd77fc115a6f942ca'/>
<id>518fbf9cdf17875d808596afd77fc115a6f942ca</id>
<content type='text'>
Denys Fedoryshchenko reported frequent crashes on a proxy server and kindly
provided a lockdep report that explains it all :

  [  762.903868]
  [  762.903880] =================================
  [  762.903890] [ INFO: inconsistent lock state ]
  [  762.903903] 3.3.4-build-0061 #8 Not tainted
  [  762.904133] ---------------------------------
  [  762.904344] inconsistent {IN-SOFTIRQ-W} -&gt; {SOFTIRQ-ON-W} usage.
  [  762.904542] squid/1603 [HC0[0]:SC0[0]:HE1:SE1] takes:
  [  762.904542]  (key#3){+.?...}, at: [&lt;c0232cc4&gt;]
__percpu_counter_sum+0xd/0x58
  [  762.904542] {IN-SOFTIRQ-W} state was registered at:
  [  762.904542]   [&lt;c0158b84&gt;] __lock_acquire+0x284/0xc26
  [  762.904542]   [&lt;c01598e8&gt;] lock_acquire+0x71/0x85
  [  762.904542]   [&lt;c0349765&gt;] _raw_spin_lock+0x33/0x40
  [  762.904542]   [&lt;c0232c93&gt;] __percpu_counter_add+0x58/0x7c
  [  762.904542]   [&lt;c02cfde1&gt;] sk_clone_lock+0x1e5/0x200
  [  762.904542]   [&lt;c0303ee4&gt;] inet_csk_clone_lock+0xe/0x78
  [  762.904542]   [&lt;c0315778&gt;] tcp_create_openreq_child+0x1b/0x404
  [  762.904542]   [&lt;c031339c&gt;] tcp_v4_syn_recv_sock+0x32/0x1c1
  [  762.904542]   [&lt;c031615a&gt;] tcp_check_req+0x1fd/0x2d7
  [  762.904542]   [&lt;c0313f77&gt;] tcp_v4_do_rcv+0xab/0x194
  [  762.904542]   [&lt;c03153bb&gt;] tcp_v4_rcv+0x3b3/0x5cc
  [  762.904542]   [&lt;c02fc0c4&gt;] ip_local_deliver_finish+0x13a/0x1e9
  [  762.904542]   [&lt;c02fc539&gt;] NF_HOOK.clone.11+0x46/0x4d
  [  762.904542]   [&lt;c02fc652&gt;] ip_local_deliver+0x41/0x45
  [  762.904542]   [&lt;c02fc4d1&gt;] ip_rcv_finish+0x31a/0x33c
  [  762.904542]   [&lt;c02fc539&gt;] NF_HOOK.clone.11+0x46/0x4d
  [  762.904542]   [&lt;c02fc857&gt;] ip_rcv+0x201/0x23e
  [  762.904542]   [&lt;c02daa3a&gt;] __netif_receive_skb+0x319/0x368
  [  762.904542]   [&lt;c02dac07&gt;] netif_receive_skb+0x4e/0x7d
  [  762.904542]   [&lt;c02dacf6&gt;] napi_skb_finish+0x1e/0x34
  [  762.904542]   [&lt;c02db122&gt;] napi_gro_receive+0x20/0x24
  [  762.904542]   [&lt;f85d1743&gt;] e1000_receive_skb+0x3f/0x45 [e1000e]
  [  762.904542]   [&lt;f85d3464&gt;] e1000_clean_rx_irq+0x1f9/0x284 [e1000e]
  [  762.904542]   [&lt;f85d3926&gt;] e1000_clean+0x62/0x1f4 [e1000e]
  [  762.904542]   [&lt;c02db228&gt;] net_rx_action+0x90/0x160
  [  762.904542]   [&lt;c012a445&gt;] __do_softirq+0x7b/0x118
  [  762.904542] irq event stamp: 156915469
  [  762.904542] hardirqs last  enabled at (156915469): [&lt;c019b4f4&gt;]
__slab_alloc.clone.58.clone.63+0xc4/0x2de
  [  762.904542] hardirqs last disabled at (156915468): [&lt;c019b452&gt;]
__slab_alloc.clone.58.clone.63+0x22/0x2de
  [  762.904542] softirqs last  enabled at (156915466): [&lt;c02ce677&gt;]
lock_sock_nested+0x64/0x6c
  [  762.904542] softirqs last disabled at (156915464): [&lt;c0349914&gt;]
_raw_spin_lock_bh+0xe/0x45
  [  762.904542]
  [  762.904542] other info that might help us debug this:
  [  762.904542]  Possible unsafe locking scenario:
  [  762.904542]
  [  762.904542]        CPU0
  [  762.904542]        ----
  [  762.904542]   lock(key#3);
  [  762.904542]   &lt;Interrupt&gt;
  [  762.904542]     lock(key#3);
  [  762.904542]
  [  762.904542]  *** DEADLOCK ***
  [  762.904542]
  [  762.904542] 1 lock held by squid/1603:
  [  762.904542]  #0:  (sk_lock-AF_INET){+.+.+.}, at: [&lt;c03055c0&gt;]
lock_sock+0xa/0xc
  [  762.904542]
  [  762.904542] stack backtrace:
  [  762.904542] Pid: 1603, comm: squid Not tainted 3.3.4-build-0061 #8
  [  762.904542] Call Trace:
  [  762.904542]  [&lt;c0347b73&gt;] ? printk+0x18/0x1d
  [  762.904542]  [&lt;c015873a&gt;] valid_state+0x1f6/0x201
  [  762.904542]  [&lt;c0158816&gt;] mark_lock+0xd1/0x1bb
  [  762.904542]  [&lt;c015876b&gt;] ? mark_lock+0x26/0x1bb
  [  762.904542]  [&lt;c015805d&gt;] ? check_usage_forwards+0x77/0x77
  [  762.904542]  [&lt;c0158bf8&gt;] __lock_acquire+0x2f8/0xc26
  [  762.904542]  [&lt;c0159b8e&gt;] ? mark_held_locks+0x5d/0x7b
  [  762.904542]  [&lt;c0159cf6&gt;] ? trace_hardirqs_on+0xb/0xd
  [  762.904542]  [&lt;c0158dd4&gt;] ? __lock_acquire+0x4d4/0xc26
  [  762.904542]  [&lt;c01598e8&gt;] lock_acquire+0x71/0x85
  [  762.904542]  [&lt;c0232cc4&gt;] ? __percpu_counter_sum+0xd/0x58
  [  762.904542]  [&lt;c0349765&gt;] _raw_spin_lock+0x33/0x40
  [  762.904542]  [&lt;c0232cc4&gt;] ? __percpu_counter_sum+0xd/0x58
  [  762.904542]  [&lt;c0232cc4&gt;] __percpu_counter_sum+0xd/0x58
  [  762.904542]  [&lt;c02cebc4&gt;] __sk_mem_schedule+0xdd/0x1c7
  [  762.904542]  [&lt;c02d178d&gt;] ? __alloc_skb+0x76/0x100
  [  762.904542]  [&lt;c0305e8e&gt;] sk_wmem_schedule+0x21/0x2d
  [  762.904542]  [&lt;c0306370&gt;] sk_stream_alloc_skb+0x42/0xaa
  [  762.904542]  [&lt;c0306567&gt;] tcp_sendmsg+0x18f/0x68b
  [  762.904542]  [&lt;c031f3dc&gt;] ? ip_fast_csum+0x30/0x30
  [  762.904542]  [&lt;c0320193&gt;] inet_sendmsg+0x53/0x5a
  [  762.904542]  [&lt;c02cb633&gt;] sock_aio_write+0xd2/0xda
  [  762.904542]  [&lt;c015876b&gt;] ? mark_lock+0x26/0x1bb
  [  762.904542]  [&lt;c01a1017&gt;] do_sync_write+0x9f/0xd9
  [  762.904542]  [&lt;c01a2111&gt;] ? file_free_rcu+0x2f/0x2f
  [  762.904542]  [&lt;c01a17a1&gt;] vfs_write+0x8f/0xab
  [  762.904542]  [&lt;c01a284d&gt;] ? fget_light+0x75/0x7c
  [  762.904542]  [&lt;c01a1900&gt;] sys_write+0x3d/0x5e
  [  762.904542]  [&lt;c0349ec9&gt;] syscall_call+0x7/0xb
  [  762.904542]  [&lt;c0340000&gt;] ? rp_sidt+0x41/0x83

Bug is that sk_sockets_allocated_read_positive() calls
percpu_counter_sum_positive() without BH being disabled.

This bug was added in commit 180d8cd942ce33
(foundations of per-cgroup memory pressure controlling.), since previous
code was using percpu_counter_read_positive() which is IRQ safe.

In __sk_mem_schedule() we dont need the precise count of allocated
sockets and can revert to previous behavior.

Reported-by: Denys Fedoryshchenko &lt;denys@visp.net.lb&gt;
Sined-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Glauber Costa &lt;glommer@parallels.com&gt;
Acked-by: Neal Cardwell &lt;ncardwell@google.com&gt;

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Denys Fedoryshchenko reported frequent crashes on a proxy server and kindly
provided a lockdep report that explains it all :

  [  762.903868]
  [  762.903880] =================================
  [  762.903890] [ INFO: inconsistent lock state ]
  [  762.903903] 3.3.4-build-0061 #8 Not tainted
  [  762.904133] ---------------------------------
  [  762.904344] inconsistent {IN-SOFTIRQ-W} -&gt; {SOFTIRQ-ON-W} usage.
  [  762.904542] squid/1603 [HC0[0]:SC0[0]:HE1:SE1] takes:
  [  762.904542]  (key#3){+.?...}, at: [&lt;c0232cc4&gt;]
__percpu_counter_sum+0xd/0x58
  [  762.904542] {IN-SOFTIRQ-W} state was registered at:
  [  762.904542]   [&lt;c0158b84&gt;] __lock_acquire+0x284/0xc26
  [  762.904542]   [&lt;c01598e8&gt;] lock_acquire+0x71/0x85
  [  762.904542]   [&lt;c0349765&gt;] _raw_spin_lock+0x33/0x40
  [  762.904542]   [&lt;c0232c93&gt;] __percpu_counter_add+0x58/0x7c
  [  762.904542]   [&lt;c02cfde1&gt;] sk_clone_lock+0x1e5/0x200
  [  762.904542]   [&lt;c0303ee4&gt;] inet_csk_clone_lock+0xe/0x78
  [  762.904542]   [&lt;c0315778&gt;] tcp_create_openreq_child+0x1b/0x404
  [  762.904542]   [&lt;c031339c&gt;] tcp_v4_syn_recv_sock+0x32/0x1c1
  [  762.904542]   [&lt;c031615a&gt;] tcp_check_req+0x1fd/0x2d7
  [  762.904542]   [&lt;c0313f77&gt;] tcp_v4_do_rcv+0xab/0x194
  [  762.904542]   [&lt;c03153bb&gt;] tcp_v4_rcv+0x3b3/0x5cc
  [  762.904542]   [&lt;c02fc0c4&gt;] ip_local_deliver_finish+0x13a/0x1e9
  [  762.904542]   [&lt;c02fc539&gt;] NF_HOOK.clone.11+0x46/0x4d
  [  762.904542]   [&lt;c02fc652&gt;] ip_local_deliver+0x41/0x45
  [  762.904542]   [&lt;c02fc4d1&gt;] ip_rcv_finish+0x31a/0x33c
  [  762.904542]   [&lt;c02fc539&gt;] NF_HOOK.clone.11+0x46/0x4d
  [  762.904542]   [&lt;c02fc857&gt;] ip_rcv+0x201/0x23e
  [  762.904542]   [&lt;c02daa3a&gt;] __netif_receive_skb+0x319/0x368
  [  762.904542]   [&lt;c02dac07&gt;] netif_receive_skb+0x4e/0x7d
  [  762.904542]   [&lt;c02dacf6&gt;] napi_skb_finish+0x1e/0x34
  [  762.904542]   [&lt;c02db122&gt;] napi_gro_receive+0x20/0x24
  [  762.904542]   [&lt;f85d1743&gt;] e1000_receive_skb+0x3f/0x45 [e1000e]
  [  762.904542]   [&lt;f85d3464&gt;] e1000_clean_rx_irq+0x1f9/0x284 [e1000e]
  [  762.904542]   [&lt;f85d3926&gt;] e1000_clean+0x62/0x1f4 [e1000e]
  [  762.904542]   [&lt;c02db228&gt;] net_rx_action+0x90/0x160
  [  762.904542]   [&lt;c012a445&gt;] __do_softirq+0x7b/0x118
  [  762.904542] irq event stamp: 156915469
  [  762.904542] hardirqs last  enabled at (156915469): [&lt;c019b4f4&gt;]
__slab_alloc.clone.58.clone.63+0xc4/0x2de
  [  762.904542] hardirqs last disabled at (156915468): [&lt;c019b452&gt;]
__slab_alloc.clone.58.clone.63+0x22/0x2de
  [  762.904542] softirqs last  enabled at (156915466): [&lt;c02ce677&gt;]
lock_sock_nested+0x64/0x6c
  [  762.904542] softirqs last disabled at (156915464): [&lt;c0349914&gt;]
_raw_spin_lock_bh+0xe/0x45
  [  762.904542]
  [  762.904542] other info that might help us debug this:
  [  762.904542]  Possible unsafe locking scenario:
  [  762.904542]
  [  762.904542]        CPU0
  [  762.904542]        ----
  [  762.904542]   lock(key#3);
  [  762.904542]   &lt;Interrupt&gt;
  [  762.904542]     lock(key#3);
  [  762.904542]
  [  762.904542]  *** DEADLOCK ***
  [  762.904542]
  [  762.904542] 1 lock held by squid/1603:
  [  762.904542]  #0:  (sk_lock-AF_INET){+.+.+.}, at: [&lt;c03055c0&gt;]
lock_sock+0xa/0xc
  [  762.904542]
  [  762.904542] stack backtrace:
  [  762.904542] Pid: 1603, comm: squid Not tainted 3.3.4-build-0061 #8
  [  762.904542] Call Trace:
  [  762.904542]  [&lt;c0347b73&gt;] ? printk+0x18/0x1d
  [  762.904542]  [&lt;c015873a&gt;] valid_state+0x1f6/0x201
  [  762.904542]  [&lt;c0158816&gt;] mark_lock+0xd1/0x1bb
  [  762.904542]  [&lt;c015876b&gt;] ? mark_lock+0x26/0x1bb
  [  762.904542]  [&lt;c015805d&gt;] ? check_usage_forwards+0x77/0x77
  [  762.904542]  [&lt;c0158bf8&gt;] __lock_acquire+0x2f8/0xc26
  [  762.904542]  [&lt;c0159b8e&gt;] ? mark_held_locks+0x5d/0x7b
  [  762.904542]  [&lt;c0159cf6&gt;] ? trace_hardirqs_on+0xb/0xd
  [  762.904542]  [&lt;c0158dd4&gt;] ? __lock_acquire+0x4d4/0xc26
  [  762.904542]  [&lt;c01598e8&gt;] lock_acquire+0x71/0x85
  [  762.904542]  [&lt;c0232cc4&gt;] ? __percpu_counter_sum+0xd/0x58
  [  762.904542]  [&lt;c0349765&gt;] _raw_spin_lock+0x33/0x40
  [  762.904542]  [&lt;c0232cc4&gt;] ? __percpu_counter_sum+0xd/0x58
  [  762.904542]  [&lt;c0232cc4&gt;] __percpu_counter_sum+0xd/0x58
  [  762.904542]  [&lt;c02cebc4&gt;] __sk_mem_schedule+0xdd/0x1c7
  [  762.904542]  [&lt;c02d178d&gt;] ? __alloc_skb+0x76/0x100
  [  762.904542]  [&lt;c0305e8e&gt;] sk_wmem_schedule+0x21/0x2d
  [  762.904542]  [&lt;c0306370&gt;] sk_stream_alloc_skb+0x42/0xaa
  [  762.904542]  [&lt;c0306567&gt;] tcp_sendmsg+0x18f/0x68b
  [  762.904542]  [&lt;c031f3dc&gt;] ? ip_fast_csum+0x30/0x30
  [  762.904542]  [&lt;c0320193&gt;] inet_sendmsg+0x53/0x5a
  [  762.904542]  [&lt;c02cb633&gt;] sock_aio_write+0xd2/0xda
  [  762.904542]  [&lt;c015876b&gt;] ? mark_lock+0x26/0x1bb
  [  762.904542]  [&lt;c01a1017&gt;] do_sync_write+0x9f/0xd9
  [  762.904542]  [&lt;c01a2111&gt;] ? file_free_rcu+0x2f/0x2f
  [  762.904542]  [&lt;c01a17a1&gt;] vfs_write+0x8f/0xab
  [  762.904542]  [&lt;c01a284d&gt;] ? fget_light+0x75/0x7c
  [  762.904542]  [&lt;c01a1900&gt;] sys_write+0x3d/0x5e
  [  762.904542]  [&lt;c0349ec9&gt;] syscall_call+0x7/0xb
  [  762.904542]  [&lt;c0340000&gt;] ? rp_sidt+0x41/0x83

Bug is that sk_sockets_allocated_read_positive() calls
percpu_counter_sum_positive() without BH being disabled.

This bug was added in commit 180d8cd942ce33
(foundations of per-cgroup memory pressure controlling.), since previous
code was using percpu_counter_read_positive() which is IRQ safe.

In __sk_mem_schedule() we dont need the precise count of allocated
sockets and can revert to previous behavior.

Reported-by: Denys Fedoryshchenko &lt;denys@visp.net.lb&gt;
Sined-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Glauber Costa &lt;glommer@parallels.com&gt;
Acked-by: Neal Cardwell &lt;ncardwell@google.com&gt;

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2012-04-24T03:15:17+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-04-24T03:14:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f24001941c99776f41bd3f09c07d91205c2ad9d4'/>
<id>f24001941c99776f41bd3f09c07d91205c2ad9d4</id>
<content type='text'>
Fix merge between commit 3adadc08cc1e ("net ax25: Reorder ax25_exit to
remove races") and commit 0ca7a4c87d27 ("net ax25: Simplify and
cleanup the ax25 sysctl handling")

The former moved around the sysctl register/unregister calls, the
later simply removed them.

With help from Stephen Rothwell.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix merge between commit 3adadc08cc1e ("net ax25: Reorder ax25_exit to
remove races") and commit 0ca7a4c87d27 ("net ax25: Simplify and
cleanup the ax25 sysctl handling")

The former moved around the sysctl register/unregister calls, the
later simply removed them.

With help from Stephen Rothwell.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: add a limit parameter to sk_add_backlog()</title>
<updated>2012-04-24T02:28:28+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-04-22T23:34:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f545a38f74584cc7424cb74f792a00c6d2589485'/>
<id>f545a38f74584cc7424cb74f792a00c6d2589485</id>
<content type='text'>
sk_add_backlog() &amp; sk_rcvqueues_full() hard coded sk_rcvbuf as the
memory limit. We need to make this limit a parameter for TCP use.

No functional change expected in this patch, all callers still using the
old sk_rcvbuf limit.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Neal Cardwell &lt;ncardwell@google.com&gt;
Cc: Tom Herbert &lt;therbert@google.com&gt;
Cc: Maciej Żenczykowski &lt;maze@google.com&gt;
Cc: Yuchung Cheng &lt;ycheng@google.com&gt;
Cc: Ilpo Järvinen &lt;ilpo.jarvinen@helsinki.fi&gt;
Cc: Rick Jones &lt;rick.jones2@hp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sk_add_backlog() &amp; sk_rcvqueues_full() hard coded sk_rcvbuf as the
memory limit. We need to make this limit a parameter for TCP use.

No functional change expected in this patch, all callers still using the
old sk_rcvbuf limit.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Neal Cardwell &lt;ncardwell@google.com&gt;
Cc: Tom Herbert &lt;therbert@google.com&gt;
Cc: Maciej Żenczykowski &lt;maze@google.com&gt;
Cc: Yuchung Cheng &lt;ycheng@google.com&gt;
Cc: Ilpo Järvinen &lt;ilpo.jarvinen@helsinki.fi&gt;
Cc: Rick Jones &lt;rick.jones2@hp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sock: Introduce named constants for sk_reuse</title>
<updated>2012-04-21T19:52:25+00:00</updated>
<author>
<name>Pavel Emelyanov</name>
<email>xemul@parallels.com</email>
</author>
<published>2012-04-19T03:39:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4a17fd5229c1b6066aa478f6b690f8293ce811a1'/>
<id>4a17fd5229c1b6066aa478f6b690f8293ce811a1</id>
<content type='text'>
Name them in a "backward compatible" manner, i.e. reuse or not
are still 1 and 0 respectively. The reuse value of 2 means that
the socket with it will forcibly reuse everyone else's port.

Signed-off-by: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Name them in a "backward compatible" manner, i.e. reuse or not
are still 1 and 0 respectively. The reuse value of 2 means that
the socket with it will forcibly reuse everyone else's port.

Signed-off-by: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net/sock.h: fix sk_peek_off kernel-doc warning</title>
<updated>2012-04-18T02:32:00+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@xenotime.net</email>
</author>
<published>2012-04-17T14:03:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d3d4f0a025e621b82da08a76df4036d4267739dd'/>
<id>d3d4f0a025e621b82da08a76df4036d4267739dd</id>
<content type='text'>
Fix kernel-doc warning in net/sock.h:

Warning(include/net/sock.h:377): No description found for parameter 'sk_peek_off'

Signed-off-by: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix kernel-doc warning in net/sock.h:

Warning(include/net/sock.h:377): No description found for parameter 'sk_peek_off'

Signed-off-by: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
