Commit 9812386
Treewide: Stop corrupting socket's task_frag
Since moving to memalloc_nofs_save/restore, SUNRPC has stopped setting the
GFP_NOIO flag on sk_allocation which the networking system uses to decide
when it is safe to use current->task_frag. The results of this are
unexpected corruption in task_frag when SUNRPC is involved in memory
reclaim.
The corruption can be seen in crashes, but the root cause is often
difficult to ascertain as a crashing machine's stack trace will have no
evidence of being near NFS or SUNRPC code. I believe this problem to
be much more pervasive than reports to the community may indicate.
Fix this by having kernel users of sockets that may corrupt task_frag due
to reclaim set sk_use_task_frag = false. Preemptively correcting this
situation for users that still set sk_allocation allows them to convert to
memalloc_nofs_save/restore without the same unexpected corruptions that are
sure to follow, unlikely to show up in testing, and difficult to bisect.
CC: Philipp Reisner <[email protected]>
CC: Lars Ellenberg <[email protected]>
CC: "Christoph Böhmwalder" <[email protected]>
CC: Jens Axboe <[email protected]>
CC: Josef Bacik <[email protected]>
CC: Keith Busch <[email protected]>
CC: Christoph Hellwig <[email protected]>
CC: Sagi Grimberg <[email protected]>
CC: Lee Duncan <[email protected]>
CC: Chris Leech <[email protected]>
CC: Mike Christie <[email protected]>
CC: "James E.J. Bottomley" <[email protected]>
CC: "Martin K. Petersen" <[email protected]>
CC: Valentina Manea <[email protected]>
CC: Shuah Khan <[email protected]>
CC: Greg Kroah-Hartman <[email protected]>
CC: David Howells <[email protected]>
CC: Marc Dionne <[email protected]>
CC: Steve French <[email protected]>
CC: Christine Caulfield <[email protected]>
CC: David Teigland <[email protected]>
CC: Mark Fasheh <[email protected]>
CC: Joel Becker <[email protected]>
CC: Joseph Qi <[email protected]>
CC: Eric Van Hensbergen <[email protected]>
CC: Latchesar Ionkov <[email protected]>
CC: Dominique Martinet <[email protected]>
CC: Ilya Dryomov <[email protected]>
CC: Xiubo Li <[email protected]>
CC: Chuck Lever <[email protected]>
CC: Jeff Layton <[email protected]>
CC: Trond Myklebust <[email protected]>
CC: Anna Schumaker <[email protected]>
CC: Steffen Klassert <[email protected]>
CC: Herbert Xu <[email protected]>
Suggested-by: Guillaume Nault <[email protected]>
Signed-off-by: Benjamin Coddington <[email protected]>
Reviewed-by: Guillaume Nault <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>1 parent fb87bd4 commit 9812386
File tree
12 files changed
+17
-0
lines changed- drivers
- block
- drbd
- nvme/host
- scsi
- usb/usbip
- fs
- cifs
- dlm
- ocfs2/cluster
- net
- 9p
- ceph
- sunrpc
- xfrm
12 files changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
1033 | 1036 | | |
1034 | 1037 | | |
1035 | 1038 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
515 | 516 | | |
516 | 517 | | |
517 | 518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1537 | 1537 | | |
1538 | 1538 | | |
1539 | 1539 | | |
| 1540 | + | |
1540 | 1541 | | |
1541 | 1542 | | |
1542 | 1543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| 741 | + | |
741 | 742 | | |
742 | 743 | | |
743 | 744 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| 318 | + | |
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2944 | 2944 | | |
2945 | 2945 | | |
2946 | 2946 | | |
| 2947 | + | |
2947 | 2948 | | |
2948 | 2949 | | |
2949 | 2950 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
| 648 | + | |
648 | 649 | | |
649 | 650 | | |
650 | 651 | | |
| |||
1769 | 1770 | | |
1770 | 1771 | | |
1771 | 1772 | | |
| 1773 | + | |
1772 | 1774 | | |
1773 | 1775 | | |
1774 | 1776 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1602 | 1602 | | |
1603 | 1603 | | |
1604 | 1604 | | |
| 1605 | + | |
1605 | 1606 | | |
1606 | 1607 | | |
1607 | 1608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
| 871 | + | |
871 | 872 | | |
872 | 873 | | |
873 | 874 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
449 | 450 | | |
450 | 451 | | |
451 | 452 | | |
| |||
0 commit comments