]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/net/sock.h
tcp: add TCPMemoryPressuresChrono counter
[karo-tx-linux.git] / include / net / sock.h
index 3467d9e89e7dba1c35fa44a6268a28735f795319..858891c36f94ad2577726d6d21cf871dbcd55d98 100644 (file)
@@ -1080,6 +1080,7 @@ struct proto {
        bool                    (*stream_memory_free)(const struct sock *sk);
        /* Memory pressure */
        void                    (*enter_memory_pressure)(struct sock *sk);
+       void                    (*leave_memory_pressure)(struct sock *sk);
        atomic_long_t           *memory_allocated;      /* Current allocated memory. */
        struct percpu_counter   *sockets_allocated;     /* Current number of sockets. */
        /*
@@ -1088,7 +1089,7 @@ struct proto {
         * All the __sk_mem_schedule() is of this nature: accounting
         * is strict, actions are advisory and have some latency.
         */
-       int                     *memory_pressure;
+       unsigned long           *memory_pressure;
        long                    *sysctl_mem;
        int                     *sysctl_wmem;
        int                     *sysctl_rmem;
@@ -1193,25 +1194,6 @@ static inline bool sk_under_memory_pressure(const struct sock *sk)
        return !!*sk->sk_prot->memory_pressure;
 }
 
-static inline void sk_leave_memory_pressure(struct sock *sk)
-{
-       int *memory_pressure = sk->sk_prot->memory_pressure;
-
-       if (!memory_pressure)
-               return;
-
-       if (*memory_pressure)
-               *memory_pressure = 0;
-}
-
-static inline void sk_enter_memory_pressure(struct sock *sk)
-{
-       if (!sk->sk_prot->enter_memory_pressure)
-               return;
-
-       sk->sk_prot->enter_memory_pressure(sk);
-}
-
 static inline long
 sk_memory_allocated(const struct sock *sk)
 {