Commit a2e740e
vmalloc: fix accounting with i915
If the caller of vmap() specifies VM_MAP_PUT_PAGES (currently only the
i915 driver), we will decrement nr_vmalloc_pages and MEMCG_VMALLOC in
vfree(). These counters are incremented by vmalloc() but not by vmap() so
this will cause an underflow. Check the VM_MAP_PUT_PAGES flag before
decrementing either counter.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: b944afc ("mm: add a VM_MAP_PUT_PAGES flag for vmap")
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Reviewed-by: Shakeel Butt <[email protected]>
Reviewed-by: Balbir Singh <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: "Uladzislau Rezki (Sony)" <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent faeec8e commit a2e740e
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3374 | 3374 | | |
3375 | 3375 | | |
3376 | 3376 | | |
3377 | | - | |
| 3377 | + | |
| 3378 | + | |
3378 | 3379 | | |
3379 | 3380 | | |
3380 | 3381 | | |
3381 | 3382 | | |
3382 | 3383 | | |
3383 | 3384 | | |
3384 | 3385 | | |
3385 | | - | |
| 3386 | + | |
| 3387 | + | |
3386 | 3388 | | |
3387 | 3389 | | |
3388 | 3390 | | |
| |||
0 commit comments