Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2020 11:59:59 +0100
From:      Alexandre Levy <a13xlevy@gmail.com>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Kernel crash during video transcoding
Message-ID:  <CAEWSB33_ka2aQb81UmODu72Be_9Vvqi4Qb-jfXHEZ1HgCqwADQ@mail.gmail.com>
In-Reply-To: <CAEWSB30YNwQ7Bpv00P-B=TTHCqT_aFm30552n51Pic1uN5hnZQ@mail.gmail.com>
References:  <CAEWSB323c2zapSG30OS5T30Wd_bpT=7NbvrPtsyQDRRHQUf7qA@mail.gmail.com> <13793020-1bde-b13f-65e3-909e27d876ad@selasky.org> <CAEWSB323KtVrixgRyKsekdgcGjFm4kUqG6qDE59Aev3Cc6sYBg@mail.gmail.com> <4e9d9a89-4883-1f1c-c796-e5925fd171cc@selasky.org> <CAEWSB30YNwQ7Bpv00P-B=TTHCqT_aFm30552n51Pic1uN5hnZQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I could reproduce with GENERIC kernel and i915 kms compiled with DEBUG and
I got this additional info (still no crash dump though) :

Kernel page fault with the following non-sleepable locks held:
kernel: exclusive rw vm object (vm object) r =3D 0 (0xfffff8037533bc60)
locked @
/usr/ports/graphics/drm-devel-kmod/work/drm-kmod-drm_v5.3_4/drivers/gpu/drm=
/i915/intel_freebsd.c:186

Looking at the code, the error happens during the call to VM_OBJECT_WLOCK
(memory page locking for write ?) in the intel_freebsd.c (see [1] below).
I'm out for a few days but I'll try to dig more into it when I'm back next
weekend although I have no experience in the drm-devel-kmod codebase. In
the meantime if you have any suggestions on debugging this further I'm
happy to follow them.

Thanks again.


[1] i915/intel_freebsd.c
int
remap_io_mapping(struct vm_area_struct *vma, unsigned long addr,
    unsigned long pfn, unsigned long size, struct io_mapping *iomap)
{
    vm_page_t m;
    vm_object_t vm_obj;
    vm_memattr_t attr;
    vm_paddr_t pa;
    vm_pindex_t pidx, pidx_start;
    int count, rc;

    attr =3D iomap->attr;
    count =3D size >> PAGE_SHIFT;
    pa =3D pfn << PAGE_SHIFT;
    pidx_start =3D OFF_TO_IDX(addr);
    rc =3D 0;
    vm_obj =3D vma->vm_obj;

    vma->vm_pfn_first =3D pidx_start;

    >>> VM_OBJECT_WLOCK(vm_obj); <<<
    for (pidx =3D pidx_start; pidx < pidx_start + count;
        pidx++, pa +=3D PAGE_SIZE) {
retry:
        m =3D vm_page_grab(vm_obj, pidx, VM_ALLOC_NOCREAT);
        if (m =3D=3D NULL) {
            m =3D PHYS_TO_VM_PAGE(pa);
            if (!vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL))
                goto retry;
            if (vm_page_insert(m, vm_obj, pidx)) {
                vm_page_xunbusy(m);
                VM_OBJECT_WUNLOCK(vm_obj);
                vm_wait(NULL);
                VM_OBJECT_WLOCK(vm_obj);
                goto retry;
            }
            vm_page_valid(m);
        }
        pmap_page_set_memattr(m, attr);
        vma->vm_pfn_count++;
    }
    VM_OBJECT_WUNLOCK(vm_obj);
    return (rc);
}

Le lun. 10 ao=C3=BBt 2020 =C3=A0 09:44, Alexandre Levy <a13xlevy@gmail.com>=
 a =C3=A9crit :

> Ah thanks, I was doing a make config-recursive and that didn't show the
> DEBUG option. It's recompiling the module with DEBUG now.
>
> Le lun. 10 ao=C3=BBt 2020 =C3=A0 09:43, Hans Petter Selasky <hps@selasky.=
org> a
> =C3=A9crit :
>
>> On 2020-08-10 10:41, Alexandre Levy wrote:
>> > I'm recompiling the kernel using GENERIC at the moment but I'm not sur=
e
>> how
>> > to enable debugging in i915 kms, there is no compile option for that,
>> am I
>> > missing something ?
>>
>> Type:
>>
>> make config
>>
>> Before building the i915kms port, then there should be a DEBUG option
>> you can select.
>>
>> --HPS
>>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEWSB33_ka2aQb81UmODu72Be_9Vvqi4Qb-jfXHEZ1HgCqwADQ>