linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexnader Kuleshov <kuleshovmail@gmail.com>
To: open list <linux-kernel@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Andy Lutomirski <luto@kernel.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Jan Beulich <jbeulich@suse.com>, Tony Luck <tony.luck@intel.com>,
	Jianyu Zhan <nasa4836@gmail.com>
Subject: Question: goal of twice disabling of preemption in exception handlers
Date: Sun, 20 Nov 2016 23:52:07 +0600	[thread overview]
Message-ID: <20161120175207.GA4354@localhost> (raw)

Hello everyone,

Exception handlers which may run on IST stack disable and enable preemption
twice. For example do_int3() [1]. This one calls ist_enter() which
disables preemption with preempt_disable() every time without any conditions.
And later do_int3() calls preempt_disable() again [2] before do_trap().

Of course we decrement preemption counter in the end of such exception
handlers twice too. But what's actual purpose of doing this two times?

[1] https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/arch/x86/kernel/traps.c?id=refs/tags/next-20161117#n530
[2] https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/arch/x86/kernel/traps.c?id=refs/tags/next-20161117#n566

Thank you.

             reply	other threads:[~2016-11-20 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-20 17:52 Alexnader Kuleshov [this message]
2016-11-27 18:57 ` Question: goal of twice disabling of preemption in exception handlers Andy Lutomirski
2016-11-27 19:45   ` Alexnader Kuleshov

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=20161120175207.GA4354@localhost \
    --to=kuleshovmail@gmail.com \
    --cc=bp@alien8.de \
    --cc=jbeulich@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nasa4836@gmail.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.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).