The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Harshana Ranmuthu <hranmuthu@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Linux 3.0+ Disk performance problem - wrong pdflush behaviour
Date: Thu, 7 Mar 2013 16:48:05 +0100	[thread overview]
Message-ID: <20130307154805.GH6723@quack.suse.cz> (raw)
In-Reply-To: <CABC96KznmDJHp5gfx1YsfX9hdXGFA3buaY31P2dDy1jJQgga7w@mail.gmail.com>

On Wed 06-03-13 20:05:58, Harshana Ranmuthu wrote:
> >   I don't know how to fix the issue without reverting the patch. Sorry.
> 
> with reference to post URL
> http://marc.info/?l=linux-fsdevel&m=134997043820759&w=2
> 
> I was going through this post, as we are also having problems with the
> same commit. In our case, we are appending to a file rather than
> updating.
> 
> Let me explain the issue as I understand and the solution I think
> which can fix the issue.
> 
> If a write() writes to a page (for the second time) which is being
> flushed (because the page was dirty from the fist write), data written
> to disk may have part from the first write and  rest from the second
> write. Although, after the second write, page will have the correct
> data, but disk will have corrupted data, ie, part from first write and
> rest from the second write. After flush(), dirty flag on the page will
> be cleared.
  This isn't true. Dirty bit gets cleared *before* the page is submitted
for IO. So second write sets the dirty bit again and that assures writeback
will happen in future again. So what you propose below is indeed happening.
So my question is: What problems are you really observing?

> If there has been a third write on the same page (this
> time assuming a clean write), then accurate data will be written to
> disk on the next flush. If there's no third write, then file on disk
> will remain to have corrupted data. If we can make sure, after the
> second write(), page remains dirty (because flush and write() happened
> at the same time), then even there's no third write, that page will be
> flushed again with accurate data, correcting the corruption on the
> disk.
> In summery, solution is to make sure the conflicting (write and flush
> happen at the same time) pages kept dirty after the flush. This will
> make sure these pages will be flushed again even there's no subsequent
> write()s to them.
> 
> I don't know how easy / difficult this change is. Hope you'll consider this.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2013-03-07 15:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06 14:35 Linux 3.0+ Disk performance problem - wrong pdflush behaviour Harshana Ranmuthu
2013-03-07 15:48 ` Jan Kara [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-10-09  9:41 Viktor Nagy
2012-10-10 16:57 ` Jan Kara
2012-10-10 20:44   ` Viktor Nagy
2012-10-10 21:27     ` Jan Kara
2012-10-11 10:52       ` Viktor Nagy
2012-10-11 10:10         ` Jan Kara
2012-10-11 12:58           ` Viktor Nagy
2012-10-11 15:47             ` 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=20130307154805.GH6723@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=hranmuthu@gmail.com \
    --cc=linux-kernel@vger.kernel.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