Re: task isolation discussion at Linux Plumbers

From: Christoph Lameter
Date: Sat Nov 05 2016 - 12:05:39 EST


On Sat, 5 Nov 2016, Chris Metcalf wrote:

> Here are the notes I took; I welcome any corrections and follow-up.

Thank you for writing this up. I hope we can now move forward further on
these issues.

> == Remote statistics ==
>
> We discussed the possibility of remote statistics gathering, i.e. load
> average etc. The idea would be that we could have housekeeping
> core(s) periodically iterate over the nohz cores to load their rq
> remotely and do update_current etc. Presumably it should be possible
> for a single housekeeping core to handle doing this for all the
> nohz_full cores, as we only need to do it quite infrequently.
>
> Thomas suggested that this might be the last remaining thing that
> needed to be done to allow disabling the current behavior of falling
> back to a 1 Hz clock in nohz_full.
>
> I believe Thomas said he had a patch to do this already.


Note that the vmstat_shepherd already scans idle cpus ever 2 seconds to
see if there are new updates top vm statistics that require the
reactivation of the vmstat updater. It would be possible to
opportunistically update the thread statistics should the remove cpu be in
user space (if one figures out the synchronization issues for remote per
cpu updates)

> == Quiescing vmstat ==
>
> Another issue that task isolation handles is ensuring that the vmstat
> worker is quiesced before returning to user space. Currently we
> cancel the vmstat delayed work, then invoke refresh_cpu_vm_stats().
> Currently neither of these things appears safe to do in the
> interrupts-disabled context just before return to userspace, because
> they both can call schedule(): refresh_cpu_vm_stats() via a
> cond_resched() under CONFIG_NUMA, and cancel_delayed_work_sync() via a
> schedule() in __cancel_work_timer().
>
> Christoph offered to work with me to make sure that we could do the
> appropriate quiescing with interrupts disabled, and seemed confident
> it should be doable.

This is already implemented. You can call

refresh_cpu_vm_stats(false)

to do the quiescing with interrupts disabled.