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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41200C433EF for ; Thu, 14 Oct 2021 16:17:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1835A60C41 for ; Thu, 14 Oct 2021 16:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231856AbhJNQTe (ORCPT ); Thu, 14 Oct 2021 12:19:34 -0400 Received: from foss.arm.com ([217.140.110.172]:57488 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbhJNQTc (ORCPT ); Thu, 14 Oct 2021 12:19:32 -0400 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 A378B11D4; Thu, 14 Oct 2021 09:17:27 -0700 (PDT) Received: from [10.57.95.157] (unknown [10.57.95.157]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4AA8A3F66F; Thu, 14 Oct 2021 09:17:26 -0700 (PDT) Subject: Re: [RFC] iommu: Use put_pages_list To: John Garry , Matthew Wilcox , Joerg Roedel , Suravee Suthikulpanit , Will Deacon , David Woodhouse , Lu Baolu , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" References: <20210930162043.3111119-1-willy@infradead.org> <5e147b84-f048-b5ff-09d6-ceffe4c2364a@huawei.com> From: Robin Murphy Message-ID: <93425cf4-3027-940f-3bee-29c4ee61105f@arm.com> Date: Thu, 14 Oct 2021 17:17:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <5e147b84-f048-b5ff-09d6-ceffe4c2364a@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-10-14 12:52, John Garry wrote: > On 14/10/2021 12:20, Matthew Wilcox wrote: >> I'm going to keep pinging this patch weekly. >> >> On Thu, Oct 07, 2021 at 07:17:02PM +0100, Matthew Wilcox wrote: >>> ping? > > Robin, Were you checking this? You mentioned "I got > side-tracked trying to make io-pgtable use that freelist properly" in > another thread, which seems related. Ooh, thanks for the heads-up John - I'm still only just starting to catch up on my mailing list folders since I got back off holiday. Indeed I already started untangling the freelist handling in the flush queue code (to make the move into iommu-dma smaller). Once I'd figured out how it worked I did wonder whether there was any more "standard" field to borrow, since page->freelist did seem very much in the minority. If page->lru is it then great! From a quick skim of the patch I think I'd only have a few trivial review comments to make - certainly no objection to the fundamental change itself (indeed I hit a point in io-pgtable-arm where adding to the pointer chain got rather awkward, so having proper lists to splice would be lovely). Matthew - is this something getting in the way of mm development, or just a nice cleanup? I'd be happy either to pursue merging it on its own, or to pick it up and work it into a series with my stuff. Cheers, Robin. > > Thanks, > John > >>> >>> On Thu, Sep 30, 2021 at 05:20:42PM +0100, Matthew Wilcox (Oracle) wrote: >>>> 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 free_pages_list(). >>>> >>>> Signed-off-by: Matthew Wilcox (Oracle) >>>> --- >>>>   drivers/iommu/amd/io_pgtable.c | 99 >>>> +++++++++++++++------------------- >>>>   drivers/iommu/dma-iommu.c      | 11 +--- >>>>   drivers/iommu/intel/iommu.c    | 89 +++++++++++------------------- >>>>   include/linux/iommu.h          |  3 +- >>>>   4 files changed, 77 insertions(+), 125 deletions(-) >>>> > _______________________________________________ > iommu mailing list > iommu@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A30AC433F5 for ; Thu, 14 Oct 2021 16:17:33 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1CB5660C41 for ; Thu, 14 Oct 2021 16:17:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1CB5660C41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D351B60762; Thu, 14 Oct 2021 16:17:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5RdMWKPaT_lJ; Thu, 14 Oct 2021 16:17:32 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id BFD58606E6; Thu, 14 Oct 2021 16:17:31 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 84D27C0011; Thu, 14 Oct 2021 16:17:31 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id D8F9FC000D for ; Thu, 14 Oct 2021 16:17:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B0122831E7 for ; Thu, 14 Oct 2021 16:17:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3oSmUWlo0GP9 for ; Thu, 14 Oct 2021 16:17:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp1.osuosl.org (Postfix) with ESMTP id 961B2831DA for ; Thu, 14 Oct 2021 16:17:28 +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 A378B11D4; Thu, 14 Oct 2021 09:17:27 -0700 (PDT) Received: from [10.57.95.157] (unknown [10.57.95.157]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4AA8A3F66F; Thu, 14 Oct 2021 09:17:26 -0700 (PDT) Subject: Re: [RFC] iommu: Use put_pages_list To: John Garry , Matthew Wilcox , Joerg Roedel , Suravee Suthikulpanit , Will Deacon , David Woodhouse , Lu Baolu , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" References: <20210930162043.3111119-1-willy@infradead.org> <5e147b84-f048-b5ff-09d6-ceffe4c2364a@huawei.com> From: Robin Murphy Message-ID: <93425cf4-3027-940f-3bee-29c4ee61105f@arm.com> Date: Thu, 14 Oct 2021 17:17:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <5e147b84-f048-b5ff-09d6-ceffe4c2364a@huawei.com> Content-Language: en-GB X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" T24gMjAyMS0xMC0xNCAxMjo1MiwgSm9obiBHYXJyeSB3cm90ZToKPiBPbiAxNC8xMC8yMDIxIDEy OjIwLCBNYXR0aGV3IFdpbGNveCB3cm90ZToKPj4gSSdtIGdvaW5nIHRvIGtlZXAgcGluZ2luZyB0 aGlzIHBhdGNoIHdlZWtseS4KPj4KPj4gT24gVGh1LCBPY3QgMDcsIDIwMjEgYXQgMDc6MTc6MDJQ TSArMDEwMCwgTWF0dGhldyBXaWxjb3ggd3JvdGU6Cj4+PiBwaW5nPwo+IAo+IFJvYmluLCBXZXJl IHlvdSBjaGVja2luZyB0aGlzPyBZb3UgbWVudGlvbmVkICJJIGdvdAo+IHNpZGUtdHJhY2tlZCB0 cnlpbmcgdG8gbWFrZSBpby1wZ3RhYmxlIHVzZSB0aGF0IGZyZWVsaXN0IHByb3Blcmx5IiBpbiAK PiBhbm90aGVyIHRocmVhZCwgd2hpY2ggc2VlbXMgcmVsYXRlZC4KCk9vaCwgdGhhbmtzIGZvciB0 aGUgaGVhZHMtdXAgSm9obiAtIEknbSBzdGlsbCBvbmx5IGp1c3Qgc3RhcnRpbmcgdG8gCmNhdGNo IHVwIG9uIG15IG1haWxpbmcgbGlzdCBmb2xkZXJzIHNpbmNlIEkgZ290IGJhY2sgb2ZmIGhvbGlk YXkuCgpJbmRlZWQgSSBhbHJlYWR5IHN0YXJ0ZWQgdW50YW5nbGluZyB0aGUgZnJlZWxpc3QgaGFu ZGxpbmcgaW4gdGhlIGZsdXNoIApxdWV1ZSBjb2RlICh0byBtYWtlIHRoZSBtb3ZlIGludG8gaW9t bXUtZG1hIHNtYWxsZXIpLiBPbmNlIEknZCBmaWd1cmVkIApvdXQgaG93IGl0IHdvcmtlZCBJIGRp ZCB3b25kZXIgd2hldGhlciB0aGVyZSB3YXMgYW55IG1vcmUgInN0YW5kYXJkIiAKZm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