mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/1] x86/resctrl: fix task CLOSID update race
@ 2022-11-10 13:53 Peter Newman
  2022-11-10 13:53 ` [PATCH v2 1/1] x86/resctrl: fix task closid/rmid " Peter Newman
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Newman @ 2022-11-10 13:53 UTC (permalink / raw)
  To: reinette.chatre, fenghua.yu
  Cc: bp, derkling, eranian, hpa, james.morse, jannh, kpsingh,
	linux-kernel, mingo, tglx, x86, Peter Newman

Hi Reinette, Fenghua,

Below is my updated patch to address the IPI race we discussed in the
container move RFD thread[1].

The patch below uses the new task_call_func() interface to serialize
updating closid and rmid with any context switch of the task. AFAICT,
the implementation of this function acts like a mutex with context
switch, but I'm not certain whether it is intended to be one. If this is
not how task_call_func() is meant to be used, I will instead move the
code performing the update under sched/ where it can be done holding the
task_rq_lock() explicitly, as Reinette has suggested before[2].

task_call_func() is only used when moving as single task, as group
changes would require task_call_func() to be called on every task in a
potentially large list, which is likely more detrimental than an IPI
broadcast. Furthermore, when moving a large group, the resulting CPU
update mask will probably contain all CPUs anyways.

Updates since v1:
 - Following Reinette's suggestion: use task_call_func() for single
   task, IPI broadcast for group movements.
 - Rebased to v6.1-rc4

v1: https://lore.kernel.org/lkml/20221103141641.3055981-1-peternewman@google.com/

Thanks!
-Peter

[1] https://lore.kernel.org/all/CALPaoCg2-9ARbK+MEgdvdcjJtSy_2H6YeRkLrT97zgy8Aro3Vg@mail.gmail.com/
[2] https://lore.kernel.org/lkml/d3c06fa3-83a4-7ade-6b08-3a7259aa6c4b@intel.com/

Peter Newman (1):
  x86/resctrl: fix task closid/rmid update race

 arch/x86/kernel/cpu/resctrl/rdtgroup.c | 134 ++++++++++++-------------
 1 file changed, 62 insertions(+), 72 deletions(-)

-- 
2.38.1.431.g37b22c650d-goog


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

end of thread, other threads:[~2022-11-14 10:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10 13:53 [PATCH v2 0/1] x86/resctrl: fix task CLOSID update race Peter Newman
2022-11-10 13:53 ` [PATCH v2 1/1] x86/resctrl: fix task closid/rmid " Peter Newman
2022-11-11 18:38   ` James Morse
2022-11-14 10:02     ` Peter Newman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®