From owner-freebsd-current@freebsd.org Mon Aug 10 11:00:17 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A2BB37E9B1 for ; Mon, 10 Aug 2020 11:00:17 +0000 (UTC) (envelope-from a13xlevy@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BQCfk6746z48My for ; Mon, 10 Aug 2020 11:00:14 +0000 (UTC) (envelope-from a13xlevy@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id t14so7886812wmi.3 for ; Mon, 10 Aug 2020 04:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y9kd3Jk3eUoHTrZlTFjd4+35fg3weWz9iFsL6KMMgeo=; b=gYel72oLxYDymeOV/S82QEzMJHaFEniBPnmqMH/OfF6BILNAaOKGMBT+xqzKYaLpLG r2E0h1Uk+hCAWSdWkgb9iH2G4zWctTuK15d8XgGMQzu3EMtVbcDXGCW9J/ELdEDdOGmA tiQV9NWE0IoG7ogK+MJyo4k80tt9r/NqBF/H5o1Qo9SovoEO4kbp8tNLgt+WWNhlAZii dZ4UZwwwO4OAgD1EBvfmq8pr8tPcYmRpm9nF880Ilhrdkxg8oqcrhRWV5Uy176ePbnjO JxD8bYoBPJLGRj4fZTO1cBMfCsv4DqotUl5rgjl+j2ynrf5TOvPQ27z7ogLPjSh+e2qT tfjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y9kd3Jk3eUoHTrZlTFjd4+35fg3weWz9iFsL6KMMgeo=; b=CG+6czwX3F8XoMtTMxdcfgEzt/NjHTCRtvffCnNrF1VqW+Xq2Xnh+vL9mSSJTOisbh JDf/B4kQhSIfndysmtj8C2XzCdG3jR0fZ4CJaPgDgVZT2L+vewDdoDugo4YIFSEE3Sso gm7FY8w8SJ9QoBuUZC2sZSkeRIdLwI8LRDeYe5oXVU5i/1C8KSG/zswjTnxxa7SClfwl /eeblvg1niM6Q9DWwTSp9cj8LBR1C0SY6ZG+X77CR7KTAIR8ht+1kBrpp/UxOpbG1MWD DivsfxehIAWmY9IUxnX1hv2lR1i2srp96aVRSKidGFecfifORuewxKoOyyKHOKtddzl0 OYbw== X-Gm-Message-State: AOAM533Q+WjtepdLVxKs9jM8M+9tU3cFajDTJYaMzjcWu5YbEAHMTBEF TBEwMGfog15ubshPCh3KmLBr+28PeyW+51/uDUDroL2y5hA= X-Google-Smtp-Source: ABdhPJzES1JLiKNUlvp1DHlaiZFWNbhg1uJVI8rfZ24qEw2eekvh1LM04MaGXmpxh4km2zV4fm4Y9sz+u25dPjZyrmQ= X-Received: by 2002:a7b:c105:: with SMTP id w5mr24423127wmi.146.1597057212064; Mon, 10 Aug 2020 04:00:12 -0700 (PDT) MIME-Version: 1.0 References: <13793020-1bde-b13f-65e3-909e27d876ad@selasky.org> <4e9d9a89-4883-1f1c-c796-e5925fd171cc@selasky.org> In-Reply-To: From: Alexandre Levy Date: Mon, 10 Aug 2020 11:59:59 +0100 Message-ID: Subject: Re: Kernel crash during video transcoding To: Hans Petter Selasky Cc: freebsd-current@freebsd.org X-Rspamd-Queue-Id: 4BQCfk6746z48My X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=gYel72oL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of a13xlevy@gmail.com designates 2a00:1450:4864:20::344 as permitted sender) smtp.mailfrom=a13xlevy@gmail.com X-Spamd-Result: default: False [-3.51 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.07)[-1.072]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; NEURAL_HAM_LONG(-1.02)[-1.016]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::344:from]; NEURAL_HAM_SHORT(-0.42)[-0.420]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 11:00:17 -0000 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 = 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 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 >> >