Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1677600
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v11 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging |
| Date | 2017-06-29 12:50 +0200 |
| Message-ID | <tXFbk-6tm-15@gated-at.bofh.it> (permalink) |
| References | <tXqlX-15I-3@gated-at.bofh.it> <tXqlX-15I-5@gated-at.bofh.it> <tXr8l-1CZ-3@gated-at.bofh.it> <tXDMd-5II-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, 29 Jun 2017, Madhavan Srinivasan wrote:
> On Thursday 29 June 2017 01:11 AM, Thomas Gleixner wrote:
> Idea is to handle multiple event session for a given core and
> yes, my bad, current implementation is racy/broken.
> But an alternate approach is to have a per-core mutex and
> per-core ref count to handle this.
>
> event_init path:
> per-core mutex lock
> if ( per-core[refcount] == 0) {
> rc = opal call to start the engine;
> if (rc on failure) {
> per-core mutex unlock;
> log error info;
> return error;
> }
> }
> increment the per-core[refcount];
> per-core mutex unlock;
>
>
> event_destroy path:
> per-core mutex lock
> decrement the per-core[refcount];
> if ( per-core[refcount] == 0) {
> rc = opal call to stop the engine;
> if (rc on failure) {
> per-core mutex unlock;
> log the failure;
> return error;
> }
> } else if ( per-core[refcount] < 0) {
> WARN()
> per-core[refcount] = 0;
> }
> per-core mutext unlock;
Yes, that works and looks about right.
Thanks,
tglx
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v11 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging Anju T Sudhakar <anju@linux.vnet.ibm.com> - 2017-06-28 21:00 +0200
Re: [PATCH v11 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging Thomas Gleixner <tglx@linutronix.de> - 2017-06-28 21:50 +0200
Re: [PATCH v11 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-06-29 11:20 +0200
Re: [PATCH v11 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging Thomas Gleixner <tglx@linutronix.de> - 2017-06-29 12:50 +0200
csiph-web