Commit 2311e06
virtio_net: fix missing dma unmap for resize
For rq, we have three cases getting buffers from virtio core:
1. virtqueue_get_buf{,_ctx}
2. virtqueue_detach_unused_buf
3. callback for virtqueue_resize
But in commit 295525e("virtio_net: merge dma operations when
filling mergeable buffers"), I missed the dma unmap for the SamirMulani#3 case.
That will leak some memory, because I did not release the pages referred
by the unused buffers.
If we do such script, we will make the system OOM.
while true
do
ethtool -G ens4 rx 128
ethtool -G ens4 rx 256
free -m
done
Fixes: 295525e ("virtio_net: merge dma operations when filling mergeable buffers")
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/r/20231226094333.47740-1-xuanzhuo@linux.alibaba.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 01b2885 commit 2311e06
1 file changed
+30
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | 337 | | |
339 | 338 | | |
340 | 339 | | |
| |||
408 | 407 | | |
409 | 408 | | |
410 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
411 | 421 | | |
412 | 422 | | |
413 | 423 | | |
| |||
634 | 644 | | |
635 | 645 | | |
636 | 646 | | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | 647 | | |
649 | 648 | | |
650 | 649 | | |
| |||
744 | 743 | | |
745 | 744 | | |
746 | 745 | | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
747 | 760 | | |
748 | 761 | | |
749 | 762 | | |
| |||
1764 | 1777 | | |
1765 | 1778 | | |
1766 | 1779 | | |
1767 | | - | |
| 1780 | + | |
1768 | 1781 | | |
1769 | 1782 | | |
1770 | 1783 | | |
| |||
2392 | 2405 | | |
2393 | 2406 | | |
2394 | 2407 | | |
2395 | | - | |
| 2408 | + | |
2396 | 2409 | | |
2397 | 2410 | | |
2398 | 2411 | | |
| |||
4031 | 4044 | | |
4032 | 4045 | | |
4033 | 4046 | | |
4034 | | - | |
4035 | | - | |
4036 | | - | |
4037 | | - | |
4038 | | - | |
4039 | | - | |
4040 | | - | |
4041 | | - | |
4042 | | - | |
4043 | | - | |
4044 | | - | |
4045 | | - | |
4046 | | - | |
4047 | 4047 | | |
4048 | 4048 | | |
4049 | 4049 | | |
| |||
4057 | 4057 | | |
4058 | 4058 | | |
4059 | 4059 | | |
4060 | | - | |
| 4060 | + | |
4061 | 4061 | | |
4062 | | - | |
4063 | | - | |
| 4062 | + | |
| 4063 | + | |
4064 | 4064 | | |
4065 | 4065 | | |
4066 | 4066 | | |
| |||
0 commit comments