From: Ian Jackson Subject: Re: Is: Contention in block script when doing guest saving. Was:Re: an issue with 'xm save' Date: Tue, 2 Oct 2012 15:59:34 +0100 Message-ID: <20587.342.66210.677204@mariner.uk.xensource.com> References: <505C3647.1030003@oracle.com> <20120921143430.GA3522@phenom.dumpdata.com> <5062C16A.1020306@oracle.com> <20120926123534.GF7356@phenom.dumpdata.com> <5063EAFB.1070307@oracle.com> <20120927115918.GE8832@phenom.dumpdata.com> <50657D4B.9040303@oracle.com> <20120928140109.GA7483@localhost.localdomain> <20581.45245.846208.289785@mariner.uk.xensource.com> <5065B82B.8080003@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5065B82B.8080003@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: zhenzhong.duan@oracle.com Cc: Konrad Rzeszutek Wilk , Dan Magenheimer , Konrad Rzeszutek Wilk , Feng Jin , xen-devel List-Id: xen-devel@lists.xenproject.org Zhenzhong Duan writes ("Re: [Xen-devel] Is: Contention in block script when doing guest saving. Was:Re: an issue with 'xm save'"): > Attachment is part of xen-hotplug.log that will show the spin. > Original file is nearly 7G big. I fetch first 1000 lines. Thanks. This is quite mystifying to me. Picking a representative example, and translating it to what I think the syscalls would be: > + eval 'exec 200>>/var/run/xen-hotplug/block' > ++ exec fd = open("/var/run/xen-hotplug/block", O_WRONLY|O_APPEND|O_CREAT, 0666); dup2(fd, 200); close(fd); > + flock -x 200 flock(200, LOCK_EX); > ++ perl -e ' > open STDIN, "<&200" or die $!; dup2(200, 0); > my $fd_inum = (stat STDIN)[1]; die $! unless defined $fd_inum; fstat(0, &stdin_stat); > my $file_inum = (stat $ARGV[0])[1]; stat("/var/run/xen-hotplug/block", &file_stat); > print "y\n" if $fd_inum eq $file_inum; if (stdin_stat.st_ino == file_stat.st_ino) puts("y"); > ' /var/run/xen-hotplug/block > + rightfile= And here we see that perl didn't print "y" so the two files must be different. Let's try something else: can you strace it ? That is, get it to the point where it's spinning, find the pid of the relevant shell process, and strace -f -vvs500 -ooutput.strace PID where PID is the pid in question ? Let that run for a fraction of a second and then ^C it. The output may shed some light. Thanks, Ian.