From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932477AbXGRGel (ORCPT ); Wed, 18 Jul 2007 02:34:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1764338AbXGRGeZ (ORCPT ); Wed, 18 Jul 2007 02:34:25 -0400 Received: from rgminet01.oracle.com ([148.87.113.118]:13836 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764036AbXGRGeY (ORCPT ); Wed, 18 Jul 2007 02:34:24 -0400 Date: Wed, 18 Jul 2007 14:32:14 +0800 From: Joe Jin To: Hugh Dickins Cc: Joe Jin , Andrew Morton , Oleg Nesterov , bill.irwin@oracle.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Add nid sanity on alloc_pages_node Message-ID: <20070718063214.GA26481@joejin-pc.cn.oracle.com> References: <20070712221842.f5e47065.akpm@linux-foundation.org> <20070717093228.3a3638aa.akpm@linux-foundation.org> <20070717115849.9f5e435c.akpm@linux-foundation.org> <20070717130118.bc78d31a.akpm@linux-foundation.org> <20070718014027.GA23559@joejin-pc.cn.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAA== X-Whitelist: TRUE X-Whitelist: TRUE Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On 2007-07-18 05:49, Hugh Dickins wrote: > On Wed, 18 Jul 2007, Joe Jin wrote: > > > > With your patch, I have reproduced the panic: > > That is... surprising to me. (I hadn't been able to reproduce it with > or without the patches: maybe I just need to try harder.) Please post > your gcc --version, and the disassembly (objdump -d) output for > alloc_fresh_huge_page. > It will easy to reproduce, just run following scripts on *2* difference terminal at the same time, I think you will hit it in a short time. #!/bin/bash while : ; do echo 1000000000000 > /proc/sys/vm/nr_hugepages echo 1 > /proc/sys/vm/nr_hugepages echo 10000000000000000000 > /proc/sys/vm/nr_hugepages echo 0 > /proc/sys/vm/nr_hugepages done # gcc --version gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ------------------------------------------------------------------------------------------------------------------------ Disassembly alloc_fresh_huge_page with gdb: 0xffffffff810719cf : mov 3651606(%rip),%r8d # 0xffffffff813ed1ec 0xffffffff810719d6 : mov 2841027(%rip),%rdi # 0xffffffff813273a0 0xffffffff810719dd : mov $0x3f,%eax 0xffffffff810719e2 : push %rbx 0xffffffff810719e3 : lea 0x1(%r8),%esi 0xffffffff810719e7 : sub %r8d,%eax 0xffffffff810719ea : mov %rdi,%rdx 0xffffffff810719ed : cltq 0xffffffff810719ef : mov %sil,%cl 0xffffffff810719f2 : shr %cl,%rdx 0xffffffff810719f5 : bsf %rdx,%rcx 0xffffffff810719f9 : cmove %rax,%rcx 0xffffffff810719fd : lea (%rsi,%rcx,1),%ecx 0xffffffff81071a00 : mov $0x40,%eax 0xffffffff81071a05 : cmp $0x40,%ecx 0xffffffff81071a08 : cmovg %eax,%ecx 0xffffffff81071a0b : cmp $0x40,%ecx 0xffffffff81071a0e : mov %ecx,3651540(%rip) # 0xffffffff813ed1e8 0xffffffff81071a14 : jne 0xffffffff81071a2f 0xffffffff81071a16 : mov $0x40,%eax 0xffffffff81071a1b : bsf %rdi,%rdx 0xffffffff81071a1f : cmove %rax,%rdx 0xffffffff81071a23 : cmp $0x40,%edx 0xffffffff81071a26 : cmovle %edx,%ecx 0xffffffff81071a29 : mov %ecx,3651513(%rip) # 0xffffffff813ed1e8 0xffffffff81071a2f : mov 3651507(%rip),%eax # 0xffffffff813ed1e8 0xffffffff81071a35 : test %eax,%eax 0xffffffff81071a37 : mov %eax,3651503(%rip) # 0xffffffff813ed1ec 0xffffffff81071a3d : jns 0xffffffff81071a47 0xffffffff81071a3f : mov %gs:0x30,%eax 0xffffffff81071a47 : cltq 0xffffffff81071a49 : mov $0x9,%esi 0xffffffff81071a4e : mov $0x242d2,%edi 0xffffffff81071a53 : mov 0xffffffff813260e0(,%rax,8),%rdx 0xffffffff81071a5b : add $0x1860,%rdx 0xffffffff81071a62 : callq 0xffffffff8105d4b8 <__alloc_pages> 0xffffffff81071a67 : mov %rax,%rbx 0xffffffff81071a6a : xor %eax,%eax 0xffffffff81071a6c : test %rbx,%rbx 0xffffffff81071a6f : je 0xffffffff81071ab4 0xffffffff81071a71 : movq $0xffffffff81072a02,0x60(%rbx) 0xffffffff81071a79 : mov $0xffffffff812e6c68,%rdi 0xffffffff81071a80 : callq 0xffffffff81217952 <_spin_lock> 0xffffffff81071a85 : incq 3651428(%rip) # 0xffffffff813ed1f0 0xffffffff81071a8c : mov (%rbx),%rax 0xffffffff81071a8f : shr $0x2d,%rax 0xffffffff81071a93 : and $0x3f,%eax 0xffffffff81071a96 : incl 0xffffffff813ed620(,%rax,4) 0xffffffff81071a9d : movl $0x1,2576833(%rip) # 0xffffffff812e6c68 0xffffffff81071aa7 : mov %rbx,%rdi 0xffffffff81071aaa : callq 0xffffffff8105f9cc 0xffffffff81071aaf : mov $0x1,%eax 0xffffffff81071ab4 : pop %rbx 0xffffffff81071ab5 : retq Thanks, Joe