LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Zdenek Kabelac" <zdenek.kabelac@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>
Subject: Re: sys_sched_yield keeps locked irq before call of schedule()
Date: Wed, 5 Nov 2008 14:09:36 +0100	[thread overview]
Message-ID: <c4e36d110811050509t51719671saa7eb337fca39656@mail.gmail.com> (raw)
In-Reply-To: <20081105130113.GB29548@elte.hu>

2008/11/5 Ingo Molnar <mingo@elte.hu>:
>
> * Zdenek Kabelac <zdenek.kabelac@gmail.com> wrote:
>
>> Hi
>>
>> With recent 2.6.28-rc3 kernel I've noticed that schedule() is
>> sometime being called with locked IRQ
>>
>> Call Trace:
>>  [<ffffffff81334592>] _spin_lock_irq+0x92/0xa0
>>  [<ffffffff8133126b>] schedule+0x13b/0x4cb
>>  [<ffffffff81013c10>] ? native_sched_clock+0x70/0xa0
>>  [<ffffffff81040930>] ? sys_sched_yield+0x0/0x80
>>  [<ffffffff810409a5>] sys_sched_yield+0x75/0x80
>>  [<ffffffff8100c6bb>] system_call_fastpath+0x16/0x1b
>
> is this some special warning you added? The stock kernel certainly
> does not emit this warning.

Yes - it's my personal debug checker that tries to watch wether irq &
irqsafe are running in pair.
So it shows a warning if there is a call of spin_lock_irq and irq is
already dissabled.

>
>> Which is a result of the function sys_sched_yield() that calls
>> schedule() while it keeps irq.
>>
>> Is it correct to call the function schedule() which 'usually'
>> expects irq being unlocked and do some 'lenghty' operations (i.e.
>> debug statistics) which do not need to keep irq locked for such a
>> long time?
>
> the debug statistics are all fast and we disable interrupts straight
> away when entering the schedule().

IRQ is disabled with spin_lock_irc() inside schedule() and it looks
like there is quite a few lines above which receive 'extra' bonus with
being run without enabled irq, but as I said - I'm just checking
whether this is intentional or not.

Zdenek

  reply	other threads:[~2008-11-05 13:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05 12:57 Zdenek Kabelac
2008-11-05 13:01 ` Ingo Molnar
2008-11-05 13:09   ` Zdenek Kabelac [this message]
2008-11-05 14:05     ` Arnd Bergmann
2008-11-05 14:37       ` Zdenek Kabelac
2008-11-06  7:57     ` Ingo Molnar
2008-11-06 13:46       ` Steven Rostedt
2008-11-06 14:34         ` Ingo Molnar
2008-11-06 14:46           ` Steven Rostedt

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=c4e36d110811050509t51719671saa7eb337fca39656@mail.gmail.com \
    --to=zdenek.kabelac@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --subject='Re: sys_sched_yield keeps locked irq before call of schedule()' \
    /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

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).