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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 17 Oct 2007 14:49:26 -0400
From:	Trond Myklebust <trond.myklebust@....uio.no>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] nfs: fix nfs_writepage()


On Wed, 2007-10-17 at 19:36 +0200, Peter Zijlstra wrote:
> On Wed, 2007-10-17 at 18:26 +0200, Peter Zijlstra wrote:
> > On Wed, 2007-10-17 at 12:24 -0400, Trond Myklebust wrote:
> > > On Wed, 2007-10-17 at 17:57 +0200, Peter Zijlstra wrote:
> > > > On Wed, 2007-10-17 at 11:47 -0400, Trond Myklebust wrote:
> > > > > On Wed, 2007-10-17 at 11:45 -0400, Trond Myklebust wrote:
> > > > > > On Wed, 2007-10-17 at 17:30 +0200, Peter Zijlstra wrote:
> > > > > > 
> > > > > > > The thing is, swapper_space just calls ->writepage() and expects the
> > > > > > > page to be written out. So either the a_ops usage of swapper_space is
> > > > > > > deviant or NFS' is.
> > > > > > 
> > > > > > Could somebody please document WTF writepage() is supposed to do, and
> > > > > > WTF page_mkwrite() is for?
> > > > > > 
> > > > > > I thought that page_mkwrite() was supposed to finally allow us to deal
> > > > > > with dirty pages in a clean manner: the caller gets to tell the
> > > > > > filesystem that it wants the entire page written out, and then dirties
> > > > > > the page. What is the point if the VM then expects to be able to
> > > > > > circumvent this?
> > > > > 
> > > > > Put differently:
> > > > >       * _who_ is dirtying the page when the swapper is trying to write
> > > > >         the page out?
> > > > >       * why are they not calling either page_mkwrite() or
> > > > >         commit_write()?
> > > > 
> > > > I'm writing anonymous pages (I'm the crazy person doing swap over NFS).
> > > > And anonymous is dirty by default.
> > > 
> > > I'd really prefer to _know_ that these writes are coming from the
> > > swapper. That makes it possible to give them a correct credential and
> > > open context.
> > > 
> > > Could you perhaps funnel them through a new a_op->swap_out() and default
> > > back to ->writepage() for those filesystems that don't define it?
> > 
> > Sure, will do that.
> 
> OTOH these pages will have PageSwapCache() and IS_SWAPFILE(inode) will
> be true, so ->writepage() can already know. Do you still prefer
> ->swap_out() ?

I think it is cleaner. PageSwapCache() is currently internal to the mm
layer, and doesn't need to be exported here. Then there is the issue of
overloading ->writepage(), which I don't like at all: it muddies the
semantics.

As for IS_SWAPFILE(), it would be nice to get rid of that one day...

Cheers
  Trond

-
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