linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] resctrl high memory comsumption
@ 2020-01-08 17:07 Shakeel Butt
  2020-01-08 20:23 ` Fenghua Yu
  0 siblings, 1 reply; 7+ messages in thread
From: Shakeel Butt @ 2020-01-08 17:07 UTC (permalink / raw)
  To: Reinette Chatre, Fenghua Yu, Borislav Petkov, LKML,
	Thomas Gleixner, Ingo Molnar, x86

Hi,

Recently we had a bug in the system software writing the same pids to
the tasks file of resctrl group multiple times. The resctrl code
allocates "struct task_move_callback" for each such write and call
task_work_add() for that task to handle it on return to user-space
without checking if such request already exist for that particular
task. The issue arises for long sleeping tasks which has thousands for
such request queued to be handled. On our production, we notice
thousands of tasks having thousands of such requests and taking GiBs
of memory for "struct task_move_callback". I am not very familiar with
the code to judge if task_work_cancel() is the right approach or just
checking closid/rmid before doing task_work_add().

==repro==
# mkdir /sys/fs/resctrl/test
# cat /proc/slabinfo | grep kmalloc-32
kmalloc-32         57219  57288     32  124    1 : tunables  120   60
  8 : slabdata    462    462      0
# sleep 600&
[1] 17611
# for i in {1..200000}; do echo 17611 > /sys/fs/resctrl/test/tasks ; done
# cat /proc/slabinfo | grep kmalloc-32
kmalloc-32        257466 257548     32  124    1 : tunables  120   60
  8 : slabdata   2077   2077      5
# kill 17611
[1]+  Terminated              sleep 600
# cat /proc/slabinfo | grep kmalloc-32
kmalloc-32         57924  60636     32  124    1 : tunables  120   60
  8 : slabdata    470    489    385

thanks,
Shakeel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-13 18:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 17:07 [bug report] resctrl high memory comsumption Shakeel Butt
2020-01-08 20:23 ` Fenghua Yu
2020-01-08 20:42   ` Reinette Chatre
2020-01-08 21:42     ` Fenghua Yu
2020-01-08 21:54       ` Reinette Chatre
2020-01-13 18:38         ` Shakeel Butt
2020-01-08 21:20   ` Shakeel Butt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).