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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0C64C433EF for ; Wed, 1 Dec 2021 19:46:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1ED106B0074; Wed, 1 Dec 2021 14:46:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 19D7A6B007B; Wed, 1 Dec 2021 14:46:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0656B6B007D; Wed, 1 Dec 2021 14:46:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id EE4776B0074 for ; Wed, 1 Dec 2021 14:46:11 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B68B918126911 for ; Wed, 1 Dec 2021 19:46:01 +0000 (UTC) X-FDA: 78870256122.29.4E100CE Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf02.hostedemail.com (Postfix) with ESMTP id 55B5D7001A08 for ; Wed, 1 Dec 2021 19:45:59 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0D03413D5; Wed, 1 Dec 2021 11:45:59 -0800 (PST) Received: from [10.57.34.58] (unknown [10.57.34.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CFB1E3F766; Wed, 1 Dec 2021 11:45:56 -0800 (PST) Message-ID: <70fbdc70-6838-0740-43e3-ed20caff47bf@arm.com> Date: Wed, 1 Dec 2021 19:45:52 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH v2 29/33] iommu: Use put_pages_list Content-Language: en-GB To: Matthew Wilcox , Vlastimil Babka Cc: Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg , linux-mm@kvack.org, Andrew Morton , patches@lists.linux.dev, Joerg Roedel , Suravee Suthikulpanit , Will Deacon , David Woodhouse , Lu Baolu , iommu@lists.linux-foundation.org References: <20211201181510.18784-1-vbabka@suse.cz> <20211201181510.18784-30-vbabka@suse.cz> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 55B5D7001A08 X-Stat-Signature: 51eqjzemmh4kmakzbxo3esm5rawfcd5j Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of robin.murphy@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=robin.murphy@arm.com; dmarc=pass (policy=none) header.from=arm.com X-HE-Tag: 1638387959-425454 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2021-12-01 19:07, Matthew Wilcox wrote: > On Wed, Dec 01, 2021 at 07:15:06PM +0100, Vlastimil Babka wrote: >> From: "Matthew Wilcox (Oracle)" >> >> page->freelist is for the use of slab. We already have the ability >> to free a list of pages in the core mm, but it requires the use of a >> list_head and for the pages to be chained together through page->lru. >> Switch the iommu code over to using put_pages_list(). > > FYI, this is going to have conflicts with > https://lore.kernel.org/lkml/cover.1637671820.git.robin.murphy@arm.com/ > > I'm not sure what the appropriate resolution is going to be here; > maybe hold back part of this patch series to the following merge > window to give the iommu people time to merge their own patches? More than that, this version is subtly but catastrophically broken - we can't simply pass &gather->freelist through the current IOVA entry_dtor machinery, since gather is a stack variable from a few call frames up so the actual list head will be long gone by the time iommu_dma_entry_dtor() tries to dereference it. It took until I was elbow-deep in refactoring the RFC to notice that one :) Thanks, Robin.