linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Priyanka Jain <Priyanka.Jain@freescale.com>
Cc: scottwood@freescale.com,
	"tiejun.chen" <tiejun.chen@windriver.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/32bit,PREEMPT:Load TI_FLAGS to check NEED_RESCHED
Date: Mon, 27 May 2013 17:12:55 +1000	[thread overview]
Message-ID: <1369638775.3557.12.camel@pasglop> (raw)
In-Reply-To: <1369636076-2644-1-git-send-email-Priyanka.Jain@freescale.com>

On Mon, 2013-05-27 at 11:57 +0530, Priyanka Jain wrote:
> Add instruction to load TI_FLAGS in r8
>     
> While returning from exception handling in case of PREEMPT enabled,
> _TIF_NEED_RESCHED bit is checked in TI_FLAGS (thread_info flag) of
> current
> task. Only if this bit is set, it should continue with the process of
> calling preempt_schedule_irq() to schedule highest priority task if
> available.
>
> Current code assumes that r8 contains TI_FLAGS and check this for
> _TIF_NEED_RESCHED, but as r8 is modified in the code which executes
> before
> this check, r8 no longer contains the expected TI_FLAGS information.

Hrm, the code was supposed to still have TI_FLAGS in r8 and mostly does
until the 

	andis.	r8,r8,_TIF_EMULATE_STACK_STORE@h

Was added which clobbers it.

Can't we just fix the above to use a different destination register ?
r0 looks fair game at this point...
 
> As a result check for comparison with _TIF_NEED_RESCHED was failing
> even if
> NEED_RESCHED bit is set in the current thread_info flag. Due to this,
> preempt_schedule_irq() and in turn scheduler was not getting called
> even if
> highest priority task is ready for execution.

Ben.

      parent reply	other threads:[~2013-05-27  7:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27  6:27 [PATCH] powerpc/32bit,PREEMPT:Load TI_FLAGS to check NEED_RESCHED Priyanka Jain
2013-05-27  6:45 ` [PATCH] powerpc/32bit, PREEMPT:Load " tiejun.chen
2013-05-27  6:55   ` [PATCH] powerpc/32bit,PREEMPT:Load " Jain Priyanka-B32167
2013-05-27  7:18     ` [PATCH] powerpc/32bit, PREEMPT:Load " tiejun.chen
2013-05-27  7:21       ` [PATCH] powerpc/32bit,PREEMPT:Load " Jain Priyanka-B32167
2013-05-27  7:12 ` Benjamin Herrenschmidt [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=1369638775.3557.12.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=Priyanka.Jain@freescale.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=scottwood@freescale.com \
    --cc=tiejun.chen@windriver.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;
as well as URLs for NNTP newsgroup(s).