public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
	Petr Mladek <pmladek@suse.com>,
	linux-kselftest@vger.kernel.org, live-patching@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: Re: selftests/livepatch fails on s390
Date: Tue, 19 Dec 2023 09:50:18 -0500	[thread overview]
Message-ID: <8adb8209-d49b-4feb-5ab3-47ca4f3cefbc@redhat.com> (raw)
In-Reply-To: <ZYFmOfFgsOdeikec@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>

On 12/19/23 04:45, Alexander Gordeev wrote:
> On Mon, Dec 18, 2023 at 05:44:54PM -0500, Joe Lawrence wrote:
> 
>> @@ -280,7 +268,13 @@ function set_pre_patch_ret {
>>  function start_test {
>>  	local test="$1"
>>  
>> -	save_dmesg
>> +	# Dump something unique into the dmesg log, then stash the entry
>> +	# in LAST_DMESG.  The check_result() function will use it to
>> +	# find new kernel messages since the test started.
>> +	local timestamp="$(date --rfc-3339=ns)"
>> +	log "livepatch kselftest timestamp: $timestamp"
>> +	LAST_DMESG=$(dmesg | grep "livepatch kselftest timestamp: $timestamp")
> 
> Not sure if it not paranoid mode, but still..
> If the 'log' call is guaranteed synced? AKA would 'grep' always catch the line?
> 
> And yeah.. if the log output is pushed away (e.g by a crazy-dumping concurrent
> logger), then nothing here would work. But this is not a new problem, so just
> my two cents.
> 

Good question.  I added the timestamp message to ensure there would  be
something in the log to grab onto... but I'm not sure what guarantees
there are about syncing back out through dmesg.

There is a loop_util() utility function in the script that could be used
to wait, like:

	log "$last_dmesg_msg"
	loop_until "dmesg | grep -q '$last_dmesg_msg'" ||
		die "Can't find canary dmesg entry, buffer overrun?"
	LAST_DMESG=$(dmesg | grep "$last_dmesg_msg")

That should catch 1) short latencies and 2) buffer rollover.  Maybe that
is good enough?

-- 
Joe


  reply	other threads:[~2023-12-19 14:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 10:44 selftests/livepatch fails on s390 Alexander Gordeev
2023-12-18 16:44 ` Joe Lawrence
2023-12-18 22:44   ` Joe Lawrence
2023-12-19  9:45     ` Alexander Gordeev
2023-12-19 14:50       ` Joe Lawrence [this message]
2023-12-19 15:23         ` Alexander Gordeev
2023-12-20 13:19         ` Petr Mladek

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=8adb8209-d49b-4feb-5ab3-47ca4f3cefbc@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=agordeev@linux.ibm.com \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.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