From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 26 Sep 2008 18:28:33 +0900 From: KAMEZAWA Hiroyuki Subject: Re: [PATCH 0/12] memcg updates v5 Message-Id: <20080926182833.95783a72.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20080926142455.5b0e239e.nishimura@mxp.nes.nec.co.jp> References: <20080925151124.25898d22.kamezawa.hiroyu@jp.fujitsu.com> <20080926113228.ee377330.nishimura@mxp.nes.nec.co.jp> <20080926115810.b5fbae51.kamezawa.hiroyu@jp.fujitsu.com> <20080926120408.39187294.kamezawa.hiroyu@jp.fujitsu.com> <20080926120019.33d58ca4.nishimura@mxp.nes.nec.co.jp> <20080926130534.e16c9317.kamezawa.hiroyu@jp.fujitsu.com> <20080926142455.5b0e239e.nishimura@mxp.nes.nec.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Daisuke Nishimura Cc: "linux-mm@kvack.org" , "balbir@linux.vnet.ibm.com" , "xemul@openvz.org" , Andrew Morton , LKML , Dave Hansen , ryov@valinux.co.jp List-ID: On Fri, 26 Sep 2008 14:24:55 +0900 Daisuke Nishimura wrote: > On Fri, 26 Sep 2008 13:05:34 +0900, KAMEZAWA Hiroyuki wrote: > > On Fri, 26 Sep 2008 12:00:19 +0900 > > Daisuke Nishimura wrote: > > > > > I'll test it with updated version of 9-11 and report you back. > > > > > Thank you. below is the new one...(Sorry!) > > > > -Kame > > == > > Check LRU bit under lru_lock. > > > > Signed-off-by: KAMEZAWA Hiroyuki > > > > mm/memcontrol.c | 9 +++++---- > > 1 file changed, 5 insertions(+), 4 deletions(-) > > > > Index: mmotm-2.6.27-rc7+/mm/memcontrol.c > > =================================================================== > > --- mmotm-2.6.27-rc7+.orig/mm/memcontrol.c > > +++ mmotm-2.6.27-rc7+/mm/memcontrol.c > > @@ -340,11 +340,12 @@ void mem_cgroup_move_lists(struct page * > > if (!trylock_page_cgroup(pc)) > > return; > > > > - if (PageCgroupUsed(pc) && PageCgroupLRU(pc)) { > > + if (PageCgroupUsed(pc)) { > > mem = pc->mem_cgroup; > > mz = page_cgroup_zoneinfo(pc); > > spin_lock_irqsave(&mz->lru_lock, flags); > > - __mem_cgroup_move_lists(pc, lru); > > + if (PageCgroupLRU(pc)) > > + __mem_cgroup_move_lists(pc, lru); > > spin_unlock_irqrestore(&mz->lru_lock, flags); > > } > > unlock_page_cgroup(pc); > > @@ -564,8 +565,8 @@ __release_page_cgroup(struct memcg_percp > > spin_lock(&mz->lru_lock); > > } > > if (!PageCgroupUsed(pc) && PageCgroupLRU(pc)) { > > - __mem_cgroup_remove_list(mz, pc); > > ClearPageCgroupLRU(pc); > > + __mem_cgroup_remove_list(mz, pc); > > } > > } > > if (prev_mz) > > @@ -597,8 +598,8 @@ __set_page_cgroup_lru(struct memcg_percp > > spin_lock(&mz->lru_lock); > > } > > if (PageCgroupUsed(pc) && !PageCgroupLRU(pc)) { > > - SetPageCgroupLRU(pc); > > __mem_cgroup_add_list(mz, pc); > > + SetPageCgroupLRU(pc); > > } > > } > > > > > > Unfortunately, there remains some bugs yet... > I confirmed I can reproduce this. I found one chance to cause this. (and confirmed this happens by printk) set_lru().. TestSetPageCgroup(pc); .... if (PageCgroupUsed(pc) && !PageCgroupLRU(pc)) pc->mem_cgroup = mem; SetPageCgroupLRU(); __mem_cgroup_add_list(); Then, page_cgroup will be added to wrong LRU whic doesn't match pc->mem_cgroup. But there is still more...still digging. Thanks, -kame > ------------[ cut here ]------------ > WARNING: at lib/list_debug.c:51 list_del+0x5c/0x87() > list_del corruption. next->prev should be ffff88010ca291e8, but was dead000000200200 > Modules linked in: ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp ipv6 > autofs4 hidp rfcomm l2cap bluetooth sunrpc microcode dm_mirror dm_log dm_multipath dm_mod > rfkill input_polldev sbs sbshc battery ac lp sg e1000 ide_cd_mod cdrom button acpi_memhotp > lug parport_pc rtc_cmos rtc_core parport serio_raw rtc_lib i2c_i801 i2c_core shpchp pcspkr > ata_piix libata megaraid_mbox megaraid_mm sd_mod scsi_mod ext3 jbd ehci_hcd ohci_hcd uhci > _hcd > Pid: 3940, comm: bash Tainted: G W 2.6.27-rc7-mm1-dd8bf0fe #1 > Call Trace: > [] warn_slowpath+0xb4/0xd2 > [] prepare_to_wait_exclusive+0x38/0x5a > [] finish_wait+0x32/0x5d > [] __wait_on_bit_lock+0x5b/0x66 > [] __lock_page+0x5e/0x64 > [] target_load+0x2a/0x58 > [] place_entity+0x85/0xb3 > [] enqueue_entity+0x16e/0x18f > [] zone_statistics+0x3a/0x5d > [] zone_statistics+0x3a/0x5d > [] get_page_from_freelist+0x455/0x5bf > [] list_del+0x5c/0x87 > [] mem_cgroup_commit_charge+0x6f/0xdd > [] mem_cgroup_charge_common+0x4c/0x62 > [] handle_mm_fault+0x222/0x791 > [] zone_statistics+0x3a/0x5d > [] follow_page+0x2d/0x2c2 > [] __get_user_pages+0x2f5/0x3f3 > [] get_arg_page+0x46/0xa5 > [] copy_strings+0xfc/0x1de > [] copy_strings_kernel+0x21/0x33 > [] do_execve+0x140/0x256 > [] sys_execve+0x35/0x4c > [] stub_execve+0x6a/0xc0 > ---[ end trace 4eaa2a86a8e2da22 ]--- > ------------[ cut here ]------------ > WARNING: at lib/list_debug.c:48 list_del+0x30/0x87() > list_del corruption. prev->next should be ffff88010ca29210, but was dead000000100100 > Modules linked in: ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp ipv6 > autofs4 hidp rfcomm l2cap bluetooth sunrpc microcode dm_mirror dm_log dm_multipath dm_mod > rfkill input_polldev sbs sbshc battery ac lp sg e1000 ide_cd_mod cdrom button acpi_memhotp > lug parport_pc rtc_cmos rtc_core parport serio_raw rtc_lib i2c_i801 i2c_core shpchp pcspkr > ata_piix libata megaraid_mbox megaraid_mm sd_mod scsi_mod ext3 jbd ehci_hcd ohci_hcd uhci > _hcd > Pid: 3940, comm: bash Tainted: G W 2.6.27-rc7-mm1-dd8bf0fe #1 > Call Trace: > [] warn_slowpath+0xb4/0xd2 > [] __getblk+0x25/0x21f > [] __ext3_journal_dirty_metadata+0x1e/0x46 [ext3] > [] __wake_up+0x38/0x4f > [] __mark_inode_dirty+0x15c/0x16b > [] touch_atime+0x109/0x112 > [] mnt_drop_write+0x25/0xdc > [] generic_file_aio_read+0x4b8/0x515 > [] list_del+0x30/0x87 > [] __release_page_cgroup+0x68/0x8a > [] page_remove_rmap+0x10e/0x12e > [] unmap_vmas+0x476/0x7f2 > [] exit_mmap+0xf0/0x176 > [] secure_ip_id+0x45/0x4a > [] mmput+0x30/0x88 > [] flush_old_exec+0x487/0x77c > [] vfs_read+0x11e/0x133 > [] load_elf_binary+0x338/0x16b6 > [] get_arg_page+0x46/0xa5 > [] copy_strings+0x1cd/0x1de > [] search_binary_handler+0xb0/0x22e > [] do_execve+0x1a8/0x256 > [] sys_execve+0x35/0x4c > [] stub_execve+0x6a/0xc0 > ---[ end trace 4eaa2a86a8e2da22 ]--- > ------------[ cut here ]------------ > WARNING: at lib/list_debug.c:48 list_del+0x30/0x87() > list_del corruption. prev->next should be ffff88010c937d50, but was ffff88010ca052e8 > Modules linked in: ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp ipv6 > autofs4 hidp rfcomm l2cap bluetooth sunrpc microcode dm_mirror dm_log dm_multipath dm_mod > rfkill input_polldev sbs sbshc battery ac lp sg e1000 ide_cd_mod cdrom button acpi_memhotp > lug parport_pc rtc_cmos rtc_core parport serio_raw rtc_lib i2c_i801 i2c_core shpchp pcspkr > ata_piix libata megaraid_mbox megaraid_mm sd_mod scsi_mod ext3 jbd ehci_hcd ohci_hcd uhci > _hcd > Pid: 3943, comm: shmem_test_02 Tainted: G W 2.6.27-rc7-mm1-dd8bf0fe #1 > Call Trace: > [] warn_slowpath+0xb4/0xd2 > [] shmem_getpage+0x75/0x7a0 > [] zone_statistics+0x3a/0x5d > [] get_page_from_freelist+0x353/0x5bf > [] zone_statistics+0x3a/0x5d > [] get_page_from_freelist+0x353/0x5bf > [] list_del+0x30/0x87 > [] mem_cgroup_commit_charge+0x6f/0xdd > [] mem_cgroup_charge_common+0x4c/0x62 > [] do_wp_page+0x3ab/0x58a > [] handle_mm_fault+0x735/0x791 > [] fcntl_setlk+0x233/0x263 > [] do_page_fault+0x39c/0x773 > [] error_exit+0x0/0x51 > ---[ end trace 4eaa2a86a8e2da22 ]--- > ------------[ cut here ]------------ > WARNING: at lib/list_debug.c:48 list_del+0x30/0x87() > list_del corruption. prev->next should be ffff88010ca052e8, but was ffff88010c4068a0 > Modules linked in: ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp ipv6 > autofs4 hidp rfcomm l2cap bluetooth sunrpc microcode dm_mirror dm_log dm_multipath dm_mod > rfkill input_polldev sbs sbshc battery ac lp sg e1000 ide_cd_mod cdrom button acpi_memhotp > lug parport_pc rtc_cmos rtc_core parport serio_raw rtc_lib i2c_i801 i2c_core shpchp pcspkr > ata_piix libata megaraid_mbox megaraid_mm sd_mod scsi_mod ext3 jbd ehci_hcd ohci_hcd uhci > _hcd > Pid: 3942, comm: shmem_test_02 Tainted: G W 2.6.27-rc7-mm1-dd8bf0fe #1 > Call Trace: > [] warn_slowpath+0xb4/0xd2 > [] rmqueue_bulk+0x61/0x8b > [] number+0x106/0x1f9 > [] zone_statistics+0x3a/0x5d > [] get_page_from_freelist+0x353/0x5bf > [] free_pages_bulk+0x198/0x20b > [] __pagevec_free+0x21/0x2e > [] release_pages+0x151/0x19f > [] list_del+0x30/0x87 > [] __release_page_cgroup+0x68/0x8a > [] __remove_from_page_cache+0x45/0x8f > [] remove_from_page_cache+0x27/0x2f > [] truncate_complete_page+0x49/0x59 > [] truncate_inode_pages_range+0xbd/0x2ff > [] shmem_delete_inode+0x33/0xc4 > [] shmem_delete_inode+0x0/0xc4 > [] generic_delete_inode+0xb0/0x124 > [] d_kill+0x21/0x43 > [] dput+0x111/0x11f > [] __fput+0x14f/0x17e > [] remove_vma+0x3d/0x72 > [] exit_mmap+0x157/0x176 > [] mmput+0x30/0x88 > [] exit_mm+0xff/0x10a > [] do_exit+0x210/0x7a5 > [] audit_syscall_entry+0x12d/0x160 > [] do_group_exit+0x66/0x96 > [] system_call_fastpath+0x16/0x1b > ---[ end trace 4eaa2a86a8e2da22 ]--- > ------------[ cut here ]------------ > WARNING: at lib/list_debug.c:51 list_del+0x5c/0x87() > list_del corruption. next->prev should be ffff88010caf6b20, but was dead000000200200 > Modules linked in: ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp ipv6 > autofs4 hidp rfcomm l2cap bluetooth sunrpc microcode dm_mirror dm_log dm_multipath dm_mod > rfkill input_polldev sbs sbshc battery ac lp sg e1000 ide_cd_mod cdrom button acpi_memhotp > lug parport_pc rtc_cmos rtc_core parport serio_raw rtc_lib i2c_i801 i2c_core shpchp pcspkr > ata_piix libata megaraid_mbox megaraid_mm sd_mod scsi_mod ext3 jbd ehci_hcd ohci_hcd uhci > _hcd > Pid: 3932, comm: page01 Tainted: G W 2.6.27-rc7-mm1-dd8bf0fe #1 > Call Trace: > [] warn_slowpath+0xb4/0xd2 > [] free_pages_bulk+0x198/0x20b > [] release_pages+0x18d/0x19f > [] list_del+0x5c/0x87 > [] __release_page_cgroup+0x68/0x8a > [] page_remove_rmap+0x10e/0x12e > [] unmap_vmas+0x476/0x7f2 > [] exit_mmap+0xf0/0x176 > [] mmput+0x30/0x88 > [] exit_mm+0xff/0x10a > [] do_exit+0x210/0x7a5 > [] audit_syscall_entry+0x12d/0x160 > [] do_group_exit+0x66/0x96 > [] system_call_fastpath+0x16/0x1b > ---[ end trace 4eaa2a86a8e2da22 ]--- > ------------[ cut here ]------------ > WARNING: at lib/list_debug.c:48 list_del+0x30/0x87() > list_del corruption. prev->next should be ffff88010c4068a0, but was dead000000100100 > Modules linked in: ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp ipv6 > autofs4 hidp rfcomm l2cap bluetooth sunrpc microcode dm_mirror dm_log dm_multipath dm_mod > rfkill input_polldev sbs sbshc battery ac lp sg e1000 ide_cd_mod cdrom button acpi_memhotp > lug parport_pc rtc_cmos rtc_core parport serio_raw rtc_lib i2c_i801 i2c_core shpchp pcspkr > ata_piix libata megaraid_mbox megaraid_mm sd_mod scsi_mod ext3 jbd ehci_hcd ohci_hcd uhci > _hcd > Pid: 3934, comm: page01 Tainted: G W 2.6.27-rc7-mm1-dd8bf0fe #1 > Call Trace: > [] warn_slowpath+0xb4/0xd2 > [] do_get_write_access+0x37d/0x3c3 [jbd] > [] __getblk+0x25/0x21f > [] bit_waitqueue+0x10/0xa0 > [] do_get_write_access+0x37d/0x3c3 [jbd] > [] bit_waitqueue+0x10/0xa0 > [] find_get_page+0x18/0xc4 > [] bit_waitqueue+0x10/0xa0 > [] list_del+0x30/0x87 > [] __release_page_cgroup+0x68/0x8a > [] page_remove_rmap+0x10e/0x12e > [] unmap_vmas+0x476/0x7f2 > [] exit_mmap+0xf0/0x176 > [] mmput+0x30/0x88 > [] exit_mm+0xff/0x10a > [] do_exit+0x210/0x7a5 > [] audit_syscall_entry+0x12d/0x160 > [] do_group_exit+0x66/0x96 > [] system_call_fastpath+0x16/0x1b > ---[ end trace 4eaa2a86a8e2da22 ]--- > -- 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