Linux-Sgx Archive mirror
 help / color / mirror / Atom feed
From: Jinpu Wang <jinpu.wang@ionos.com>
To: Jarkko Sakkinen <jarkko@kernel.org>, "Huang, Kai" <kai.huang@intel.com>
Cc: "linux-sgx@vger.kernel.org" <linux-sgx@vger.kernel.org>,
	"yu.zhang@ionos.com" <yu.zhang@ionos.com>,
	"haitao.huang@linux.intel.com" <haitao.huang@linux.intel.com>
Subject: Re: [PATCH] x86/sgx: Avoid softlockup from sgx_vepc_release
Date: Fri, 18 Aug 2023 10:12:23 +0200	[thread overview]
Message-ID: <CAMGffE=q8gMqrQSpwUuRjz_jTTDdOBti6pcDp20PFKszTM74MA@mail.gmail.com> (raw)
In-Reply-To: <CUUY2LHIXLJO.2C4M4O5Q3SVCD@seitikki>

On Thu, Aug 17, 2023 at 6:02 PM Jarkko Sakkinen <jarkko@kernel.org> wrote:
>
> On Thu Aug 17, 2023 at 10:00 AM UTC, Huang, Kai wrote:
> > On Thu, 2023-08-17 at 09:38 +0200, Jinpu Wang wrote:
> > > > This adds cond_resched() to the first two loops: releasing non-SECS pages and
> > > > releasing SECS pages which don't have children on remote vepc instance(s).
> > > > There is a third round loop to release SECS pages which have children on remote
> > > > vepc instance(s).  I think it's better to add cond_resched() there too, although
> > > > it's extremely unlikely it could trigger softlockup w/o cond_resched().
> > >
> > > I also think the third one are extremely unlikely could cause softlockup.
> > > And our tests do not hit it either.
> >
> > If we only consider your tests, then I believe you even don't need the second
> > cond_resched()?
> >
> > I think we should just add cond_resched() to all the three loops.  No harm, and
> > we don't need to worry about this anymore.
>
> I'm fine with this.

Ok, as both of you think it's better to cover all 3 cases. I will do
it in v3 later today.
>
> BR, Jarkko
Thx!

  reply	other threads:[~2023-08-18  8:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14  4:37 [PATCH] x86/sgx: Avoid softlockup from sgx_vepc_release Jack Wang
2023-08-14 17:35 ` Jarkko Sakkinen
2023-08-14 23:58 ` Huang, Kai
2023-08-16 20:34   ` Jarkko Sakkinen
2023-08-17  7:39     ` Jinpu Wang
2023-08-17  7:38   ` Jinpu Wang
2023-08-17 10:00     ` Huang, Kai
2023-08-17 16:01       ` Jarkko Sakkinen
2023-08-18  8:12         ` Jinpu Wang [this message]
2023-08-15 13:57 ` Haitao Huang

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='CAMGffE=q8gMqrQSpwUuRjz_jTTDdOBti6pcDp20PFKszTM74MA@mail.gmail.com' \
    --to=jinpu.wang@ionos.com \
    --cc=haitao.huang@linux.intel.com \
    --cc=jarkko@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=linux-sgx@vger.kernel.org \
    --cc=yu.zhang@ionos.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 read-only IMAP folder(s) and NNTP newsgroup(s).