linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH resend] ramdisk: fix zeroed ramdisk pages on memory pressure
Date: Mon, 15 Oct 2007 16:37:58 -0600	[thread overview]
Message-ID: <m18x64knqx.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <m1ejfwkyty.fsf@ebiederm.dsl.xmission.com> (Eric W. Biederman's message of "Mon, 15 Oct 2007 12:38:33 -0600")

ebiederm@xmission.com (Eric W. Biederman) writes:

> Nick Piggin <nickpiggin@yahoo.com.au> writes:
>
>> On Monday 15 October 2007 19:05, Christian Borntraeger wrote:
>>> Am Montag, 15. Oktober 2007 schrieb Nick Piggin:
>>> > On Monday 15 October 2007 18:28, Christian Borntraeger wrote:
>>> > > Andrew, this is a resend of a bugfix patch. Ramdisk seems a bit
>>> > > unmaintained, so decided to sent the patch to you :-).
>>> > > I have CCed Ted, who did work on the code in the 90s. I found no
>>> > > current email address of Chad Page.
>>> >
>>> > This really needs to be fixed...
>>>
>>> I obviously agree ;-)
>>> We have seen this problem happen several times.
>>>
>>> > I can't make up my mind between the approaches to fixing it.
>>> >
>>> > On one hand, I would actually prefer to really mark the buffers
>>> > dirty (as in: Eric's fix for this problem[*]) than this patch,
>>> > and this seems a bit like a bandaid...
>>>
>>> I have never seen these patches, so I cannot comment on them.
>>
>>> > On the other hand, the wound being covered by the bandaid is
>>> > actually the code in the buffer layer that does this latent
>>> > "cleaning" of the page because it sadly doesn't really keep
>>> > track of the pagecache state. But it *still* feels like we
>>> > should be marking the rd page's buffers dirty which should
>>> > avoid this problem anyway.
>>>
>>> Yes, that would solve the problem as well. As long as we fix
>>> the problem, I am happy. On the other hand, do you see any
>>> obvious problem with this "bandaid"?
>>
>> I don't think so -- in fact, it could be the best candidate for
>> a minimal fix for stable kernels (anyone disagree? if not, maybe
>> you could also send this to the stable maintainers?).
>
> A minor one.  It still leaves us with buffer heads out of sync with
> struct page.
>
>> But I do want to have this fixed in a "nice" way. eg. I'd like
>> it to mark the buffers dirty because that actually results in
>> more reuse of generic kernel code, and also should make rd
>> behave more naturally (I like using it to test filesystems
>> because it can expose a lot more concurrency than something like
>> loop on tmpfs). It should also be possible to actually have
>> rd's buffer heads get reclaimed as well, preferably while
>> exercising the common buffer paths and without writing much new
>> code.
>
> We actually allow that currently for clean pages which is part
> of what makes this tricky.
>
>> All of that is secondary to fixing the data corruption problem
>> of course! But the fact that those alternate patches do exist now
>> means I want to just bring them into the discussion again before
>> merging one or the other.
>
> The core of my original fix was to modify init_page_buffers so that
> when we added buffers to a dirty page the buffers became dirty.
>
> Modifying the generic code is a bit spooky because it requires us
> to audit the kernel to make certain nothing else depends on the
> current behavior in odd ways.  Although since init_page_buffers
> is only called when we are adding buffer heads to an existing
> page I still think that was the proper change.
>
> The historical reason for my patches not getting merged the first
> time is there was some weird issue with reiserfs ramdisks and so
> Andrew disabled the code, and then dropped it when he had discovered
> he had the patch disabled for several releases.  I don't think
> any causal relationship was ever established.  But I didn't
> hear enough about the reiserfs ramdisk issue, to make a guess
> what was going on.
>
> So it looks to me like the important invariant we need to maintain
> is that when a ramdisk page is dirty it always has buffers and those
> buffers are dirty as well.  With a little care we can ensure this
> happens with just modifications to rd.c

Hah.  I looked over my last round of patches again and I have been able
to verify by review the parts I was a little iffy about and I have
found where in my cleanups I had missed a layering violation in the
ramdisk code, and removed some needed code.  Which probably accounts
for the reiserfs ramdisk problems.  Updated patches in a minute.

Eric

--
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:[~2007-10-15 22:37 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15  8:28 Christian Borntraeger
2007-10-15 14:06 ` Nick Piggin
2007-10-15  9:05   ` Christian Borntraeger
2007-10-15 14:38     ` Nick Piggin
2007-10-15 18:38       ` Eric W. Biederman
2007-10-15 22:37         ` Eric W. Biederman [this message]
2007-10-15 22:40           ` [PATCH] rd: Preserve the dirty bit in init_page_buffers() Eric W. Biederman
2007-10-15 22:42             ` [PATCH] rd: Mark ramdisk buffers heads dirty Eric W. Biederman
2007-10-16  7:56               ` Christian Borntraeger
2007-10-16  9:22                 ` Eric W. Biederman
2007-10-17 16:14                 ` Christian Borntraeger
2007-10-17 17:57                   ` Eric W. Biederman
2007-10-17 19:14                     ` Chris Mason
2007-10-17 20:29                       ` Eric W. Biederman
2007-10-17 20:54                         ` Chris Mason
2007-10-17 21:30                           ` Eric W. Biederman
2007-10-17 22:58                             ` Chris Mason
2007-10-17 23:28                               ` Eric W. Biederman
2007-10-18  0:03                                 ` Chris Mason
2007-10-18  3:27                                   ` Eric W. Biederman
2007-10-18  3:59                                   ` [RFC][PATCH] block: Isolate the buffer cache in it's own mappings Eric W. Biederman
2007-10-18  4:32                                     ` Andrew Morton
2007-10-19 21:27                                       ` Eric W. Biederman
2007-10-21  4:24                                         ` Nick Piggin
2007-10-21  4:53                                           ` Eric W. Biederman
2007-10-21  5:36                                             ` Nick Piggin
2007-10-21  7:09                                               ` Eric W. Biederman
2007-10-22  0:15                                           ` David Chinner
2007-10-18  5:10                                     ` Nick Piggin
2007-10-19 21:35                                       ` Eric W. Biederman
2007-10-17 21:48                     ` [PATCH] rd: Mark ramdisk buffers heads dirty Christian Borntraeger
2007-10-17 22:22                       ` Eric W. Biederman
2007-10-18  9:26                         ` Christian Borntraeger
2007-10-19 22:46                           ` Eric W. Biederman
2007-10-19 22:51                           ` [PATCH] rd: Use a private inode for backing storage Eric W. Biederman
2007-10-21  4:28                             ` Nick Piggin
2007-10-21  5:10                               ` Eric W. Biederman
2007-10-21  5:24                                 ` Nick Piggin
2007-10-21  6:48                                   ` Eric W. Biederman
2007-10-21  7:28                                     ` Christian Borntraeger
2007-10-21  8:23                                       ` Eric W. Biederman
2007-10-21  9:56                                         ` Nick Piggin
2007-10-21 18:39                                           ` Eric W. Biederman
2007-10-22  1:56                                             ` Nick Piggin
2007-10-22 13:11                                             ` Chris Mason
2007-10-21  9:39                                     ` Nick Piggin
2007-10-21 17:56                                       ` Eric W. Biederman
2007-10-22  0:29                                         ` Nick Piggin
2007-10-16  8:19               ` [PATCH] rd: Mark ramdisk buffers heads dirty Nick Piggin
2007-10-16  8:48                 ` Christian Borntraeger
2007-10-16 19:06                 ` Eric W. Biederman
2007-10-16 22:06                   ` Nick Piggin
2007-10-16  8:12             ` [PATCH] rd: Preserve the dirty bit in init_page_buffers() Nick Piggin
2007-10-16  9:35               ` Eric W. Biederman
2007-10-15  9:16   ` [PATCH resend] ramdisk: fix zeroed ramdisk pages on memory pressure Andrew Morton
2007-10-15 15:23     ` Nick Piggin
2007-10-16  3:14       ` Eric W. Biederman
2007-10-16  6:45         ` Nick Piggin
2007-10-16  4:57           ` Eric W. Biederman
2007-10-16  8:08             ` Nick Piggin
2007-10-16  7:47               ` [patch][rfc] rewrite ramdisk Nick Piggin
2007-10-16  7:52                 ` Jan Engelhardt
2007-10-16  8:07                   ` Nick Piggin
2007-10-16  8:17                     ` Jan Engelhardt
2007-10-16  8:26                       ` Nick Piggin
2007-10-16  8:53                         ` Jan Engelhardt
2007-10-16  9:08                 ` Eric W. Biederman
2007-10-16 21:28                 ` Theodore Tso
2007-10-16 22:08                   ` Nick Piggin
2007-10-16 23:48                     ` Eric W. Biederman
2007-10-17  0:28                       ` Nick Piggin
2007-10-17  1:13                         ` Eric W. Biederman
2007-10-17  1:47                           ` Nick Piggin
2007-10-17 10:30                 ` Eric W. Biederman
2007-10-17 12:49                   ` Nick Piggin
2007-10-17 18:45                     ` Eric W. Biederman
2007-10-18  1:06                       ` Nick Piggin

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=m18x64knqx.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=schwidefsky@de.ibm.com \
    --cc=tytso@mit.edu \
    /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