public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Yu <yu.c.chen@intel.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: <linux-efi@vger.kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	Chao Gao <chao.gao@intel.com>, <linux-kernel@vger.kernel.org>,
	"Hossain, Md Iqbal" <md.iqbal.hossain@intel.com>
Subject: Re: [PATCH] efi/unaccepted: touch soft lockup during memory accept
Date: Thu, 11 Apr 2024 08:36:37 +0800	[thread overview]
Message-ID: <ZhcwlY+W54aTe1d8@chenyu5-mobl2> (raw)
In-Reply-To: <btc6xpiw3kvo4tj6a7cn7uahvcvge7g3jqkutrwmlnuz6g55lr@fu3lsytwhfpy>

On 2024-04-10 at 15:35:39 +0300, Kirill A. Shutemov wrote:
> On Wed, Apr 10, 2024 at 06:23:01PM +0800, Chen Yu wrote:
> > Commit 50e782a86c98 ("efi/unaccepted: Fix soft lockups caused
> > by parallel memory acceptance") has released the spinlock so
> > other CPUs can do memory acceptance in parallel and not
> > triggers softlockup on other CPUs.
> > 
> > However the softlock up was intermittent shown up if the memory
> > of the TD guest is large, and the timeout of softlockup is set
> > to 1 second:
> > 
> >  RIP: 0010:_raw_spin_unlock_irqrestore
> >  Call Trace:
> >  ? __hrtimer_run_queues
> >  <IRQ>
> >  ? hrtimer_interrupt
> >  ? watchdog_timer_fn
> >  ? __sysvec_apic_timer_interrupt
> >  ? __pfx_watchdog_timer_fn
> >  ? sysvec_apic_timer_interrupt
> >  </IRQ>
> >  ? __hrtimer_run_queues
> >  <TASK>
> >  ? hrtimer_interrupt
> >  ? asm_sysvec_apic_timer_interrupt
> >  ? _raw_spin_unlock_irqrestore
> >  ? __sysvec_apic_timer_interrupt
> >  ? sysvec_apic_timer_interrupt
> >  accept_memory
> >  try_to_accept_memory
> >  do_huge_pmd_anonymous_page
> >  get_page_from_freelist
> >  __handle_mm_fault
> >  __alloc_pages
> >  __folio_alloc
> >  ? __tdx_hypercall
> >  handle_mm_fault
> >  vma_alloc_folio
> >  do_user_addr_fault
> >  do_huge_pmd_anonymous_page
> >  exc_page_fault
> >  ? __do_huge_pmd_anonymous_page
> >  asm_exc_page_fault
> >  __handle_mm_fault
> 
> Stacktrace doesn't add much value here. Just drop it.
>

OK, will do.
 
> > When the local irq is enabled at the end of accept_memory(),
> > the softlockup detects that the watchdog on single CPU has
> > not been fed for a while. That is to say, even other CPUs
> > will not be blocked by spinlock, the current CPU might be
> > stunk with local irq disabled for a while, which hurts not
> > only nmi watchdog but also softlockup.
> > 
> > Chao Gao pointed out that the memory accept could be time
> > costly and there was similar report before. Thus to avoid
> > any softlocup detection during this stage, give the
> > softlockup a flag to skip the timeout check at the end of
> > accept_memory(), by invoking touch_softlockup_watchdog().
> > 
> > Reported-by: "Hossain, Md Iqbal" <md.iqbal.hossain@intel.com>
> > Signed-off-by: Chen Yu <yu.c.chen@intel.com>
> 
> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> 
> And I think it is justified to add Fixes tag:
> 
> Fixes: 50e782a86c98 ("efi/unaccepted: Fix soft lockups caused by parallel memory acceptance")
>

OK, I'll refine the patch and send v2, thanks!


thanks,Chenyu

      reply	other threads:[~2024-04-11  0:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10 10:23 [PATCH] efi/unaccepted: touch soft lockup during memory accept Chen Yu
2024-04-10 12:35 ` Kirill A. Shutemov
2024-04-11  0:36   ` Chen Yu [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=ZhcwlY+W54aTe1d8@chenyu5-mobl2 \
    --to=yu.c.chen@intel.com \
    --cc=ardb@kernel.org \
    --cc=chao.gao@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=md.iqbal.hossain@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