linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Cc: hemant@linux.vnet.ibm.com, maddy@linux.vnet.ibm.com,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	anju@linux.vnet.ibm.com
Subject: Re: powerpc/perf: Fix for core/nest imc call trace on cpuhotplug
Date: Fri, 13 Oct 2017 23:32:42 +1100 (AEDT)	[thread overview]
Message-ID: <3yD6Yk1c3Tz9sPr@ozlabs.org> (raw)
In-Reply-To: <1507099852-28004-1-git-send-email-anju@linux.vnet.ibm.com>

On Wed, 2017-10-04 at 06:50:52 UTC, Anju T Sudhakar wrote:
> Nest/core pmu units are enabled only when it is used. A reference count is      
> maintained for the events which uses the nest/core pmu units. Currently in      
> *_imc_counters_release function a WARN() is used for notification of any        
> underflow of ref count.                                                         
>                                                                                 
> The case where event ref count hit a negative value is, when perf session is    
> started, followed by offlining of all cpus in a given core.                     
> i.e. in cpuhotplug offline path ppc_core_imc_cpu_offline() function set the     
> ref->count to zero, if the current cpu which is about to offline is the last    
> cpu in a given core and make an OPAL call to disable the engine in that core.   
> And on perf session termination, perf->destroy (core_imc_counters_release) will 
> first decrement the ref->count for this core and based on the ref->count value  
> an opal call is made to disable the core-imc engine.                            
> Now, since cpuhotplug path already clears the ref->count for core and disabled  
> the engine, perf->destroy() decrementing again at event termination make it     
> negative which in turn fires the WARN_ON. The same happens for nest units.      
>                                                                                 
> Add a check to see if the reference count is alreday zero, before decrementing  
> the count, so that the ref count will not hit a negative value.                 
>                                                                                 
> Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
> Reviewed-by: Santosh Sivaraj <santosh@fossix.org>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/0d923820c6db1644c27c2d0a5af892

cheers

      parent reply	other threads:[~2017-10-13 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04  6:50 [PATCH] powerpc/perf: Fix for core/nest imc call trace on cpuhotplug Anju T Sudhakar
2017-10-05  9:50 ` Santosh Sivaraj
2017-10-05  9:51   ` Anju T Sudhakar
2017-10-13 12:32 ` Michael Ellerman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3yD6Yk1c3Tz9sPr@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=anju@linux.vnet.ibm.com \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).