linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexnader Kuleshov <kuleshovmail@gmail.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Alexnader Kuleshov <kuleshovmail@gmail.com>,
	open list <linux-kernel@vger.kernel.org>,
	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: Re: Question: goal of twice disabling of preemption in exception handlers
Date: Mon, 28 Nov 2016 01:45:25 +0600	[thread overview]
Message-ID: <20161127194525.GA4087@localhost.localdomain> (raw)
In-Reply-To: <CALCETrVeWs7DvM0TDTb+0-Twk=n7Pvf7XEVrHS0kKXvX-v0n8g@mail.gmail.com>

On 11-27-16, Andy Lutomirski wrote:
> On Sun, Nov 20, 2016 at 9:52 AM, Alexnader Kuleshov
> <kuleshovmail@gmail.com> wrote:
> > 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.
> 
> You could submit a patch to get rid of the extra one if you like.

Thanks for reply. Will send a patch.

      reply	other threads:[~2016-11-27 19:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-20 17:52 Question: goal of twice disabling of preemption in exception handlers Alexnader Kuleshov
2016-11-27 18:57 ` Andy Lutomirski
2016-11-27 19:45   ` Alexnader Kuleshov [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=20161127194525.GA4087@localhost.localdomain \
    --to=kuleshovmail@gmail.com \
    --cc=bp@alien8.de \
    --cc=jbeulich@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --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).