Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=Gm3VULmWIsvqEN17//h3mYbzUgobG/gu8R85Swx1588=; b=FSG74YOpm0ICMpKj6VMnGH2TgqcOC2HKC8tNO2V1BiKG7fIqOAnovb92xJ3bL+Mu7T Sgi092/OOMrE+wKkTdcKchtm7GM/trI/4pZkNhoxAJweb543+VHm9X4qHV9Drgcr39sD LmRtunkI6QdS2eidHxJLdxvLYjjow1xVIEM3G/vNP163tyjh+9k/larVr2/+Bz1ncP/u rvePv+TYcAw4BRjNdK67COfAfgXiJxtO5P1pVpiiUcQR/30M0sXoPRjRvjpTFRB/oAV6 PfMP/v91Qf36f5G2wDPPwQeLEKd50YQLdkylc/0ik29sgISBB8yY2iq+Vt82U2CUxlKJ WA9w== Subject: Re: Some questions References: <20160427165357.GD4967@linux.vnet.ibm.com> <2b39d2d5-962b-ce05-aa59-5569abdc4049@gmail.com> <20160427225022.GK4967@linux.vnet.ibm.com> <20160427232807.GL4967@linux.vnet.ibm.com> <428ce2d3-6d21-a97f-ce60-4b0635a7cbd6@gmail.com> <20160428162827.GJ4609@linux.vnet.ibm.com> <4cbb1be0-8d65-2f37-716f-f90723ab4cd7@gmail.com> From: Akira Yokosawa Message-ID: Date: Sat, 30 Apr 2016 01:00:29 +0900 MIME-Version: 1.0 In-Reply-To: <4cbb1be0-8d65-2f37-716f-f90723ab4cd7@gmail.com> Content-Type: multipart/mixed; boundary="------------95C2453BBEA86AEA13D57CAD" To: paulmck@linux.vnet.ibm.com Cc: perfbook@vger.kernel.org, Akira Yokosawa List-ID: This is a multi-part message in MIME format. --------------95C2453BBEA86AEA13D57CAD Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 2016/04/29 8:05, Akira Yokosawa wrote: > On 2016/04/29 1:28, Paul E. McKenney wrote: >> On Fri, Apr 29, 2016 at 12:39:09AM +0900, Akira Yokosawa wrote: >>> On 2016/04/27 16:28:07 -0700, Paul E. McKenney wrote: >>>> On Thu, Apr 28, 2016 at 08:01:31AM +0900, Akira Yokosawa wrote: >>>>> On 2016/04/27 15:50:22 -0700, Paul E. McKenney wrote: >>>>>> On Thu, Apr 28, 2016 at 07:15:05AM +0900, Akira Yokosawa wrote: >>>>>>> On 2016/04/27 09:53:57 -0700, Paul E. McKenney wrote: >>> [snip. >>>>>>>> Please see attached for what it looks like to me. >>>>>>> >>>>>>> Well, this is identical to the one I built. >>>>>>> So, do you intend to explicitly put numbers which show up fairly long time, and >>>>>>> leave other cells blank even below changes of values denoted by (n) in italics? >>>>>> >>>>>> The blank cells represent cache misses. The CPU is waiting for a read >>>>>> to complete during that time. A non-blank cell corresponds to a CPU >>>>>> actually completing a read. >>>>> >>>>> Oh, I see. But this should be explained in the text, I think. >>>> >>>> Good point! I also added several other possibilities, including >>>> interrupts and preemption. >>>> >>> >>> So, I have a few questions regarding to the added explanation of blank cells. >>> >>> According to the text, trace data used to create the table are said to be >>> obtained by a program that contains the code fragment shown in Figure 14.4. >>> The loop in the code fragment will exit once it sees state.variable != mycpu. >>> That means the actual program you used has an outer loop to record the >>> changes of state.valuable for each cpu in the system, I suppose. >>> Am I guessing right? >> >> IIRC, the program just stuffed timestamps and values into a set of per-CPU >> big arrays, then printed them out. A script took these values as input, >> and compacted identical state. >> >>> If I am, (n)'s in the table denoting modification of variables must be >>> entries in the trace data which were output from the outer loop, I think. >> >> The (n)'s mark changes in value for a given CPU. >> >>> However, in the table, there are a number of cases where (n)'s are followed >>> by blanks just below itself. Does this mean fetched state.variables stay in >>> the cache very briefly, but are (almost immediately) invalidated by a cache >>> coherence mechanism? I can see interrupts and preemption would also cause the >>> trace output to be suspended for a while. >> >> It marks places where a given CPU saw a value momentarily. As you say, >> this could be due to cache invalidation, interrupts, preemption, etc. >> >>> I'm not sure I have made out what the table means thus far, but am I seeing >>> something close enough to what you intend the table to represent? >> >> The main point is that different CPUs can disagree on the value of a given >> variable at a given point in time. The following diagram shows that >> this disagreement is nevertheless bounded, in that all CPUs must agree >> on the ordering of values for that variable. > > Yes, of course that's the main point. > I should have asked in a different way. > > There should be the same kind of situations in Figure 14.5. > But you didn't depict them in the figure. > > Why did you put the blank cells in the table in the first place? > > I'm a little bit distracted by those blank cells, and began questioning > about them. > > Isn't it enough to just do the same way in Table 14.2 as in Figure 14.5? > > Or, could the blank cell situation be explained in the form of an answer > of a quick quiz? It would be much easier for me to grasp the main point > of this section "Variables Can Have More Than One Value" while reading the > body of the text. > > Thoughts? > > Thanks, Akira > >> >> Thanx, Paul >> >> > So I drew 2 figures based on Table 14.2. No, I didn't actually drew them but wrote a rough program to generate .fig format files from the value changes of each CPU extracted from Table 14.2. I ignored the blank cells in the table just as in Figure 4.5. Appended is a tar ball of two files. out.fig is the overall diagram, and out-2.fig is a zoomed in view of the beginning part. I think they can provide a fairly interesting view of what's going on. Please give a look at them. Thanks, Akira --------------95C2453BBEA86AEA13D57CAD Content-Type: application/gzip; name="fig.tar.gz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="fig.tar.gz" H4sIADOCI1cAA+1aTY8kORHt69SvKInz9PrbziNaCYQEEhLixqW1NKsRaECzs/8fR9h+4aqp KduZ9CCWSqk7o9vhFy8cYafTGc/f/e3Dj989veml8hWjp7uOXvX3dj1pE7WKSiub9bKkw9PZ vy2tcv380+eXT+fz08vfP3x6uaM3av8fvZ45/v/8+fN785ylN7FBAQ7OfSX+2niN+CunYo6/ sd48ndWbsLm6/s/j/6vf/O63Z/tsTr9/+fjXn354+dfr6fvXj59fP53+8Pr504cfTr92J63U s1KnP334+OM/Xk/vzUkbpc7mFM7Bq7M6hxzMs9NenczZ5L/1mf7LTSb/yn0V/+d9bTi9i/wf 4+VmojrH7t5jubtYFSVEuREIUEv7yTEUA+l03goUYW/5H8Q/kH7+0X/JObnkCVmxuhe8K160 e27oEMNdRCDBldCggN10xl5t9BeNwrJXbCcPnghJF2/aPTd0iFbfd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