From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13E1E105F7A2 for ; Fri, 13 Mar 2026 12:43:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E00D10EBD9; Fri, 13 Mar 2026 12:43:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="VFDaKRdD"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id F160D10EBD9 for ; Fri, 13 Mar 2026 12:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1773405812; bh=7Pm6mMExEx5lWIW38xNWnPfp0ZKZGLwsfIxn+Dyg4g8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VFDaKRdDnGGghZnpZSW5mYj6SElB0veOlaUHJBhuFwiI3B9kWjoza7aYGqqXgqzov VW1C5bH1/NQuk5QKAvSQFMwNgHRxYhOFrYwdi8pGsEFaZvdUWDTNeDV13YBGfon++x M9jTcWmLZs94YinJ977RvGdsMFkGLLthv7ULiu2nV0eSUQ5GOCo91T5sr5BgnbAh2G 6aPoOKsoYa5GU71v8sxS5d1SC8KxdkibvS/QtxyKqQFobAAVyL8TBsHb18xtFip/26 Pj/x4fZ7LjZ44pQbTFE3me4vTBuzFtzE/ipkQporhzIvByi0mux4US8NEcuf8jOP8S fR5XDqhUjKp0A== Received: from fedora (unknown [IPv6:2a01:e0a:2c:6930:d919:a6e:5ea1:8a9f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 1DBC717E0222; Fri, 13 Mar 2026 13:43:32 +0100 (CET) Date: Fri, 13 Mar 2026 13:43:28 +0100 From: Boris Brezillon To: Biju Das Cc: Thomas Zimmermann , Tommaso Merciai , "loic.molinari@collabora.com" , "willy@infradead.org" , "frank.binns@imgtec.com" , "matt.coster@imgtec.com" , "maarten.lankhorst@linux.intel.com" , "mripard@kernel.org" , "airlied@gmail.com" , "simona@ffwll.ch" , "linux-mm@kvack.org" , "dri-devel@lists.freedesktop.org" Subject: Re: [PATCH v4 5/6] drm/gem-shmem: Track folio accessed/dirty status in mmap Message-ID: <20260313134328.3166c4d0@fedora> In-Reply-To: <20260313131835.52c5c935@fedora> References: <20260227114509.165572-1-tzimmermann@suse.de> <20260227114509.165572-6-tzimmermann@suse.de> <20260313111851.4c1f89f3@fedora> <20260313125644.65131b27@fedora> <20260313131835.52c5c935@fedora> Organization: Collabora X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 13 Mar 2026 13:18:35 +0100 Boris Brezillon wrote: > On Fri, 13 Mar 2026 12:04:25 +0000 > Biju Das wrote: > > > > -----Original Message----- > > > From: dri-devel On Behalf Of Boris Brezillon > > > Sent: 13 March 2026 11:57 > > > Subject: Re: [PATCH v4 5/6] drm/gem-shmem: Track folio accessed/dirty status in mmap > > > > > > On Fri, 13 Mar 2026 11:29:47 +0100 > > > Thomas Zimmermann wrote: > > > > > > > Hi > > > > > > > > Am 13.03.26 um 11:18 schrieb Boris Brezillon: > > > > [...] > > > > >>>>> + if (drm_WARN_ON(obj->dev, !shmem->pages || page_offset >= num_pages)) > > > > >>>>> + return VM_FAULT_SIGBUS; > > > > >>>>> + > > > > >>>>> + file_update_time(vma->vm_file); > > > > >>>>> + > > > > >>>>> + folio_mark_dirty(page_folio(shmem->pages[page_offset])); > > > > > Do we need a folio_mark_dirty_lock() here? > > > > > > > > There is a helper for that with some documentation. [1] > > > > > > This [1] seems to solve the problem for me. Still unsure about the folio_mark_dirty_lock vs > > > folio_mark_dirty though. > > > > > > [1]https://yhbt.net/lore/dri-devel/20260312155027.1682606-1-pedrodemargomes@gmail.com/ > > > > FYI, I used folio_mark_dirty_lock() still it does not solve the issue with weston hang. > > The patch I pointed to has nothing to do with folio_mark_dirty_lock(), > It's a bug caused by huge page mapping changes. Scratch that. I had a bunch of other changes on top, and it hangs again now that I dropped those.