Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1679463
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 14/21] x86/intel_rdt/cqm: Add mon_data |
| Date | 2017-07-02 14:50 +0200 |
| Message-ID | <tYMu5-1Un-3@gated-at.bofh.it> (permalink) |
| References | <tWHoR-5Yd-3@gated-at.bofh.it> <tWHoT-5Yd-49@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, 26 Jun 2017, Vikas Shivappa wrote:
> Add a mon_data directory for the root rdtgroup and all other rdtgroups.
> The directory holds all of the monitored data for all domains and events
> of all resources being monitored.
Again. This does two things at once. Move the existing code to a new file
and add the monitoring stuff. Please split it apart.
> +static bool __mon_event_count(u32 rmid, struct rmid_read *rr)
> +{
> + u64 tval;
> +
> + tval = __rmid_read(rmid, rr->evtid);
> + if (tval & (RMID_VAL_ERROR | RMID_VAL_UNAVAIL)) {
> + rr->val = tval;
> + return false;
> + }
> + switch (rr->evtid) {
> + case QOS_L3_OCCUP_EVENT_ID:
> + rr->val += tval;
> + return true;
> + default:
> + return false;
I have no idea what that return code means.
> + }
> +}
> +
> +void mon_event_count(void *info)
Some explanation why this is a void pointer and how that function is called
(I assume it's via IPI) would be appreciated.
> +{
> + struct rdtgroup *rdtgrp, *entry;
> + struct rmid_read *rr = info;
> + struct list_head *llist;
*head;
> +
> + rdtgrp = rr->rgrp;
> +
> + if (!__mon_event_count(rdtgrp->rmid, rr))
> + return;
> +
> + /*
> + * For Ctrl groups read data from child monitor groups.
> + */
> + llist = &rdtgrp->crdtgrp_list;
> +
> + if (rdtgrp->type == RDTCTRL_GROUP) {
> + list_for_each_entry(entry, llist, crdtgrp_list) {
> + if (!__mon_event_count(entry->rmid, rr))
> + return;
> + }
> + }
> +}
> +static int get_rdt_resourceid(struct rdt_resource *r)
> +{
> + if (r > (rdt_resources_all + RDT_NUM_RESOURCES - 1) ||
> + r < rdt_resources_all ||
> + ((r - rdt_resources_all) % sizeof(struct rdt_resource)))
> + return -EINVAL;
If that ever happens, then you have other problems than a wrong pointer.
> +
> + return ((r - rdt_resources_all) / sizeof(struct rdt_resource));
Moo. Can't you simply put an index field into struct rdt_resource,
intialize it with the resource ID and use that?
Thanks,
tglx
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V1 00/21] x86/cqm3: Resctrl based cqm Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
[PATCH 16/21] x86/intel_rdt/cqm: Add mount,umount support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
Re: [PATCH 16/21] x86/intel_rdt/cqm: Add mount,umount support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 15:30 +0200
[PATCH 20/21] x86/intel_rdt/mbm: Add mbm counter initialization Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
[PATCH 13/21] x86/intel_rdt/cqm: Add cpus file support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
Re: [PATCH 13/21] x86/intel_rdt/cqm: Add cpus file support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 13:20 +0200
Re: [PATCH 13/21] x86/intel_rdt/cqm: Add cpus file support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 14:40 +0200
[PATCH 15/21] x86/intel_rdt/cqm: Add rmdir support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
Re: [PATCH 15/21] x86/intel_rdt/cqm: Add rmdir support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 15:20 +0200
[PATCH 03/21] x86/intel_rdt/cqm: Documentation for resctrl based RDT Monitoring Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
[PATCH 21/21] x86/intel_rdt/mbm: Handle counter overflow Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
Re: [PATCH 21/21] x86/intel_rdt/mbm: Handle counter overflow Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 16:00 +0200
[PATCH 14/21] x86/intel_rdt/cqm: Add mon_data Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
Re: [PATCH 14/21] x86/intel_rdt/cqm: Add mon_data Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 14:50 +0200
[PATCH 17/21] x86/intel_rdt/cqm: Add sched_in support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
Re: [PATCH 17/21] x86/intel_rdt/cqm: Add sched_in support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 15:40 +0200
[PATCH 12/21] x86/intel_rdt/cqm: Add tasks file support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
Re: [PATCH 12/21] x86/intel_rdt/cqm: Add tasks file support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 13:10 +0200
[PATCH 08/21] x86/intel_rdt/cqm: Add RMID(Resource monitoring ID) management Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
Re: [PATCH 08/21] x86/intel_rdt/cqm: Add RMID(Resource monitoring ID) management Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 12:10 +0200
Re: [PATCH 08/21] x86/intel_rdt/cqm: Add RMID(Resource monitoring ID) management Thomas Gleixner <tglx@linutronix.de> - 2017-07-03 12:00 +0200
csiph-web