lkml.org 
[lkml]   [2012]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v3] Support volatile range for anon vma
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.

Mike


\
 
 \ /
  Last update: 2012-12-11 10:01    [W:0.048 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site