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: <20121211084512.GI22698@blaptop>
Date:	Tue, 11 Dec 2012 17:45:12 +0900
From:	Minchan Kim <minchan@...nel.org>
To:	Mike Hommey <mh@...ndium.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	Michael Kerrisk <mtk.manpages@...il.com>,
	Arun Sharma <asharma@...com>, sanjay@...gle.com,
	Paul Turner <pjt@...gle.com>,
	David Rientjes <rientjes@...gle.com>,
	John Stultz <john.stultz@...aro.org>,
	Christoph Lameter <cl@...ux.com>,
	Android Kernel Team <kernel-team@...roid.com>,
	Robert Love <rlove@...gle.com>, Mel Gorman <mel@....ul.ie>,
	Hugh Dickins <hughd@...gle.com>,
	Dave Hansen <dave@...ux.vnet.ibm.com>,
	Rik van Riel <riel@...hat.com>,
	Dave Chinner <david@...morbit.com>, Neil Brown <neilb@...e.de>,
	Taras Glek <tglek@...illa.com>,
	KOSAKI Motohiro <kosaki.motohiro@...il.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [RFC v3] Support volatile range for anon vma

On Tue, Dec 11, 2012 at 09:29:03AM +0100, Mike Hommey wrote:
> On Tue, Dec 11, 2012 at 05:11:17PM +0900, Minchan Kim wrote:
> > On Tue, Dec 11, 2012 at 08:59:50AM +0100, Mike Hommey wrote:
> > > On Tue, Dec 11, 2012 at 04:37:44PM +0900, Minchan Kim wrote:
> > > > On Tue, Dec 11, 2012 at 08:17:42AM +0100, Mike Hommey wrote:
> > > > > On Tue, Dec 11, 2012 at 11:41:04AM +0900, Minchan Kim wrote:
> > > > > > - What's the madvise(addr, length, MADV_VOLATILE)?
> > > > > > 
> > > > > >   It's a hint that user deliver to kernel so kernel can *discard*
> > > > > >   pages in a range anytime.
> > > > > > 
> > > > > > - What happens if user access page(ie, virtual address) discarded
> > > > > >   by kernel?
> > > > > > 
> > > > > >   The user can see zero-fill-on-demand pages as if madvise(DONTNEED).
> > > > > 
> > > > > What happened to getting SIGBUS?
> > > > 
> > > > I thought it could force for user to handle signal.
> > > > If user can receive signal, what can he do?
> > > > Maybe he can call madivse(NOVOLATILE) in my old version but I removed it
> > > > in this version so user don't need handle signal handling.
> > > 
> > > NOVOLATILE and signal throwing are two different and not necessarily
> > > related needs. We (Mozilla) could probably live without NOVOLATILE,
> > > but certainly not without signal throwing.
> > 
> > What's shortcoming if we don't provide signal handling?
> > Could you explain how you want to signal in your allocator?
> 
> The main use case we have for signals is not an allocator. We're
> currently using ashmem to decompress libraries on Android. We would like
> to use volatile memory for that instead, so that unused pages can be
> discarded. With NOVOLATILE, or when getting zero-filled pages, that just
> doesn't pan out: you may well be jumping in the volatile memory from
> anywhere, and you can't check the status of the page you're jumping into
> before jumping. Thus you need to be signaled when reaching a discarded
> page.

It seems you are saying about tmpfs-based volatile ranges.
As I mentioned in John's thread, some interface to pin memory
as ashmem's term is needed for tmpfs-based volatile ranges.
But in case of allocator, we might not need it so this patch which
for considering allocator usecase removed SIGBUS.
If user allocator guys ask such interface, it wouldn't be a problem
for unifying both usecases but if they don't want due to by
performance, I don't want to add it. If so, there are two choices.

1) Go separate way with each interface.
   (madvise for anon vs fadvise or fallocate for tmpfs)
2) A new system call to unify them.

> 
> Mike
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>

-- 
Kind regards,
Minchan Kim
--
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