All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: laokz <laokz@foxmail.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	"live-patching@vger.kernel.org" <live-patching@vger.kernel.org>
Subject: Re: selftests/livepatch: question about dmesg "signaling remaining tasks"
Date: Thu, 16 Jan 2025 09:48:52 +0100	[thread overview]
Message-ID: <Z4jH9By-NdPCKM8f@pathway.suse.cz> (raw)
In-Reply-To: <tencent_FB39E787D4AB347DE10AE0811A00946EB40A@qq.com>

On Thu 2025-01-16 13:03:16, laokz wrote:
> Hi Petr,
> 
> Thanks for the quick reply.
> 
> On 1/15/2025 11:57 PM, Petr Mladek wrote:
> > On Wed 2025-01-15 08:32:12, laokz@foxmail.com wrote:
> > > When do livepatch transition, kernel call klp_try_complete_transition() which in-turn might call klp_send_signals(). klp_send_signal() has the code:
> > > 
> > >          if (klp_signals_cnt == SIGNALS_TIMEOUT)
> > >                  pr_notice("signaling remaining tasks\n");
> > > 
> > > Do we need to match or filter out this message when check_result?
> > > And here klp_signals_cnt MUST EQUAL to SIGNALS_TIMEOUT, right?
> 
> Oops, I misunderstood the 2nd question: (klp_signals_cnt % SIGNALS_TIMEOUT
> == 0) not always mean equal.
> 
> > Good question. Have you seen this message when running the selftests, please?
> > 
> > I wonder which test could trigger it. I do not recall any test
> > livepatch where the transition might get blocked for too long.
> > 
> > There is the self test with a blocked transition ("busy target
> > module") but the waiting is stopped much earlier there.
> > 
> > The message probably might get printed when the selftests are
> > called on a huge and very busy system. But then we might get
> > into troubles also with other timeouts. So it would be nice
> > to know more details about when this happens.
> 
> We're trying to port livepatch to RISC-V. In my qemu virt VM in a cloud
> environment, all tests passed except test-syscall.sh. Mostly it complained
> the missed dmesg "signaling remaining tasks". I want to confirm from your
> experts that in theory the failure is expected, or if we could filter out
> this potential dmesg completely.

The test-syscall.sh test spawns many processes which are calling the
SYS_getpid syscall in a busy loop. I could imagine that it might
cause problems when the virt VM emulates much more virtual CPUs than
the assigned real CPUs. It might be even worse when the RISC-V
processor is just emulated on another architecture.

Anyway, we have already limited the max number of processes because
they overflow the default log buffer size, see the commit
46edf5d7aed54380 ("selftests/livepatch: define max test-syscall
processes").

Does it help to reduce the MAXPROC limit from 128 to 64, 32, or 16?
IMHO, even 16 processes are good enough. We do not need to waste
that many resources by QA.

You might also review the setup of your VM and reduce the number
of emulated CPUs. If the VM is not able to reasonably handle
high load than it might show false positives in many tests.

If nothing helps, fell free to send a patch for filtering the
"signaling remaining tasks" message. IMHO, it is perfectly fine
to hide this message. Just extend the already existing filter in
the "check_result" function.

Best Regards,
Petr

  reply	other threads:[~2025-01-16  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <TYZPR01MB6878934C04B458FA6FEE011CA6192@TYZPR01MB6878.apcprd01.prod.exchangelabs.com>
     [not found] ` <tencent_D03A5C20BC0603E8D2F936D37C97FAE62607@qq.com>
2025-01-15 15:57   ` selftests/livepatch: question about dmesg "signaling remaining tasks" Petr Mladek
2025-01-16  5:03     ` laokz
2025-01-16  8:48       ` Petr Mladek [this message]
2025-01-16 14:17         ` laokz
2025-01-17 13:10       ` Miroslav Benes
2025-01-20  6:38         ` laokz

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=Z4jH9By-NdPCKM8f@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=laokz@foxmail.com \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    /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.