[lkml]   [2004]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectUnnecessary barrier in sync_page()?

Hi Chris,

I was talking to Andrew about this memory barrier

static inline int sync_page(struct page *page)
struct address_space *mapping;

* FIXME, fercrissake. What is this barrier here for?
mapping = page_mapping(page);
if (mapping && mapping->a_ops && mapping->a_ops->sync_page)
return mapping->a_ops->sync_page(page);
return 0;

And does not seem to be a reason for it. The callers are:

void fastcall wait_on_page_bit(struct page *page, int bit_nr)
wait_queue_head_t *waitqueue = page_waitqueue(page);
DEFINE_PAGE_WAIT(wait, page, bit_nr);

do {
prepare_to_wait(waitqueue, &wait.wait, TASK_UNINTERRUPTIBLE);
if (test_bit(bit_nr, &page->flags)) {
} while (test_bit(bit_nr, &page->flags));
finish_wait(waitqueue, &wait.wait);

void fastcall __lock_page(struct page *page)
wait_queue_head_t *wqh = page_waitqueue(page);
DEFINE_PAGE_WAIT_EXCLUSIVE(wait, page, PG_locked);

while (TestSetPageLocked(page)) {
prepare_to_wait_exclusive(wqh, &wait.wait, TASK_UNINTERRUPTIBLE);
if (PageLocked(page)) {
finish_wait(wqh, &wait.wait);

Both callers call set_bit (atomic operation which cannot be reordered) before
sync_page(), so.. what is the barrier trying to guarantee?


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:04    [W:0.055 / U:4.276 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site