mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: shuah@kernel.org, linux-kselftest@vger.kernel.org,
	disgoel@linux.vnet.ibm.com,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linux-perf-users@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	maddy@linux.vnet.ibm.com, kajoljain <kjain@linux.ibm.com>,
	srikar@linux.vnet.ibm.com
Subject: Re: [PATCH] testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu set
Date: Thu, 7 Apr 2022 10:00:35 +0530	[thread overview]
Message-ID: <F30C53D1-F01A-44C2-A2FB-E024FF2CAEC8@linux.vnet.ibm.com> (raw)
In-Reply-To: <ad0648a9-0252-2d1f-cc48-7e14846fc0af@linuxfoundation.org>



> On 07-Apr-2022, at 1:35 AM, Shuah Khan <skhan@linuxfoundation.org> wrote:
> 
> On 4/6/22 11:57 AM, Athira Rajeev wrote:
>> The selftest "mqueue/mq_perf_tests.c" use CPU_ALLOC to allocate
>> CPU set. This cpu set is used further in pthread_attr_setaffinity_np
>> and by pthread_create in the code. But in current code, allocated
>> cpu set is not freed. Fix this by adding CPU_FREE after its usage
>> is done.
> 
> Good find.
> 
>> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>> ---
>>  tools/testing/selftests/mqueue/mq_perf_tests.c | 1 +
>>  1 file changed, 1 insertion(+)
>> diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c b/tools/testing/selftests/mqueue/mq_perf_tests.c
>> index b019e0b8221c..17c41f216bef 100644
>> --- a/tools/testing/selftests/mqueue/mq_perf_tests.c
>> +++ b/tools/testing/selftests/mqueue/mq_perf_tests.c
>> @@ -732,6 +732,7 @@ int main(int argc, char *argv[])
>>  		pthread_attr_destroy(&thread_attr);
>>  	}
>>  +	CPU_FREE(cpu_set);
>>  	if (!continuous_mode) {
>>  		pthread_join(cpu_threads[0], &retval);
>>  		shutdown((long)retval, "perf_test_thread()", __LINE__);
> 
> CPU_ALLOC() is called very early on in main() and there are a
> few error paths that exit without calling CPU_FREE. This change
> doesn't fully fix the problem.
> 
> Review the other exit paths where CPU_FREE is needed.
Sure, Thanks for the review.
I will check and post a V2

thanks
Athira
> 
> thanks,
> -- Shuah


      reply	other threads:[~2022-04-07  4:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 17:57 Athira Rajeev
2022-04-06 20:05 ` Shuah Khan
2022-04-07  4:30   ` Athira Rajeev [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=F30C53D1-F01A-44C2-A2FB-E024FF2CAEC8@linux.vnet.ibm.com \
    --to=atrajeev@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=disgoel@linux.vnet.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=kjain@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=srikar@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

all inboxes | Powered by JetHome®