[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150203105007.GP2395@suse.de>
Date: Tue, 3 Feb 2015 10:50:07 +0000
From: Mel Gorman <mgorman@...e.de>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, Minchan Kim <minchan@...nel.org>,
Vlastimil Babka <vbabka@...e.cz>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] mm: madvise: Ignore repeated MADV_DONTNEED hints
On Mon, Feb 02, 2015 at 02:35:41PM -0800, Andrew Morton wrote:
> On Mon, 2 Feb 2015 22:18:24 +0000 Mel Gorman <mgorman@...e.de> wrote:
>
> > > Is there something
> > > preventing this from being addressed within glibc?
> >
> > I doubt it other than I expect they'll punt it back and blame either the
> > application for being stupid or the kernel for being slow.
>
> *Is* the application being stupid? What is it actually doing?
Only a little. There is little simulated think time between the allocation
and the subsequent free. It means the cost of alloc/free dominates where
in "real" applications they would either be reusing buffers if they were
constantly needed or the think time would mask the cost of the free.
> Something like
>
> pthread_routine()
> {
> p = malloc(X);
> do_some(work);
> free(p);
> return;
> }
>
Pretty much. There is a search_mem() function that
alloc(copy_size)
memcpy
search
free(copy)
A real application might try and avoid the copy or reuse buffers if they
encountered this particular problem.
--
Mel Gorman
SUSE Labs
--
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