From: Mel Gorman Subject: Re: [PATCH] mm: disallow direct reclaim page writeback Date: Wed, 14 Apr 2010 11:07:24 +0100 Message-ID: <20100414100724.GK25756@csn.ul.ie> References: <20100414135945.2b0a1e0d.kamezawa.hiroyu@jp.fujitsu.com> <20100414054144.GH2493@dastard> <20100414145056.D147.A69D9226@jp.fujitsu.com> <20100414184213.f6bf11a7.kamezawa.hiroyu@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Cc: KAMEZAWA Hiroyuki , KOSAKI Motohiro , Dave Chinner , Chris Mason , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org To: Minchan Kim Return-path: Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Apr 14, 2010 at 07:01:47PM +0900, Minchan Kim wrote: > >> >>> > Dave Chinner wrote: > >> >>> > > >> >>> > > =A050) =A0 =A0 3168 =A0 =A0 =A064 =A0 xfs_vm_writepage+0xab/= 0x160 [xfs] > >> >>> > > =A051) =A0 =A0 3104 =A0 =A0 384 =A0 shrink_page_list+0x65e/0= x840 > >> >>> > > =A052) =A0 =A0 2720 =A0 =A0 528 =A0 shrink_zone+0x63f/0xe10 > >> >>> > > >> >>> > A bit OFF TOPIC. > >> >>> > > >> >>> > Could you share disassemble of shrink_zone() ? > >> >>> > > >> >>> > In my environ. > >> >>> > 00000000000115a0 : > >> >>> > =A0 =A0115a0: =A0 =A0 =A0 55 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0push =A0 %rbp > >> >>> > =A0 =A0115a1: =A0 =A0 =A0 48 89 e5 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0mov =A0 =A0%rsp,%rbp > >> >>> > =A0 =A0115a4: =A0 =A0 =A0 41 57 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 push =A0 %r15 > >> >>> > =A0 =A0115a6: =A0 =A0 =A0 41 56 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 push =A0 %r14 > >> >>> > =A0 =A0115a8: =A0 =A0 =A0 41 55 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 push =A0 %r13 > >> >>> > =A0 =A0115aa: =A0 =A0 =A0 41 54 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 push =A0 %r12 > >> >>> > =A0 =A0115ac: =A0 =A0 =A0 53 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0push =A0 %rbx > >> >>> > =A0 =A0115ad: =A0 =A0 =A0 48 83 ec 78 =A0 =A0 =A0 =A0 =A0 =A0 = sub =A0 =A0$0x78,%rsp > >> >>> > =A0 =A0115b1: =A0 =A0 =A0 e8 00 00 00 00 =A0 =A0 =A0 =A0 =A0ca= llq =A0115b6 > >> >>> > =A0 =A0115b6: =A0 =A0 =A0 48 89 75 80 =A0 =A0 =A0 =A0 =A0 =A0 = mov =A0 =A0%rsi,-0x80(%rbp) > >> >>> > > >> >>> > disassemble seems to show 0x78 bytes for stack. And no changes= to %rsp > >> >>> > until retrun. > >> >>> > >> >>> I see the same. I didn't compile those kernels, though. IIUC, > >> >>> they were built through the Ubuntu build infrastructure, so ther= e is > >> >>> something different in terms of compiler, compiler options or co= nfig > >> >>> to what we are both using. Most likely it is the compiler inlini= ng, > >> >>> though Chris's patches to prevent that didn't seem to change the > >> >>> stack usage. > >> >>> > >> >>> I'm trying to get a stack trace from the kernel that has shrink_= zone > >> >>> in it, but I haven't succeeded yet.... > >> >> > >> >> I also got 0x78 byte stack usage. Umm.. Do we discussed real issu= e now? > >> >> > >> > > >> > In my case, 0x110 byte in 32 bit machine. > >> > I think it's possible in 64 bit machine. > >> > > >> > 00001830 : > >> > =A0 =A01830: =A0 =A0 =A0 55 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0push =A0 %ebp > >> > =A0 =A01831: =A0 =A0 =A0 89 e5 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= mov =A0 =A0%esp,%ebp > >> > =A0 =A01833: =A0 =A0 =A0 57 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0push =A0 %edi > >> > =A0 =A01834: =A0 =A0 =A0 56 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0push =A0 %esi > >> > =A0 =A01835: =A0 =A0 =A0 53 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0push =A0 %ebx > >> > =A0 =A01836: =A0 =A0 =A0 81 ec 10 01 00 00 =A0 =A0 =A0 sub =A0 =A0= $0x110,%esp > >> > =A0 =A0183c: =A0 =A0 =A0 89 85 24 ff ff ff =A0 =A0 =A0 mov =A0 =A0= %eax,-0xdc(%ebp) > >> > =A0 =A01842: =A0 =A0 =A0 89 95 20 ff ff ff =A0 =A0 =A0 mov =A0 =A0= %edx,-0xe0(%ebp) > >> > =A0 =A01848: =A0 =A0 =A0 89 8d 1c ff ff ff =A0 =A0 =A0 mov =A0 =A0= %ecx,-0xe4(%ebp) > >> > =A0 =A0184e: =A0 =A0 =A0 8b 41 04 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m= ov =A0 =A00x4(%ecx) > >> > > >> > my gcc is following as. > >> > > >> > barrios@barriostarget:~/mmotm$ gcc -v > >> > Using built-in specs. > >> > Target: i486-linux-gnu > >> > Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu > >> > 4.3.3-5ubuntu4' > >> > --with-bugurl=3Dfile:///usr/share/doc/gcc-4.3/README.Bugs > >> > --enable-languages=3Dc,c++,fortran,objc,obj-c++ --prefix=3D/usr > >> > --enable-shared --with-system-zlib --libexecdir=3D/usr/lib > >> > --without-included-gettext --enable-threads=3Dposix --enable-nls > >> > --with-gxx-include-dir=3D/usr/include/c++/4.3 --program-suffix=3D-= 4.3 > >> > --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-objc-gc > >> > --enable-mpfr --enable-targets=3Dall --with-tune=3Dgeneric > >> > --enable-checking=3Drelease --build=3Di486-linux-gnu --host=3Di486= -linux-gnu > >> > --target=3Di486-linux-gnu > >> > Thread model: posix > >> > gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) > >> > > >> > > >> > Is it depends on config? > >> > I attach my config. > >> > >> I changed shrink list by noinline_for_stack. > >> The result is following as. > >> > >> > >> 00001fe0 : > >> =A0 =A0 1fe0: =A0 =A0 =A0 55 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0push =A0 %ebp > >> =A0 =A0 1fe1: =A0 =A0 =A0 89 e5 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = mov =A0 =A0%esp,%ebp > >> =A0 =A0 1fe3: =A0 =A0 =A0 57 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0push =A0 %edi > >> =A0 =A0 1fe4: =A0 =A0 =A0 56 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0push =A0 %esi > >> =A0 =A0 1fe5: =A0 =A0 =A0 53 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0push =A0 %ebx > >> =A0 =A0 1fe6: =A0 =A0 =A0 83 ec 4c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0su= b =A0 =A0$0x4c,%esp > >> =A0 =A0 1fe9: =A0 =A0 =A0 89 45 c0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mo= v =A0 =A0%eax,-0x40(%ebp) > >> =A0 =A0 1fec: =A0 =A0 =A0 89 55 bc =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mo= v =A0 =A0%edx,-0x44(%ebp) > >> =A0 =A0 1fef: =A0 =A0 =A0 89 4d b8 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mo= v =A0 =A0%ecx,-0x48(%ebp) > >> > >> 0x110 -> 0x4c. > >> > >> Should we have to add noinline_for_stack for shrink_list? > >> > > > > Hmm. about shirnk_zone(), I don't think uninlining functions directly= called > > by shrink_zone() can be a help. > > Total stack size of call-chain will be still big. >=20 > Absolutely. > But above 500 byte usage is one of hogger and uninlining is not > critical about reclaim performance. So I think we don't get any lost > than gain. >=20 Beat in mind that uninlining can slightly increase the stack usage in som= e cases because arguments, return addresses and the like have to be pushed onto the stack. Inlining or unlining is only the answer when it reduces t= he number of stack variables that exist at any given time. > But I don't get in a hurry. adhoc approach is not good. > I hope when Mel tackles down consumption of stack in reclaim path, he > modifies this part, too. >=20 It'll be at least two days before I get the chance to try. A lot of the temporary variables used in the reclaim path have existed for some time s= o it will take a while. --=20 Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab -- 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