linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Thanos Makatos <thanos.makatos@citrix.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
	"jlayton@poochiereds.net" <jlayton@poochiereds.net>,
	"bfields@fieldses.org" <bfields@fieldses.org>,
	"jack@suse.cz" <jack@suse.cz>
Subject: Re: [PATCH RFC] introduce ioctl to completely invalidate page cache
Date: Fri, 03 Oct 2014 08:28:24 -0600	[thread overview]
Message-ID: <542EB288.5000209@kernel.dk> (raw)
In-Reply-To: <2368A3FCF9F7214298E53C823B0A48EC0423DFE3@AMSPEX01CL02.citrite.net>

On 2014-10-03 03:25, Thanos Makatos wrote:
>>> -		fsync_bdev(bdev);
>>> -		invalidate_bdev(bdev);
>>> +		flush_buffer_cache(bdev);
>>> +		if (BLKFLSBUF2 == cmd)
>>> +			return invalidate_inode_pages2(
>>> +					bdev->bd_inode->i_mapping);
>>>   		return 0;
>>
>> We're currently ignoring the buffer cache sync and invalidation (which is odd),
>> but at least being consistent would be good.
>>
>> Might also need a filemap_write_and_wait() to sync before invalidation.
>
> (I've got zero knowledge in this area, so excuse my ignorance!)
>
> Does filemap_write_and_wait() writes back modified, memory-mapped pages? If so,
> isn't there a race condition? Or have I got it completely wrong?

There's no race to be concerned of for this ioctl. Any page dirtied 
before you make the call will be synced, any page dirtied after may not. 
This is no different than what would happen on the buffer cache side in 
the current ioctl.

-- 
Jens Axboe


  reply	other threads:[~2014-10-03 14:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1412266184-23776-1-git-send-email-thanos.makatos@citrix.com>
2014-10-02 19:59 ` [PATCH RFC] introduce ioctl to completely invalidate page cache Jens Axboe
2014-10-03  5:27   ` Dave Chinner
2014-10-03  9:00     ` Thanos Makatos
     [not found]   ` <542DAEAC.8010203-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2014-10-03  9:25     ` Thanos Makatos
2014-10-03 14:28       ` Jens Axboe [this message]
2014-10-06  8:06     ` Jan Kara
2014-10-06  9:21       ` Thanos Makatos
2014-10-06 11:33         ` Thanos Makatos
2014-10-06 14:30           ` Jan Kara
2014-10-06 15:21             ` Thanos Makatos
2014-10-07  1:30             ` Dave Chinner
2014-10-07 19:16               ` Jan Kara
2014-10-07 19:35                 ` Trond Myklebust

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=542EB288.5000209@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=bfields@fieldses.org \
    --cc=jack@suse.cz \
    --cc=jlayton@poochiereds.net \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thanos.makatos@citrix.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;
as well as URLs for NNTP newsgroup(s).