linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Wang <wangyun@linux.vnet.ibm.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched: Accelerate "pick_next_entity" under special condition
Date: Mon, 16 Jan 2012 18:34:45 +0800	[thread overview]
Message-ID: <4F13FD45.4000804@linux.vnet.ibm.com> (raw)
In-Reply-To: <1326707503.2442.219.camel@twins>

Hi, peter

Thanks so much for your reply :)

On 01/16/2012 05:51 PM, Peter Zijlstra wrote:

> On Mon, 2012-01-16 at 17:37 +0800, Michael Wang wrote:
>> From: Michael Wang <wangyun@linux.vnet.ibm.com>
>>
>> We can avoid some useless operation in some special condition.
> 
> This is a pretty empty statement.
> 
>> For example:
>> If we have "cfs_rq->next" and it can be use, we just return it directly.
> 
> What it doesn't state is what it actually does, if it affects the common
> case and performance numbers (or a good reason for the lack thereof).
> 


Please help me to understand the logic, I think in the original code,
even if we have cfs_rq->next and wakeup_preempt_entity check passed, we
still need to do a lot of work (check cfs_rq->last for example) which
have no influence on result, will it be better if we skip them and just
do what really needed?

>> Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
>> ---
>>  kernel/sched/fair.c |   28 +++++++++++++++++-----------
>>  1 files changed, 17 insertions(+), 11 deletions(-)
>>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 84adb2d..9fc2c3c 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -1295,6 +1295,8 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
>>  static int
>>  wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se);
>>  
>> +#define ENTITY_PREEMPT_ALLOWED(prev,next)	(wakeup_preempt_entity(prev, next) < 1)
> 

> This is just uglification imo, its shouting and it doesn't actually win
> you much space.
> 


I see, sorry for the bad idea.

Best regards,
Michael Wang


  reply	other threads:[~2012-01-16 10:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16  9:37 [PATCH] sched: Accelerate "pick_next_entity" under special condition Michael Wang
2012-01-16  9:50 ` Michael Wang
2012-01-16  9:51 ` Peter Zijlstra
2012-01-16 10:34   ` Michael Wang [this message]
2012-01-17  2:36   ` [PATCH v2] " Michael Wang
2012-01-17  2:41     ` Michael Wang
2012-01-17  2:58     ` Xiaotian Feng
2012-01-17  3:04       ` Michael Wang
2012-01-25 15:55         ` Peter Zijlstra
2012-01-26 10:04           ` Ingo Molnar
2012-01-27  1:22             ` Michael Wang
2012-01-27  4:42               ` Cong Wang
2012-01-29  6:32                 ` Michael Wang
2012-01-29 16:33                   ` Ingo Molnar
2012-01-30  3:18                     ` Michael Wang
2012-01-30  3:25                       ` Cong Wang
2012-01-30  5:47                         ` Michael Wang
2012-07-03  6:34                           ` [PATCH] sched: remove useless code in yield_to Michael Wang
2012-07-12  5:45                             ` Michael Wang
2012-07-12 14:07                             ` Peter Zijlstra
2012-07-12 18:44                               ` Mike Galbraith
2012-07-16  2:39                               ` Michael Wang
2012-08-17  6:56                               ` Michael Wang
2012-08-17  9:43                                 ` Peter Zijlstra
2012-08-10  3:05                             ` Michael Wang
2012-08-10  3:10                               ` Michael Wang
2012-08-10  5:52                                 ` Mike Galbraith
2012-09-04 18:50                             ` [tip:sched/core] sched: Remove useless code in yield_to() tip-bot for Michael Wang
2012-01-27  0:56           ` [PATCH v2] sched: Accelerate "pick_next_entity" under special condition Michael Wang

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=4F13FD45.4000804@linux.vnet.ibm.com \
    --to=wangyun@linux.vnet.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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).