lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTimcBESMCtr3osZ=4seqT+bSGGix920PDecaSVX_@mail.gmail.com>
Date:	Wed, 20 Oct 2010 10:13:19 +0600
From:	Rakib Mullick <rakib.mullick@...il.com>
To:	Gregory Haskins <ghaskins@...ell.com>
Cc:	Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...e.hu>,
	Steven Rostedt <rostedt@...dmis.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched_rt: Removes extra checking for nr_cpus_allowed when
 calling find_lowest_rq

On Tue, Oct 19, 2010 at 8:40 PM, Rakib Mullick <rakib.mullick@...il.com> wrote:
> On 10/19/10, Gregory Haskins <ghaskins@...ell.com> wrote:
>>>>> On 10/19/2010 at 07:02 AM, in message <1287486167.1994.1.camel@...ns>,
>>>>> Peter
>> Zijlstra <peterz@...radead.org> wrote:
>>> On Tue, 2010-10-19 at 16:57 +0600, Rakib Mullick wrote:
>>
> If we made explicit check before calling find_lowest_rq, then I don't
> think we need the change that Steve's suggesting. I think explicitly
> checking is much more easier and removes extra overhead of function
> calling.

The following patch shows what I was trying to say. Please check and
comment. Hopefully this looks clean.


--- linus-rc8/kernel/sched_rt.c	2010-10-19 16:42:05.000000000 +0600
+++ rakib-rc8/kernel/sched_rt.c	2010-10-20 10:04:08.000000000 +0600
@@ -1174,9 +1174,6 @@ static int find_lowest_rq(struct task_st
 	int this_cpu = smp_processor_id();
 	int cpu      = task_cpu(task);

-	if (task->rt.nr_cpus_allowed == 1)
-		return -1; /* No other targets possible */
-
 	if (!cpupri_find(&task_rq(task)->rd->cpupri, task, lowest_mask))
 		return -1; /* No targets found */

@@ -1238,6 +1235,9 @@ static struct rq *find_lock_lowest_rq(st
 	int tries;
 	int cpu;

+	if (task->rt.nr_cpus_allowed < 2)
+		goto out;
+
 	for (tries = 0; tries < RT_MAX_TRIES; tries++) {
 		cpu = find_lowest_rq(task);

@@ -1275,6 +1275,7 @@ static struct rq *find_lock_lowest_rq(st
 		lowest_rq = NULL;
 	}

+out:
 	return lowest_rq;
 }



Thanks,
Rakib

>
> Thanks,
> Rakib
>> Kind Regards,
>> -Greg
>>
>>
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ