Re: [PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs

2016-12-09 Thread Thomas Gleixner
On Fri, 2 Dec 2016, Marcelo Tosatti wrote: > Actually, using flock(2) allows one to use LOCK_SH for readers and > this allows consistent writer/reader behaviour (say, a reader > won't see a partially written directory). Indeed. > So the procedure would be: > > /var/lock/resctrl/fs.lock crea

Re: [PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs

2016-12-02 Thread Marcelo Tosatti
On Fri, Dec 02, 2016 at 12:20:29PM +0100, Thomas Gleixner wrote: > On Thu, 1 Dec 2016, Marcelo Tosatti wrote: > > > > There is a locking problem between different applications > > reading/writing to resctrlfs directory at the same time (read the patch > > below for details). > > > > Suggest a sta

Re: [PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs

2016-12-02 Thread Thomas Gleixner
On Thu, 1 Dec 2016, Marcelo Tosatti wrote: > > There is a locking problem between different applications > reading/writing to resctrlfs directory at the same time (read the patch > below for details). > > Suggest a standard locking scheme for applications to use. > +To coordinate atomic op

[PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs

2016-12-02 Thread Marcelo Tosatti
There is a locking problem between different applications reading/writing to resctrlfs directory at the same time (read the patch below for details). Suggest a standard locking scheme for applications to use. Signed-off-by: Marcelo Tosatti --- v2: Improve commentary about generality of locking