Re: [Lhms-devel] [RFC] buddy allocator without bitmap [2/4]
From: Hiroyuki KAMEZAWA <hidden>
Date: 2004-08-26 23:08:45
Also in:
lkml
Hi I understand using these macros cleans up codes as I used them in my previous version. In the previous version, I used SetPagePrivate()/ClearPagePrivate()/PagePrivate(). But these are "atomic" operation and looks very slow. This is why I doesn't used these macros in this version. My previous version, which used set_bit/test_bit/clear_bit, shows very bad performance on my test, and I replaced it. If I made a mistake on measuring the performance and set_bit/test_bit/clear_bit is faster than what I think, I'd like to replace them. -- Kame Dave Hansen wrote:
On Thu, 2004-08-26 at 05:03, Hiroyuki KAMEZAWA wrote:quoted
- MARK_USED(index + size, high, area); + page[size].flags |= (1 << PG_private); + page[size].private = high; } return page; }...quoted
+ /* Atomic operation is needless here */ + page->flags &= ~(1 << PG_private);See linux/page_flags.h: #define SetPagePrivate(page) set_bit(PG_private, &(page)->flags) #define ClearPagePrivate(page) clear_bit(PG_private, &(page)->flags) #define PagePrivate(page) test_bit(PG_private, &(page)->flags) -- Dave
-- --the clue is these footmarks leading to the door.-- KAMEZAWA Hiroyuki [off-list ref] -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>