From: Chinmay V S <cvs268@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-fsdevel@vger.kernel.org, hch@lst.de, akpm@osdl.org
Subject: Re: Query regarding inotify and mmap-ed files
Date: Mon, 1 Jul 2013 22:08:28 +0800 [thread overview]
Message-ID: <CAK-9PRB=Yr-QL4zghWeO9oiz8Qx_JUUfHonEnJS1xavimjreNw@mail.gmail.com> (raw)
In-Reply-To: <20130701133711.GC3897@quack.suse.cz>
> But why can't you use current IN_MODIFY event?
>
Initially i registered a "catch all" inotify watch on the mmap-ed file
by calling inotify_add_watch() with IN_ALL_EVENTS in the "reader"
process. But modifications to the file by mmap-ing it in the "writer"
process did NOT trigger the inotify watch. Even calling msync() did
NOT trigger any inotify events.
(BTW, Is this expected behaviour?? v2.6.37 on ARMCortexA8, rootfs on NAND)
The file was mapped using MAP_SHARED to ensure that no copies were
made in memory and the changes made by the "writer" process are being
flushed to the file.
Hence added support for IN_SYNC event in the inotify framework.
https://gist.github.com/TheCodeArtist/5874669
IMHO, this is a well justified addition to the inotify mechanism.
Since it simplifies the creation of an event notification framework
for IPC, is any reason why IN_SYNC should *NOT* be mainlined?
PS: Once again, i would really really welcome any suggestions to
implement a simple high performance notification mechanism for IPC
using any existing alternatives. Running a "patched" kernel is
something i would like to avoid.
System requirements:
a. Single data "writer" process.
b. Multiple "reader" processes, each to be notified of every update by
the writer.
c. Processes "writer" and "readers" NOT related. No per-determined
order of execution.
d. Events may NOT be dropped.
regards
ChinmayVS
next prev parent reply other threads:[~2013-07-01 14:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAK-9PRBG+ZOqcDK+GtsF0pKXksa8MYX7sQT46Y3dFW+Un2bG-A@mail.gmail.com>
2013-06-27 10:19 ` Fwd: Query regarding inotify and mmap-ed files Chinmay V S
2013-06-27 10:47 ` Peter Zijlstra
2013-06-27 14:22 ` Chinmay V S
2013-06-27 20:15 ` Al Viro
2013-06-28 3:46 ` Chinmay V S
2013-07-01 13:37 ` Jan Kara
2013-07-01 14:08 ` Chinmay V S [this message]
2013-07-01 15:24 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK-9PRB=Yr-QL4zghWeO9oiz8Qx_JUUfHonEnJS1xavimjreNw@mail.gmail.com' \
--to=cvs268@gmail.com \
--cc=akpm@osdl.org \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).