Skip to content

Commit

Permalink
Merge tag 'livepatching-for-5.20' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/livepatching/livepatching

Pull livepatching update from Petr Mladek:

 - Make a selftest more reliable

* tag 'livepatching-for-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching:
  selftests/livepatch: better synchronize test_klp_callbacks_busy
  • Loading branch information
Linus Torvalds committed Aug 6, 2022
2 parents a9cf69d + 55eb9a6 commit 033a944
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/livepatch/test_klp_callbacks_busy.c
Original file line number Diff line number Diff line change
@@ -16,10 +16,12 @@ MODULE_PARM_DESC(block_transition, "block_transition (default=false)");

static void busymod_work_func(struct work_struct *work);
static DECLARE_WORK(work, busymod_work_func);
static DECLARE_COMPLETION(busymod_work_started);

static void busymod_work_func(struct work_struct *work)
{
pr_info("%s enter\n", __func__);
complete(&busymod_work_started);

while (READ_ONCE(block_transition)) {
/*
@@ -37,6 +39,12 @@ static int test_klp_callbacks_busy_init(void)
pr_info("%s\n", __func__);
schedule_work(&work);

/*
* To synchronize kernel messages, hold the init function from
* exiting until the work function's entry message has printed.
*/
wait_for_completion(&busymod_work_started);

if (!block_transition) {
/*
* Serialize output: print all messages from the work

0 comments on commit 033a944

Please sign in to comment.