linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Anju T Sudhakar <anju@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Hemant Kumar <hemant@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] powerpc/perf: double unlock bug in imc_common_cpuhp_mem_free()
Date: Mon, 14 Aug 2017 09:28:13 +0530	[thread overview]
Message-ID: <0b9f75e5-4519-4d84-cf05-771c16e80db5@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170811200541.qlxcpp3og33sdki3@mwanda>



On Saturday 12 August 2017 01:35 AM, Dan Carpenter wrote:
> There is a typo so we call unlock instead of lock.

Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>

nest_imc_refc used to maintain list of perf sessions thats using the
nest units currently. This is needed in turning off nest engine microcode
when not in use.

Yes will send a patch to fix ref->lock change.

Thanks for fix

Maddy

>
> Fixes: 885dcd709ba9 ("powerpc/perf: Add nest IMC PMU support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> I also don't understand how the &nest_imc_refc[node_id].lock works.  Why
> can't we use ref->lock everywhere?  They seem equivalent, and my static
> checker complains if we call the same lock different names.
>
> diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
> index 46cd912af060..52017f6eafd9 100644
> --- a/arch/powerpc/perf/imc-pmu.c
> +++ b/arch/powerpc/perf/imc-pmu.c
> @@ -1124,7 +1124,7 @@ static void cleanup_all_thread_imc_memory(void)
>   static void imc_common_cpuhp_mem_free(struct imc_pmu *pmu_ptr)
>   {
>   	if (pmu_ptr->domain == IMC_DOMAIN_NEST) {
> -		mutex_unlock(&nest_init_lock);
> +		mutex_lock(&nest_init_lock);
>   		if (nest_pmus == 1) {
>   			cpuhp_remove_state(CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE);
>   			kfree(nest_imc_refc);
>

  parent reply	other threads:[~2017-08-14  3:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11 20:05 [PATCH] powerpc/perf: double unlock bug in imc_common_cpuhp_mem_free() Dan Carpenter
2017-08-14  3:30 ` Michael Ellerman
2017-08-14  4:00   ` Madhavan Srinivasan
2017-08-14  3:58 ` Madhavan Srinivasan [this message]
2017-08-16 12:29 ` Michael Ellerman

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=0b9f75e5-4519-4d84-cf05-771c16e80db5@linux.vnet.ibm.com \
    --to=maddy@linux.vnet.ibm.com \
    --cc=anju@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=dan.carpenter@oracle.com \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /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).