Re: [PATCH 0/2] new API to allocate buffer-cache for superblock in non-movable area

Peter Zijlstra
2014-08-01T13:36:42Z

[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]

On Fri, Aug 01, 2014 at 11:57:00AM +0200, Jan Kara wrote:
> So the quiestion really is how hard guarantee do you need that a page in
> movable zone is really movable. Or better in what timeframe should it be
> movable? It may be possible to make e.g. migratepage callback for ext4
> blkdev pages which will handle migration of pages that are just idly
> sitting in a journal waiting to be committed. That may be reasonably doable
> although it won't be perfect. Or we may just decide it's not worth the
> bother and allocate all blkdev pages from unmovable zone...

So the point of CMA is to cater to those (arguably broken) devices that
do not have scatter gather IO, and these include things like the camera
device on your phone.

Previously (and possibly currently) your android Linux kernel will
simply preallocate a massive physically linear chunk of memory and
assign it to the camera hardware and not use it at all.

This is a terrible waste for most of the time people aren't running
their camera app at all. So the point is to allow usage of the memory,
but upon request be able to 'immediately' clear it through
migration/writeback.

So we should be fairly 'quick' in making the memory available,
definitely sub second timeframes.

Sadly its not only mobile devices that excel in crappy hardware, there's
plenty desktop stuff that could use this too, like some of the v4l
devices iirc.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]