linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: Richard Hansen <rhansen@bbn.com>,
	Steven Whitehouse <swhiteho@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Linux API <linux-api@vger.kernel.org>,
	Greg Troxel <gdt@ir.bbn.com>,
	bug-readline@gnu.org
Subject: Re: [PATCH] mm: msync: require either MS_ASYNC or MS_SYNC [resend]
Date: Fri, 4 Apr 2014 16:07:32 +0200	[thread overview]
Message-ID: <20140404140732.GG10526@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <533E5B7A.7030309@gmail.com>

On Fri, Apr 04, 2014 at 09:12:58AM +0200, Michael Kerrisk (man-pages) wrote:
> >   * Clearer intentions.  Looking at the existing code and the code
> >     history, the fact that flags=0 behaves like flags=MS_ASYNC appears
> >     to be a coincidence, not the result of an intentional choice.
> 
> Maybe. You earlier asserted that the semantics when flags==0 may have
> been different, prior to Peter Zijstra's patch,
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=204ec841fbea3e5138168edbc3a76d46747cc987
> .
> It's not clear to me that that is the case. But, it would be wise to
> CC the developer, in case he has an insight.

Right; so before that patch there appears to have been a difference.
The code looked like:

  if (flags & MS_ASYNC) {
  	balance_dirty_pages_ratelimited();
  } else if (flags & MS_SYNC) {
  	do_fsync()
  } else {
  	/* do nothing */
  }

Which would give the following semantics:

  msync(.flags = 0) -- scan PTEs and update dirty page accounting
  msync(.flags = MS_ASYNC) -- scan PTEs and dirty throttle
  msync(.flags = MS_SYNC) -- scan PTEs and flush dirty pages

However with the introduction of accurate dirty page accounting in
.19 we always had an accurate dirty page count and both .flags=0 and
.flags=MS_ASYNC turn into the same NO-OP.

Yielding todays state, where 0 and MS_ASYNC don't do anything much and
MS_SYNC issues the fsync() -- although I understand Willy recently
posted a patch to do a data-range-sync instead of the full fsync.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2014-04-04 14:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 18:25 [PATCH] mm: msync: require either MS_ASYNC or MS_SYNC Richard Hansen
2014-04-01 19:32 ` Michael Kerrisk (man-pages)
2014-04-02  0:53   ` Richard Hansen
2014-04-02 10:45   ` chrubis
2014-04-02 11:10 ` Christoph Hellwig
2014-04-02 11:45   ` Steven Whitehouse
2014-04-02 23:44     ` Richard Hansen
2014-04-03  8:25       ` Michael Kerrisk (man-pages)
2014-04-03 11:51         ` Christopher Covington
2014-04-04  6:54           ` Michael Kerrisk (man-pages)
2014-04-03 12:57         ` Greg Troxel
2014-04-04  7:11           ` Michael Kerrisk (man-pages)
2014-04-03 20:23         ` Richard Hansen
2014-04-04  6:53           ` Christoph Hellwig
2014-04-04  7:12       ` [PATCH] mm: msync: require either MS_ASYNC or MS_SYNC [resend] Michael Kerrisk (man-pages)
2014-04-04 14:07         ` Peter Zijlstra [this message]

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=20140404140732.GG10526@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bug-readline@gnu.org \
    --cc=gdt@ir.bbn.com \
    --cc=hch@infradead.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mtk.manpages@gmail.com \
    --cc=rhansen@bbn.com \
    --cc=swhiteho@redhat.com \
    /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