Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-29 Thread Peter Zijlstra
On Tue, Jan 29, 2019 at 10:18:20AM -0800, Suren Baghdasaryan wrote: > On Tue, Jan 29, 2019 at 4:38 AM Peter Zijlstra wrote: > > > > On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > > > + atomic_set(&group->polling, polling); > > > + /* >

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-29 Thread Johannes Weiner
Hi Minchan, good to see your name on the lists again :) On Tue, Jan 29, 2019 at 08:53:58AM +0900, Minchan Kim wrote: > On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > > @@ -68,6 +69,50 @@ struct psi_group_cpu { > > u32 times_prev[NR_PSI_STATES] cacheline_aligned_in_s

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-29 Thread Suren Baghdasaryan
On Tue, Jan 29, 2019 at 10:18 AM Suren Baghdasaryan wrote: > > On Tue, Jan 29, 2019 at 4:38 AM Peter Zijlstra wrote: > > > > On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > > > + atomic_set(&group->polling, polling); > > > + /* > > > +

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-29 Thread Suren Baghdasaryan
On Tue, Jan 29, 2019 at 7:16 AM Peter Zijlstra wrote: > > On Tue, Jan 29, 2019 at 01:38:43PM +0100, Peter Zijlstra wrote: > > On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > > > + atomic_set(&group->polling, polling); > > > + /* > > > +

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-29 Thread Suren Baghdasaryan
On Tue, Jan 29, 2019 at 4:38 AM Peter Zijlstra wrote: > > On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > > + atomic_set(&group->polling, polling); > > + /* > > + * Memory barrier is needed to order group->polling >

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-29 Thread Suren Baghdasaryan
Thanks for review Peter! On Tue, Jan 29, 2019 at 2:44 AM Peter Zijlstra wrote: > > On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > > static void psi_update_work(struct work_struct *work) > > { > > struct delayed_work *dwork; > > struct psi_group *group; > > +

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-29 Thread Peter Zijlstra
On Tue, Jan 29, 2019 at 01:38:43PM +0100, Peter Zijlstra wrote: > On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > > + atomic_set(&group->polling, polling); > > + /* > > +* Memory barrier is needed to order group->polling

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-29 Thread Peter Zijlstra
On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > + atomic_set(&group->polling, polling); > + /* > + * Memory barrier is needed to order group->polling > + * write before times[] read in collect_pe

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-29 Thread Peter Zijlstra
On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > static void psi_update_work(struct work_struct *work) > { > struct delayed_work *dwork; > struct psi_group *group; > + bool first_pass = true; > + u64 next_update; > + u32 change_mask; > + int pollin

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-28 Thread Suren Baghdasaryan
On Mon, Jan 28, 2019 at 3:54 PM Minchan Kim wrote: > > Hi Suren, > > When I review first time, it was rather hard to understand due to naming > so below comments are mostly cleanup or minor. > I'm not strong against if you don't think it's helpful. > Feel free to select parts. > > Thanks. Thanks

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-28 Thread Minchan Kim
Hi Suren, When I review first time, it was rather hard to understand due to naming so below comments are mostly cleanup or minor. I'm not strong against if you don't think it's helpful. Feel free to select parts. Thanks. On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > Psi m

Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-28 Thread Johannes Weiner
One thought on the v3 delta that I missed earlier: On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > +/* > + * psi_update_work represents slowpath accounting part while psi_group_change > + * represents hotpath part. There are two potential races between them: > + * 1. Changes

[PATCH v3 5/5] psi: introduce psi monitor

2019-01-24 Thread Suren Baghdasaryan
Psi monitor aims to provide a low-latency short-term pressure detection mechanism configurable by users. It allows users to monitor psi metrics growth and trigger events whenever a metric raises above user-defined threshold within user-defined time window. Time window and threshold are both expres