[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAmzW4MPkFzV0kuQy=nE9nWqFRWCq3S00_DgGiYtPtf2Lzp7_A@mail.gmail.com>
Date: Wed, 18 Mar 2015 14:52:03 +0900
From: Joonsoo Kim <js1304@...il.com>
To: Roman Pen <r.peniaev@...il.com>
Cc: Nick Piggin <npiggin@...nel.dk>,
Zhang Yanfei <zhangyanfei@...fujitsu.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Eric Dumazet <edumazet@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
David Rientjes <rientjes@...gle.com>,
WANG Chao <chaowang@...hat.com>,
Fabian Frederick <fabf@...net.be>,
Christoph Lameter <cl@...ux.com>, Gioh Kim <gioh.kim@....com>,
Rob Jones <rob.jones@...ethink.co.uk>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] mm/vmalloc: get rid of dirty bitmap inside vmap_block structure
2015-03-13 21:12 GMT+09:00 Roman Pen <r.peniaev@...il.com>:
> In original implementation of vm_map_ram made by Nick Piggin there were two
> bitmaps: alloc_map and dirty_map. None of them were used as supposed to be:
> finding a suitable free hole for next allocation in block. vm_map_ram allocates
> space sequentially in block and on free call marks pages as dirty, so freed
> space can't be reused anymore.
>
> Actually would be very interesting to know the real meaning of those bitmaps,
> maybe implementation was incomplete, etc.
>
> But long time ago Zhang Yanfei removed alloc_map by these two commits:
>
> mm/vmalloc.c: remove dead code in vb_alloc
> 3fcd76e8028e0be37b02a2002b4f56755daeda06
> mm/vmalloc.c: remove alloc_map from vmap_block
> b8e748b6c32999f221ea4786557b8e7e6c4e4e7a
>
> In current patch I replaced dirty_map with two range variables: dirty min and
> max. These variables store minimum and maximum position of dirty space in a
> block, since we need only to know the dirty range, not exact position of dirty
> pages.
>
> Why it was made? Several reasons: at first glance it seems that vm_map_ram
> allocator concerns about fragmentation thus it uses bitmaps for finding free
> hole, but it is not true. To avoid complexity seems it is better to use
> something simple, like min or max range values. Secondly, code also becomes
> simpler, without iteration over bitmap, just comparing values in min and max
> macros. Thirdly, bitmap occupies up to 1024 bits (4MB is a max size of a
> block). Here I replaced the whole bitmap with two longs.
>
> Finally vm_unmap_aliases should be slightly faster and the whole vmap_block
> structure occupies less memory.
>
> Signed-off-by: Roman Pen <r.peniaev@...il.com>
> Cc: Nick Piggin <npiggin@...nel.dk>
> Cc: Zhang Yanfei <zhangyanfei@...fujitsu.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Eric Dumazet <edumazet@...gle.com>
> Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
> Cc: David Rientjes <rientjes@...gle.com>
> Cc: WANG Chao <chaowang@...hat.com>
> Cc: Fabian Frederick <fabf@...net.be>
> Cc: Christoph Lameter <cl@...ux.com>
> Cc: Gioh Kim <gioh.kim@....com>
> Cc: Rob Jones <rob.jones@...ethink.co.uk>
> Cc: linux-mm@...ck.org
> Cc: linux-kernel@...r.kernel.org
Acked-by: Joonsoo Kim <iamjoonsoo.kim@....com>
--
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