Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1352180

RE: [PATCH 4/6] x86/mbm: Memory bandwidth monitoring event management

From "Luck, Tony" <tony.luck@intel.com>
Newsgroups linux.kernel
Subject RE: [PATCH 4/6] x86/mbm: Memory bandwidth monitoring event management
Date 2016-03-08 00:30 +0100
Message-ID <racLa-13y-53@gated-at.bofh.it> (permalink)
References <r82dc-7Iy-3@gated-at.bofh.it> <r82dd-7Iy-7@gated-at.bofh.it> <racrO-V4-65@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> +		bytes = mbm_current->interval_bytes * MSEC_PER_SEC;
>> +		do_div(bytes, diff_time);
>> +		mbm_current->bandwidth = bytes;
>> +		mbm_current->interval_bytes = 0;
>> +		mbm_current->interval_start = cur_time;
>> +	}
>>> +
>> +	return mbm_current;
>> +}
>
> How does the above time tracking deal with the event not actually having
> been scheduled the whole time?

That's been the topic of a few philosophical debates ... what exactly are
we trying to say when we report that a process has a "memory bandwidth"
of, say, 1523 MBytes/s?  We need to know both the amount of data moved
and to pick an interval to measure and divide by. Does it make a difference
whether the process voluntarily gave up the cpu for some part of the interval
(by blocking on I/O)? Or did the scheduler time-slice it out to run other jobs?

The above code gives the average bandwidth across the last interval
(with a minimum interval size of 100ms to avoid craziness with rounding
errors on exceptionally tiny intervals). Some folks apparently want to get
a "rate" directly from perf.  I think many folks will find the "bytes" counters
more helpful (where they control the sample interval with '-I" flag to perf
utility).

-Tony

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 4/6] x86/mbm: Memory bandwidth monitoring event management Peter Zijlstra <peterz@infradead.org> - 2016-03-08 00:10 +0100
  RE: [PATCH 4/6] x86/mbm: Memory bandwidth monitoring event  management "Luck, Tony" <tony.luck@intel.com> - 2016-03-08 00:30 +0100
    Re: [PATCH 4/6] x86/mbm: Memory bandwidth monitoring event management Peter Zijlstra <peterz@infradead.org> - 2016-03-08 09:50 +0100
      Re: [PATCH 4/6] x86/mbm: Memory bandwidth monitoring event  management Vikas Shivappa <vikas.shivappa@intel.com> - 2016-03-10 23:50 +0100
  Re: [PATCH 4/6] x86/mbm: Memory bandwidth monitoring event  management Vikas Shivappa <vikas.shivappa@intel.com> - 2016-03-11 00:00 +0100

csiph-web