All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5 4/4] xen/mm: limit non-scrubbed allocations to a specific order
Date: Wed, 4 Feb 2026 17:08:50 +0100	[thread overview]
Message-ID: <aYNvEpxAqkJPfGF6@Mac.lan> (raw)
In-Reply-To: <2c2b6189-9404-4378-a101-3a93cbadee43@suse.com>

On Tue, Feb 03, 2026 at 04:00:09PM +0100, Jan Beulich wrote:
> On 30.01.2026 15:57, Roger Pau Monne wrote:
> > @@ -1117,6 +1130,14 @@ static struct page_info *alloc_heap_pages(
> >                      scrub_one_page(&pg[i], cold);
> >  
> >                  dirty_cnt++;
> > +
> > +                /*
> > +                 * Use SYS_STATE_smp_boot explicitly; ahead of that state
> > +                 * interrupts are disabled.
> > +                 */
> > +                if ( system_state == SYS_STATE_smp_boot &&
> > +                     !(dirty_cnt & 0xff) )
> > +                    process_pending_softirqs();
> >              }
> >              else
> >                  check_one_page(&pg[i]);
> 
> Coming back to this, I see two possible issues. One is that on x86 enabling
> of IRQs happens a bit earlier than setting of SYS_STATE_smp_boot. Maybe this
> isn't really a problem right now, but it could become one if the "wrong"
> thing is inserted into that window in __start_xen().

Even if IRQs are enabled a bit earlier, the watchdog is only setup
after SYS_STATE_smp_boot state is set.

> The other is that only x86 actually ever sets that state.

TBH we have never seen the watchdog triggering during initial domain
creation, so the workaround added here was out of caution.  There's a
certain amount of contention required for the watchdog to trigger, and
that scenario doesn't happen during boot, as domain creation is
serialized.

I could maybe gate the softirq processing as:

                if ( system_state < SYS_STATE_active && local_irq_enabled() &&
                     !(dirty_cnt & 0xff) )
                    process_pending_softirqs();

Or completely avoid softirq processing in alloc_heap_pages().

Thanks, Roger.


  reply	other threads:[~2026-02-04 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30 14:57 [PATCH v5 0/4] xen/mm: limit in-place scrubbing Roger Pau Monne
2026-01-30 14:57 ` [PATCH v5 1/4] xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated Roger Pau Monne
2026-02-02 15:29   ` Jan Beulich
2026-01-30 14:57 ` [PATCH v5 2/4] xen/mm: enforce SCRUB_DEBUG checks for MEMF_no_scrub allocations Roger Pau Monne
2026-01-30 14:57 ` [PATCH v5 3/4] xen/mm: allow deferred scrub of physmap populate allocated pages Roger Pau Monne
2026-02-02 16:58   ` Jan Beulich
2026-01-30 14:57 ` [PATCH v5 4/4] xen/mm: limit non-scrubbed allocations to a specific order Roger Pau Monne
2026-02-03 15:00   ` Jan Beulich
2026-02-04 16:08     ` Roger Pau Monné [this message]
2026-02-05  9:40       ` Jan Beulich

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=aYNvEpxAqkJPfGF6@Mac.lan \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.