From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gu Zheng Subject: [PATCH 0/2] Add support to aio ring pages migration Date: Mon, 08 Jul 2013 18:38:52 +0800 Message-ID: <51DA96BC.1060701@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: KAMEZAWA Hiroyuki , tangchen , linux-fsdevel , linux-kernel , linux-mm@kvack.org To: Andrew Morton , Mel Gorman , Benjamin LaHaise , Al Viro Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:34609 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751213Ab3GHKmM (ORCPT ); Mon, 8 Jul 2013 06:42:12 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Currently aio ring pages use get_user_pages() to allocate pages from movable zone,as discussed in thread https://lkml.org/lkml/2012/11/29/69, it is easy to pin user pages for a long time, which is fatal for memory hotplug/remove framework. As Mel Gorman suggested, "Implement a callback for migration to unpin pages, barrier operations until migration completes and pin the new pfns" can soloved this issue. And the best palce to hold the callbacks is address space operations which can be found via page->mapping. But the current aio ring pages are anonymous pages, they don't have address_space_operations, so we use an anon inode file as the aio ring file to manage the aio ring pages, so that we can implement the callback and register it to page->mmapping->a_ops->migratepage. But there's a ploblem that all files created by anon_inode_getfile() share the same inode, so mutil aio context will share the same aio ring pages, it'll lead to io events chaos. In order to solve this issus, we introduce a new fucntion anon_inode_getfile_private() which is samilar to anon_inode_getfile(), but each new file has its own anon inode. This work is based on Benjamin's patch, http://www.spinics.net/lists/linux-fsdevel/msg66014.html Gu Zheng (2): fs/anon_inode: Introduce a new lib function anon_inode_getfile_private() fs/aio: Add support to aio ring pages migration fs/aio.c | 120 +++++++++++++++++++++++++++++++++++++++---- fs/anon_inodes.c | 66 +++++++++++++++++++++++ include/linux/anon_inodes.h | 3 + include/linux/migrate.h | 3 + mm/migrate.c | 2 +- 5 files changed, 182 insertions(+), 12 deletions(-) -- 1.7.7 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <51DA96BC.1060701@cn.fujitsu.com> Date: Mon, 08 Jul 2013 18:38:52 +0800 From: Gu Zheng MIME-Version: 1.0 Subject: [PATCH 0/2] Add support to aio ring pages migration Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Mel Gorman , Benjamin LaHaise , Al Viro Cc: KAMEZAWA Hiroyuki , tangchen , linux-fsdevel , linux-kernel , linux-mm@kvack.org Currently aio ring pages use get_user_pages() to allocate pages from movable zone,as discussed in thread https://lkml.org/lkml/2012/11/29/69, it is easy to pin user pages for a long time, which is fatal for memory hotplug/remove framework. As Mel Gorman suggested, "Implement a callback for migration to unpin pages, barrier operations until migration completes and pin the new pfns" can soloved this issue. And the best palce to hold the callbacks is address space operations which can be found via page->mapping. But the current aio ring pages are anonymous pages, they don't have address_space_operations, so we use an anon inode file as the aio ring file to manage the aio ring pages, so that we can implement the callback and register it to page->mmapping->a_ops->migratepage. But there's a ploblem that all files created by anon_inode_getfile() share the same inode, so mutil aio context will share the same aio ring pages, it'll lead to io events chaos. In order to solve this issus, we introduce a new fucntion anon_inode_getfile_private() which is samilar to anon_inode_getfile(), but each new file has its own anon inode. This work is based on Benjamin's patch, http://www.spinics.net/lists/linux-fsdevel/msg66014.html Gu Zheng (2): fs/anon_inode: Introduce a new lib function anon_inode_getfile_private() fs/aio: Add support to aio ring pages migration fs/aio.c | 120 +++++++++++++++++++++++++++++++++++++++---- fs/anon_inodes.c | 66 +++++++++++++++++++++++ include/linux/anon_inodes.h | 3 + include/linux/migrate.h | 3 + mm/migrate.c | 2 +- 5 files changed, 182 insertions(+), 12 deletions(-) -- 1.7.7 -- 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: email@kvack.org