* Hang in filemap_fdatasync on SMP machine
@ 2003-04-10 18:01 Deepa Chacko Pillai
0 siblings, 0 replies; only message in thread
From: Deepa Chacko Pillai @ 2003-04-10 18:01 UTC (permalink / raw)
To: linux-mm
Hi
I have written a kernel API to flush data to the disk. Whenever I call this API on an SMP machine, it causes the system to hang. The code looks like:
down(&inode->i_sem);
ret = filemap_fdatasync(inode->i_mapping);
err = file->f_op->fsync(file, dentry, 0);
if (err && !ret)
ret = err;
err = filemap_fdatawait(inode->i_mapping);
if (err && !ret)
ret = err;
up(&inode->i_sem);
This code works perfectly fine on uniprocessor systems. But it hangs in filemap_fdatasync on SMP systems. It goes in an infinite loop in filemap_fdatasync (). Inside filemap_fdatasync (), it finds that the page is not dirty and keeps going in a loop.
while (!list_empty(&mapping->dirty_pages)) {
struct page *page = list_entry(mapping->dirty_pages.prev, struct page, list);
list_del(&page->list);
list_add(&page->list, &mapping->locked_pages);
if (!PageDirty(page))
continue;
....
}
I am using Red Hat Linux with kernel version 2.4.19. Any help would be much appreciated.
Thanks
Deepa
--
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>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-04-10 18:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-10 18:01 Hang in filemap_fdatasync on SMP machine Deepa Chacko Pillai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox