From a8a03f1fed672cc310feb3f5fafdc9e0e7a6546f Mon Sep 17 00:00:00 2001 From: Aubrey.Li Date: Wed, 22 Nov 2006 15:10:18 +0800 Subject: [PATCH] Drop VFS cache when there is not enough free memory to allocate Signed-off-by: Aubrey.Li --- mm/page_alloc.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index bf2f6cf..62559fd 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1039,6 +1039,11 @@ restart: if (page) goto got_pg; +#if defined(CONFIG_EMBEDDED) && !defined(CONFIG_MMU) + drop_pagecache(); + drop_slab(); +#endif + /* This allocation should allow future memory freeing. */ if (((p->flags & PF_MEMALLOC) || unlikely(test_thread_flag(TIF_MEMDIE))) -- 1.4.2