Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1534850

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

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs
Date 2016-12-02 12:30 +0100
Message-ID <sJUcp-3bc-3@gated-at.bofh.it> (permalink)
References <sJfiV-7Va-7@gated-at.bofh.it> <sJleG-3nG-25@gated-at.bofh.it> <sJTJn-2Mb-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 operations on resctrl and avoid the problem
> +above, the following locking procedure is recommended:
> +
> +A) open /var/lock/resctrl/fs.lock with O_CREAT|O_EXCL.
> +B) if success, write pid of program accessing the directory
> +   structure to this file.
> +C) read/write the directory structure.
> +D) remove file.

What's wrong with using flock, which works from shell scripts as well?

Thanks,

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] intelrdt: resctrl: recommend locking for resctrlfs  Marcelo Tosatti <mtosatti@redhat.com> - 2016-11-30 16:50 +0100
  Re: [PATCH] intelrdt: resctrl: recommend locking for resctrlfs  Thomas Gleixner <tglx@linutronix.de> - 2016-11-30 22:20 +0100
  Re: [PATCH] intelrdt: resctrl: recommend locking for resctrlfs Fenghua Yu <fenghua.yu@intel.com> - 2016-11-30 23:10 +0100
    Re: [PATCH] intelrdt: resctrl: recommend locking for resctrlfs Marcelo Tosatti <mtosatti@redhat.com> - 2016-12-01 14:00 +0100
      Re: [PATCH] intelrdt: resctrl: recommend locking for resctrlfs Fenghua Yu <fenghua.yu@intel.com> - 2016-12-01 23:00 +0100
    [PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs  Marcelo Tosatti <mtosatti@redhat.com> - 2016-12-02 12:00 +0100
      Re: [PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs  Thomas Gleixner <tglx@linutronix.de> - 2016-12-02 12:30 +0100
        Re: [PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs Marcelo Tosatti <mtosatti@redhat.com> - 2016-12-02 23:10 +0100
          Re: [PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs Thomas Gleixner <tglx@linutronix.de> - 2016-12-09 10:40 +0100

csiph-web