lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20061004111603.20cdaa35.akpm@osdl.org>
Date:	Wed, 4 Oct 2006 11:16:03 -0700
From:	Andrew Morton <akpm@...l.org>
To:	Jeff Moyer <jmoyer@...hat.com>
Cc:	Zach Brown <zach.brown@...cle.com>, linux-kernel@...r.kernel.org
Subject: Re: [patch] call truncate_inode_pages in the DIO fallback to
 buffered I/O path

On Wed, 04 Oct 2006 13:53:32 -0400
Jeff Moyer <jmoyer@...hat.com> wrote:

> ==> Regarding Re: [patch] call truncate_inode_pages in the DIO fallback to buffered I/O path; Zach Brown <zach.brown@...cle.com> adds:
> 
> >> Why is this a problem?  It's just like someone did a write(), and we'll
> >> invalidate the pagecache on the next direct-io operation.
> 
> zach.brown> This was noticed as a distro regression as they moved from the
> zach.brown> kernels that used to invalidate the entire address space on
> zach.brown> direct io ops to more modern ones that only invalidate the
> zach.brown> region being written.
> 
> Right.

Change app to use sync_file_range() followed by
posix_fadvise(POSIX_FADV_DONTNEED).  Problem solved.

We have lots of nice new tools in-kernel which permit applications to
manipulate and to invalidate pagecache.  Please, start using them rather
than pushing bits of oracle into the core vfs ;)

> zach.brown> You can end up with significant memory pressure after this
> zach.brown> change with a large enough working set on disk.
> 
> >> eek.  truncate_inode_pages() will throw away dirty data.  Very
> >> dangerous, much chin-scratching needed.
> 
> zach.brown> Yeah, I failed to tell Jeff that it should be calling
> zach.brown> filemap_fdatawrite() first to get things into writeback.  (And
> zach.brown> presumably not truncating if that returns an error.)
> 
> Ahh, that explains it.  The strange thing is that my test validates the
> file afterwards, and I was seeing correct data.

That is strange, because the truncate_inode_pages() will throw away the
dirty pagecache pages which the application just wrote to.  Maybe the file
was opened O_SYNC or something.

> I'll repost after another round of testing.

Please, no truncate_inode_pages.  For this application, the far-safer
invalidate_inode_pages() would suffice.

However no kernel change is needed.

And no sneaking changes like this into vendor kernels either!  Fix Oracle.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ