Dnia piątek, 3 lutego 2012 o 18:28:13 Radosław Smogura napisał(a): > Compound pages are now refcounted in way allowing tracking of tail pages > and automatically free of compound page when all references (counter) > fell to zero. This in addition make get_page and get_page_unless_zero > similar in work, as well put_page and put_page_unless_zero. In addition > it makes procedures more friendly. One thing that should be taken, by > developer, on account is to take care when page is putted or geted when > compound lock is obtained, to avoid deadlocks. Locking is used to > prevent concurrent compound split and only when page refcount goes from > 0 to 1 or vice versa. > > Technically implementation uses 3rd element of compound page to store > "tails usage counter". This counter is decremented when tail pages count > goes to zero, and bumped when tail page is getted from zero usage > (recovered) – this is to keep backward compatible usage of tail pages. > If "tails usage counter" fell to zero head counter is decremented, if > "tails usage counter" is increased to one the head count is increased, > too. For compound pages without 3rd element (order of 1, two pages) 2nd > page count is used in similar way as for higher order pages. > > Signed-off-by: Radosław Smogura <mail@xxxxxxxxxx> > --- > include/linux/mm.h | 94 ++++++++++++----- > include/linux/mm_types.h | 24 ++++- > include/linux/pagemap.h | 1 - > mm/huge_memory.c | 25 +---- > mm/internal.h | 46 --------- > mm/memory.c | 2 +- > mm/page_alloc.c | 2 + > mm/swap.c | 254 > +++++++++++++++++++++++++++++----------------- 8 files changed, 256 > insertions(+), 192 deletions(-) <snip> I would like to say huge sorry, I sent wrong patch (yesterday work). Please discard previous patch, and consider patch I will send in reply to this email. Not included change was introduced to allow proper concurrent work of get/put page and split page . Regards, Radosław Smogura -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href