Commit 65cd8ac
fs/seq_file: fallback to vmalloc allocation
There are a couple of seq_files which use the single_open() interface.
This interface requires that the whole output must fit into a single
buffer.
E.g. for /proc/stat allocation failures have been observed because an
order-4 memory allocation failed due to memory fragmentation. In such
situations reading /proc/stat is not possible anymore.
Therefore change the seq_file code to fallback to vmalloc allocations
which will usually result in a couple of order-0 allocations and hence
also work if memory is fragmented.
For reference a call trace where reading from /proc/stat failed:
sadc: page allocation failure: order:4, mode:0x1040d0
CPU: 1 PID: 192063 Comm: sadc Not tainted 3.10.0-123.el7.s390x #1
[...]
Call Trace:
show_stack+0x6c/0xe8
warn_alloc_failed+0xd6/0x138
__alloc_pages_nodemask+0x9da/0xb68
__get_free_pages+0x2e/0x58
kmalloc_order_trace+0x44/0xc0
stat_open+0x5a/0xd8
proc_reg_open+0x8a/0x140
do_dentry_open+0x1bc/0x2c8
finish_open+0x46/0x60
do_last+0x382/0x10d0
path_openat+0xc8/0x4f8
do_filp_open+0x46/0xa8
do_sys_open+0x114/0x1f0
sysc_tracego+0x14/0x1a
Conflicts:
fs/seq_file.c
Bug: 17871993
Signed-off-by: Heiko Carstens <[email protected]>
Tested-by: David Rientjes <[email protected]>
Cc: Ian Kent <[email protected]>
Cc: Hendrik Brueckner <[email protected]>
Cc: Thorsten Diehl <[email protected]>
Cc: Andrea Righi <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Stefan Bader <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Git-commit: 058504e
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Change-Id: Iad795a92fee1983c300568429a6283c48625bd9a
Signed-off-by: Jeremy Gebben <[email protected]>
Signed-off-by: Naveen Ramaraj <[email protected]>1 parent 1b8711e commit 65cd8ac
1 file changed
+38
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
32 | 45 | | |
33 | 46 | | |
34 | 47 | | |
| |||
92 | 105 | | |
93 | 106 | | |
94 | 107 | | |
95 | | - | |
| 108 | + | |
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
| |||
131 | 144 | | |
132 | 145 | | |
133 | 146 | | |
134 | | - | |
| 147 | + | |
135 | 148 | | |
136 | | - | |
| 149 | + | |
137 | 150 | | |
138 | 151 | | |
139 | 152 | | |
| |||
188 | 201 | | |
189 | 202 | | |
190 | 203 | | |
191 | | - | |
| 204 | + | |
192 | 205 | | |
193 | 206 | | |
194 | 207 | | |
| |||
228 | 241 | | |
229 | 242 | | |
230 | 243 | | |
231 | | - | |
| 244 | + | |
232 | 245 | | |
233 | | - | |
| 246 | + | |
234 | 247 | | |
235 | 248 | | |
236 | 249 | | |
| |||
346 | 359 | | |
347 | 360 | | |
348 | 361 | | |
349 | | - | |
| 362 | + | |
350 | 363 | | |
351 | 364 | | |
352 | 365 | | |
| |||
588 | 601 | | |
589 | 602 | | |
590 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
591 | 622 | | |
592 | 623 | | |
593 | 624 | | |
| |||
0 commit comments