Hi,

I wrote a kernel module to play with hrtimer subsystem and it hangs
with UML, Any ideas on why it may be hanging? It doesn't hang on any
of my other machines. Hopefully I'm not doing something stupid, but I
don't think I am..

It appears the timer handler does fire. However, the UML process is
continously doing a kill(SIGALRM) to the host, and the shell hangs.
Here's the continous strace output of UML's process at the time of the
hang: https://hastebin.com/ikehadapon.sql

To build UML, I do:
make ARCH=um x86_64_defconfig

UML kernel version is v4.16-rc4

Here's the module I'm loading:

static enum hrtimer_restart bigtimer_handle(struct hrtimer *timer)
{
        printk(KERN_ERR "timer fired 2\n");
        spin_lock(&il->biglock);
        spin_unlock(&il->biglock);

        release_now = 1;

        return HRTIMER_NORESTART;
}

void init_bigstr(struct bigstr *b)
{
        spin_lock_init(&b->biglock);
}

static int __init test_module_init(void)
{
        struct bigstr b1, b2;
        struct hrtimer *timer;

        release_now = 0;

        init_bigstr(&b1);
        init_bigstr(&b2);

        timer = &bigtimer;
        timer->debug = 1;

        hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        timer->function = bigtimer_handle;

        il = &b2;
        spin_lock(&b1.biglock);

        printk(KERN_ERR "Starting timer\n");
        hrtimer_start(timer, ns_to_ktime(50000ULL),
                      HRTIMER_MODE_REL_PINNED);

        while(release_now == 0);

        spin_unlock(&b1.biglock);
        return -1;
}


Thanks for any debug thoughts!
I'll also try to hook up gdb tomorrow and see if I find something..

Regards,

- Joel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to