From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E9CF37F746 for ; Thu, 14 May 2026 10:41:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778755263; cv=none; b=O/fpZNQXNEti8qs1Z+TrQmxZ/zX4vN8rXfV+lMinj56F+qnuxpYqWZTDKe9vk8qGABzWv5ooaj8pzTohgKgJU3VI6ZbVj1KFa5dcdpbc0JjLvuqvmdySubvaQXTjP2WBzeP4Yf+sjuOZoZ9tOCvQ1jnZ8z0haXjP6ToJJDnZPBI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778755263; c=relaxed/simple; bh=UdUtbB1KKCUQA7QYGmM8hiQm9oKu3vwDYTWqyKgFU4Y=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=PMOEOh7S5nZQnhdgkc0jS/PxDIqV/AT0O8xScfz9kTz5CIAtMp1gha2jF/7OlZkjyF/vxgK1QatcPxoqHU4czprz0lcosP62V0K46/sPgl/uXUADEdO7sFVWGr1wzkTgejiS2WZGf1szTXd9ATi1OUELyJZ/HmV92HiB19oV8rY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Ujv1brq9; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ujv1brq9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778755262; x=1810291262; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=UdUtbB1KKCUQA7QYGmM8hiQm9oKu3vwDYTWqyKgFU4Y=; b=Ujv1brq9yQglJ8JJKYfNKYIQFZ6FYb2Z9VsoxI0OED79f5arh3OQqsm7 oGHC6v4HBBj+atffLy8fJy0M5LsOPvP451Vih64/Hh56YGIct4y8qEJO4 vpgG5jVqGefEP/JdZjKPf9jEMhOc6q2qYn7szQGVGd5u+QlDqTq7kPket Qz7PPoyKFFIqPqXcXQ+fiOZ48QtQvW98yewhSu+EmVABcmxHZ76LVvvsD aZRwwNdnm1dDKlJVHJJuBxs6hxBau0AQobvP6T8jPo7EbhfDMDygXfV2O ti4M5z8Yld46vR7OkUoG9HjWYSj3+Ba5oVBw78b/v6megNmi2DvD4aIMQ g==; X-CSE-ConnectionGUID: FX3lTLkMQjK35JRekFYXzQ== X-CSE-MsgGUID: l3FUcSlLSeiLs02Iln/DTw== X-IronPort-AV: E=McAfee;i="6800,10657,11785"; a="79408507" X-IronPort-AV: E=Sophos;i="6.23,234,1770624000"; d="scan'208";a="79408507" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2026 03:41:01 -0700 X-CSE-ConnectionGUID: 8iaG3PHYQ6+GrAdKFrQALQ== X-CSE-MsgGUID: vunfD7ioRj6XQNXNyLC5YQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,234,1770624000"; d="scan'208";a="237489377" Received: from smoticic-mobl1.ger.corp.intel.com (HELO [10.245.244.244]) ([10.245.244.244]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2026 03:40:55 -0700 Message-ID: <0fd47baa4bf8a83e258f8cd74de3a51c056ae59c.camel@linux.intel.com> Subject: Re: [PATCH 1/2] mm/shmem: add shmem_insert_folio() From: Thomas =?ISO-8859-1?Q?Hellstr=F6m?= To: "David Hildenbrand (Arm)" , Christian =?ISO-8859-1?Q?K=F6nig?= , intel-xe@lists.freedesktop.org Cc: Andrew Morton , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Hugh Dickins , Baolin Wang , Brendan Jackman , Johannes Weiner , Zi Yan , Huang Rui , Matthew Auld , Matthew Brost , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Thu, 14 May 2026 12:40:53 +0200 In-Reply-To: References: <20260512110339.6244-1-thomas.hellstrom@linux.intel.com> <20260512110339.6244-2-thomas.hellstrom@linux.intel.com> <26479389-459b-4cc4-914d-e7d29d5e5cc9@kernel.org> <1ce447ceea88bbe56c7d28654a51fc2856a7f986.camel@linux.intel.com> <65596f86-e6a3-48b0-aa3d-2e608964e29d@kernel.org> Organization: Intel Sweden AB, Registration Number: 556189-6027 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-05-13 at 21:35 +0200, David Hildenbrand (Arm) wrote: > On 5/13/26 16:53, Thomas Hellstr=C3=B6m wrote: > > On Wed, 2026-05-13 at 13:36 +0200, David Hildenbrand (Arm) wrote: > > > On 5/13/26 12:37, Thomas Hellstr=C3=B6m wrote: > > >=20 > > >=20 > > > >=20 > > [...] > > > > One alternative would be a single large sparse shmem object > > > > common > > > > for > > > > all DRM objects, with a range allocator, but that also got > > > > pretty > > > > ugly > > > > when I tried to implement that. > > >=20 > > > Does not sound too crazy, though. > > >=20 > > > >=20 > >=20 > > Yeah, I stumbled on finding a reasonable idea to connect a shmem > > folio > > to the pool LRUs and the range allocator metadata. > >=20 > > Assuming a shmem folio is pinned using the memfd pinning interface, > > would folio->private be temporarily available? >=20 > I think shmem uses folio->private only when the folio is in the > swapcache > (through folio->swap). So one has to protect against that. >=20 > So you're thinking of a model, where a shmem file is essentially > fully "owned" > by a DRM object, and that owner could make use of folio->private as > long as the > folio is prevented from getting swapped out? (e.g., longterm pinned > etc) Yeah, exactly. Thanks, Thomas