From: Thomas Gleixner <tglx@linutronix.de>
To: Kirill Tkhai <tkhai@yandex.ru>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 1/2] sched: Add schedule_(raw_)spin_unlock and schedule_(raw_)spin_unlock_irq
Date: Mon, 24 Jun 2013 14:54:43 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.02.1306241441440.4013@ionos.tec.linutronix.de> (raw)
In-Reply-To: <1981131371569812@web20h.yandex.ru>
On Tue, 18 Jun 2013, Kirill Tkhai wrote:
> +/*
> + * schedule_raw_spin_unlock() -- should be used instead of pattern:
> + *
> + * raw_spin_unlock(lock);
> + * schedule();
> + *
> + * It's the same, but prevents preempt_schedule() call during the unlocking.
> + */
> +static inline void schedule_raw_spin_unlock(raw_spinlock_t *lock)
This should be raw_spin_unlock_and_schedule().
schedule_raw_spin_unlock() sounds like we schedule a raw_spin_unlock()
for some point in the future.
> +{
> + _raw_spin_unlock_no_resched(lock);
No, please do not expose such an interface. Instead of that implement
it as:
raw_spin_unlock_and_schedule()
{
spin_release(&lock->dep_map, 1, _RET_IP_);
do_raw_spin_unlock(lock);
preempt_enable_no_resched();
schedule();
}
And this goes into the spinlock header and not into sched.h.
Thanks,
tglx
prev parent reply other threads:[~2013-06-24 12:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 15:36 Kirill Tkhai
2013-06-18 17:28 ` Peter Zijlstra
2013-06-18 17:46 ` Kirill Tkhai
2013-06-24 12:54 ` Thomas Gleixner [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=alpine.DEB.2.02.1306241441440.4013@ionos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tkhai@yandex.ru \
/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
all inboxes | Powered by JetHome®