[Late but I didn't get to this soone - I hope this is still up-to-date
version]

On Mon 20-10-14 19:11:58, Minchan Kim wrote:
> Linux doesn't have an ability to free pages lazy while other OS
> already have been supported that named by madvise(MADV_FREE).
> 
> The gain is clear that kernel can discard freed pages rather than
> swapping out or OOM if memory pressure happens.
> 
> Without memory pressure, freed pages would be reused by userspace
> without another additional overhead(ex, page fault + allocation
> + zeroing).
> 
> How to work is following as.
> 
> When madvise syscall is called, VM clears dirty bit of ptes of
> the range. If memory pressure happens, VM checks dirty bit of
> page table and if it found still "clean", it means it's a
> "lazyfree pages" so VM could discard the page instead of swapping out.
> Once there was store operation for the page before VM peek a page
> to reclaim, dirty bit is set so VM can swap out the page instead of
> discarding.

Is there any patch for madvise man page? I guess the semantic will be
same/similar to FreeBSD:
http://www.freebsd.org/cgi/man.cgi?query=madvise&sektion=2

I guess the changelog should be more specific that this is only for the
private MAP_ANON mappings (same applies to the patch for man).

> Firstly, heavy users would be general allocators(ex, jemalloc,
> tcmalloc and hope glibc supports it) and jemalloc/tcmalloc already
> have supported the feature for other OS(ex, FreeBSD)
> 
[...]
> 
> Cc: Michael Kerrisk <mtk.manpa...@gmail.com>
> Cc: Linux API <linux-...@vger.kernel.org>
> Cc: Hugh Dickins <hu...@google.com>
> Cc: Johannes Weiner <han...@cmpxchg.org>
> Cc: KOSAKI Motohiro <kosaki.motoh...@jp.fujitsu.com>
> Cc: Mel Gorman <mgor...@suse.de>
> Cc: Jason Evans <j...@fb.com>
> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com>
> Acked-by: Zhang Yanfei <zhangyan...@cn.fujitsu.com>
> Acked-by: Rik van Riel <r...@redhat.com>
> Signed-off-by: Minchan Kim <minc...@kernel.org>

Reviewed-by: Michal Hocko <mho...@suse.cz>
[...]
-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to