[0/2] Optimize the process of scanning CPU for some functions

Message ID 20221021061558.34767-1-jiahao.os@bytedance.com
Headers
Series Optimize the process of scanning CPU for some functions |

Message

Hao Jia Oct. 21, 2022, 6:15 a.m. UTC
  These two patches optimize the process of scanning the CPU by
adjusting the search order or breaking the loop.

Hao Jia (2):
  sched/numa: Stop an exhastive search if an idle core is found
  sched/core: Optimize the order of scanning CPU

 kernel/sched/core.c |  2 +-
 kernel/sched/fair.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
  

Comments

Peter Zijlstra Oct. 24, 2022, 10 a.m. UTC | #1
On Fri, Oct 21, 2022 at 02:15:56PM +0800, Hao Jia wrote:
> These two patches optimize the process of scanning the CPU by
> adjusting the search order or breaking the loop.

Is it really optimization, as in it now runs measurably faster, or just
cleanups?
  
Hao Jia Oct. 24, 2022, 12:07 p.m. UTC | #2
On 2022/10/24 Peter Zijlstra wrote:
> On Fri, Oct 21, 2022 at 02:15:56PM +0800, Hao Jia wrote:
>> These two patches optimize the process of scanning the CPU by
>> adjusting the search order or breaking the loop.
> 
> Is it really optimization, as in it now runs measurably faster, or just
> cleanups?


I'm very sorry that my description confused you.

Yes, these two patches should just be cleanups.

Reduce the number of attempts by adjusting the scan order or breaking 
the loop in time.
Just from code analysis, it will lead to a little optimization in most 
cases.
But they won't bring significant performance gains. So, it's just cleanups.


Thanks,
Hao
  
Hao Jia Oct. 24, 2022, 1:01 p.m. UTC | #3
On 2022/10/24 Peter Zijlstra wrote:
> On Fri, Oct 21, 2022 at 02:15:56PM +0800, Hao Jia wrote:
>> These two patches optimize the process of scanning the CPU by
>> adjusting the search order or breaking the loop.
> 
> Is it really optimization, as in it now runs measurably faster, or just
> cleanups?

I'm very sorry that my description confused you.

Yes, these two patches should just be cleanups.

Reduce the number of attempts by adjusting the scan order or breaking 
the loop in time.
IMHO, it will lead to a little optimization in most cases.
But they won't bring significant performance gains. So, it's just cleanups.


Thanks,
Hao