diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2015-04-02 07:40:58 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-04-07 12:08:35 -0400 |
commit | 6d7fdb0ab351b33d4c12d53fe44be030b90fc9d4 (patch) | |
tree | b4f66c3989448a505ec465a5144b1db36ba11da4 /net/ceph | |
parent | f22e6e847115abc3a0e2ad7bb18d243d42275af1 (diff) |
Revert "libceph: use memalloc flags for net IO"
This reverts commit 89baaa570ab0b476db09408d209578cfed700e9f.
Dirty page throttling should be sufficient for us in the general case
so there is no need to use __GFP_MEMALLOC - it would be needed only in
the swap-over-rbd case, which we currently don't support. (It would
probably take approximately the commit that is being reverted to add
that support, but we would also need the "swap" option to distinguish
from the general case and make sure swap ceph_client-s aren't shared
with anything else.) See ceph-devel threads [1] and [2] for the
details of why enabling pfmemalloc reserves for all cases is a bad
thing.
On top of potential system lockups related to drained emergency
reserves, this turned out to cause ceph lockups in case peers are on
the same host and communicating via loopback due to sk_filter()
dropping pfmemalloc skbs on the receiving side because the receiving
loopback socket is not tagged with SOCK_MEMALLOC.
[1] "SOCK_MEMALLOC vs loopback"
http://www.spinics.net/lists/ceph-devel/msg22998.html
[2] "[PATCH] libceph: don't set memalloc flags in loopback case"
http://www.spinics.net/lists/ceph-devel/msg23392.html
Conflicts:
net/ceph/messenger.c [ context: tcp_nodelay option ]
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Sage Weil <sage@redhat.com>
Cc: stable@vger.kernel.org # 3.18+, needs backporting
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Mel Gorman <mgorman@suse.de>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/messenger.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 6b3f54ed65ba..a9f4ae45b7fb 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -484,7 +484,7 @@ static int ceph_tcp_connect(struct ceph_connection *con) | |||
484 | IPPROTO_TCP, &sock); | 484 | IPPROTO_TCP, &sock); |
485 | if (ret) | 485 | if (ret) |
486 | return ret; | 486 | return ret; |
487 | sock->sk->sk_allocation = GFP_NOFS | __GFP_MEMALLOC; | 487 | sock->sk->sk_allocation = GFP_NOFS; |
488 | 488 | ||
489 | #ifdef CONFIG_LOCKDEP | 489 | #ifdef CONFIG_LOCKDEP |
490 | lockdep_set_class(&sock->sk->sk_lock, &socket_class); | 490 | lockdep_set_class(&sock->sk->sk_lock, &socket_class); |
@@ -520,8 +520,6 @@ static int ceph_tcp_connect(struct ceph_connection *con) | |||
520 | ret); | 520 | ret); |
521 | } | 521 | } |
522 | 522 | ||
523 | sk_set_memalloc(sock->sk); | ||
524 | |||
525 | con->sock = sock; | 523 | con->sock = sock; |
526 | return 0; | 524 | return 0; |
527 | } | 525 | } |
@@ -2808,11 +2806,8 @@ static void con_work(struct work_struct *work) | |||
2808 | { | 2806 | { |
2809 | struct ceph_connection *con = container_of(work, struct ceph_connection, | 2807 | struct ceph_connection *con = container_of(work, struct ceph_connection, |
2810 | work.work); | 2808 | work.work); |
2811 | unsigned long pflags = current->flags; | ||
2812 | bool fault; | 2809 | bool fault; |
2813 | 2810 | ||
2814 | current->flags |= PF_MEMALLOC; | ||
2815 | |||
2816 | mutex_lock(&con->mutex); | 2811 | mutex_lock(&con->mutex); |
2817 | while (true) { | 2812 | while (true) { |
2818 | int ret; | 2813 | int ret; |
@@ -2866,8 +2861,6 @@ static void con_work(struct work_struct *work) | |||
2866 | con_fault_finish(con); | 2861 | con_fault_finish(con); |
2867 | 2862 | ||
2868 | con->ops->put(con); | 2863 | con->ops->put(con); |
2869 | |||
2870 | tsk_restore_flags(current, pflags, PF_MEMALLOC); | ||
2871 | } | 2864 | } |
2872 | 2865 | ||
2873 | /* | 2866 | /* |