netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] sctp: fully support memory accounting
@ 2019-03-31  8:53 Xin Long
  2019-03-31  8:53 ` [PATCH net-next 1/2] sctp: implement memory accounting on tx path Xin Long
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Xin Long @ 2019-03-31  8:53 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: Marcelo Ricardo Leitner, Neil Horman, davem, Matteo Croce, Vladis Dronov

sctp memory accounting is added in this patchset by using
these kernel APIs on send side:

  - sk_mem_charge()
  - sk_mem_uncharge()
  - sk_wmem_schedule()
  - sk_under_memory_pressure()
  - sk_mem_reclaim()

and these on receive side:

  - sk_mem_charge()
  - sk_mem_uncharge()
  - sk_rmem_schedule()
  - sk_under_memory_pressure()
  - sk_mem_reclaim()

With sctp memory accounting, we can limit the memory allocation by
either sysctl:

  # sysctl -w net.sctp.sctp_mem="10 20 50"

or cgroup:

  # echo $((8<<14)) > \
    /sys/fs/cgroup/memory/sctp_mem/memory.kmem.tcp.limit_in_bytes

When the socket is under memory pressure, the send side will block
and wait, while the receive side will renege or drop.

Xin Long (2):
  sctp: implement memory accounting on tx path
  sctp: implement memory accounting on rx path

 include/net/sctp/sctp.h |  2 +-
 net/sctp/sm_statefuns.c |  6 ++++--
 net/sctp/socket.c       | 10 ++++++++--
 net/sctp/ulpevent.c     | 19 ++++++++-----------
 net/sctp/ulpqueue.c     |  3 ++-
 5 files changed, 23 insertions(+), 17 deletions(-)

-- 
2.1.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-04-05  4:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-31  8:53 [PATCH net-next 0/2] sctp: fully support memory accounting Xin Long
2019-03-31  8:53 ` [PATCH net-next 1/2] sctp: implement memory accounting on tx path Xin Long
2019-03-31  8:53   ` [PATCH net-next 2/2] sctp: implement memory accounting on rx path Xin Long
2019-04-02 11:48     ` Marcelo Ricardo Leitner
2019-04-02 11:48   ` [PATCH net-next 1/2] sctp: implement memory accounting on tx path Marcelo Ricardo Leitner
2019-03-31  8:56 ` [PATCH net-next 0/2] sctp: fully support memory accounting Xin Long
2019-03-31 18:02   ` David Miller
2019-04-04  9:45     ` Xin Long
2019-04-04 17:38       ` David Miller
2019-04-05  4:49         ` Xin Long
2019-03-31 19:22 ` Matteo Croce
2019-03-31 20:10 ` Marcelo Ricardo Leitner
2019-03-31 21:04   ` David Miller
2019-04-01  7:25 ` Xin Long
2019-04-01 11:31 ` Neil Horman
2019-04-02  3:36   ` Marcelo Ricardo Leitner
2019-04-02 11:41     ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).