Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4495316pxu; Mon, 21 Dec 2020 14:10:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTdrQg5ZamuvGToQ2OIg0O58cFLLxVJWweUZFLg/2BMQF10x4i2Hi0VK/MBgDr+q8FeCmy X-Received: by 2002:a17:906:2c54:: with SMTP id f20mr17448768ejh.318.1608588650911; Mon, 21 Dec 2020 14:10:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608588650; cv=none; d=google.com; s=arc-20160816; b=rppIsEjR1V9zb6YgKZCw+4Sw3r6pSrvGX8bGn+4AKd2LGSkpRxw5RMzmtkOtXPGFbZ YGkMuQtMt2rzHo7eGHhXtoWU2HupPMEzBs7IPn7Y7ZKa2Z7Dar1qBzkrfaiF8Co5Aa+8 0/8pmqMZz06VwnXWtlQ5xaoPhOpk7K7AVGA8kJM8w+04iDCHulODms6z1K7ntvtx2gfj PS1iX1qbkY7OJmIl+rY0JVMx6P2OVIdtrnQvaUlrOSYTZtP4y+gW9nqWyuwF7jpMXuoo KV4fWzGBPco2wa6+JeVHsWXbwbaiKqJLQX44+b1PSxyXW3XT3akamcwLXSaj+e26xseG XlSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Kv6+mQ/2PR9Y/KxXUnGcTVCVLw1XND8pVr3hmrooxtw=; b=c8YGvueypwaUbVum6d6MmIY9ouT2Bfik5xii2MZ204wCjUKvwBwOrLWOc+NnkvMJVh PDrk+G4CwvFI0RLngNZZGsvEbpGIiL5WNYP0KKTWFlDjIcR+++fbuzsLzbIfkRInEWzL YJTHY3sol78N5xUricssgMXioL44sh1+fM+jiJ1p0eiwq4tka1KeBTspSs5ktJ53LF6g gfjV04ZtEn40LKRDO7eO2CrB2pTbTM5++eeaF6a1e7LSb+qU4L/ay3eu3ax9ULamJMpb Fb1Y+MBzikRrt7As2NohBeTAM54p9Siq8Woido+/KrDSlxPghGxtjcESc2Na0weWrvw9 zOZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=bXURP2Lm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si11995305edv.243.2020.12.21.14.10.28; Mon, 21 Dec 2020 14:10:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=bXURP2Lm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726112AbgLUWJo (ORCPT + 99 others); Mon, 21 Dec 2020 17:09:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbgLUWJn (ORCPT ); Mon, 21 Dec 2020 17:09:43 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C271C0613D3 for ; Mon, 21 Dec 2020 14:09:03 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id 3so342308wmg.4 for ; Mon, 21 Dec 2020 14:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=Kv6+mQ/2PR9Y/KxXUnGcTVCVLw1XND8pVr3hmrooxtw=; b=bXURP2LmkZg8fIIAV3AQ1ix/+TrCccX+pgpMEdTDOtAyRrAoIcaz7vjFYIfFF5vqtB fScpfzoozZ2OHDV1HEy4SG7y7bGok7OOey/N6hatW11QsOS4gIUGMin4BTbTqaQK4C4f hA3seveuaB4PBNmzqb/7sgGfcLxMWJtTDlGUI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=Kv6+mQ/2PR9Y/KxXUnGcTVCVLw1XND8pVr3hmrooxtw=; b=dFG9hAOhEvDPa+7DHuWdLgsdEN1oGuWWbnkCBJZDI/d/VlOBclenXNjwPmhqZlQDIy 47Z8f/faEsOVb6ACAs5Vy6kN3FBdsZ95MWfFrOevPEv5ajdBP5kloO9/6wJ1aDEuybws Hw/brYMvlPRQ4CssdWw3ELD3A2t+cZXyXVCFk/ab0dmoKZyANuM4EBG27pecjcaMkb1H k1YWynDtFUlqkfwFg5UcTXp4n9oI98rVzK6i4iEGVL719tPiIjuY2BpUeHLwqhj7yxDD dIYihyVEKMD6WpBFU369awSxNVfVEan0QJtj+Qalq6j0N49dFpvz3GSR9Q749z9zlNzT CM3Q== X-Gm-Message-State: AOAM532x6vIjwzjqV3s1iQUiWALpHdC2dWeAEsBS7N1lqBD4EBSxN2Yr X6Xf4RgfkkKkGutAY57JEfznAA== X-Received: by 2002:a7b:cd90:: with SMTP id y16mr18996235wmj.115.1608588542090; Mon, 21 Dec 2020 14:09:02 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id m5sm18056514wrz.18.2020.12.21.14.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Dec 2020 14:09:01 -0800 (PST) Date: Mon, 21 Dec 2020 23:08:59 +0100 From: Daniel Vetter To: John Stultz Cc: lkml , Sandeep Patil , dri-devel , Ezequiel Garcia , Robin Murphy , James Jones , Liam Mark , Laura Abbott , Chris Goldsworthy , Hridya Valsaraju , =?iso-8859-1?Q?=D8rjan?= Eide , linux-media , Suren Baghdasaryan , Daniel Mentz Subject: Re: [RFC][PATCH 2/3] dma-buf: system_heap: Add pagepool support to system heap Message-ID: Mail-Followup-To: John Stultz , lkml , Sandeep Patil , dri-devel , Ezequiel Garcia , Robin Murphy , James Jones , Liam Mark , Laura Abbott , Chris Goldsworthy , Hridya Valsaraju , =?iso-8859-1?Q?=D8rjan?= Eide , linux-media , Suren Baghdasaryan , Daniel Mentz References: <20201217230612.32397-1-john.stultz@linaro.org> <20201217230612.32397-2-john.stultz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.7.0-1-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 18, 2020 at 05:16:56PM -0800, John Stultz wrote: > On Fri, Dec 18, 2020 at 6:36 AM Daniel Vetter wrote: > > On Thu, Dec 17, 2020 at 11:06:11PM +0000, John Stultz wrote: > > > Reuse/abuse the pagepool code from the network code to speed > > > up allocation performance. > > > > > > This is similar to the ION pagepool usage, but tries to > > > utilize generic code instead of a custom implementation. > > > > We also have one of these in ttm. I think we should have at most one of > > these for the gpu ecosystem overall, maybe as a helper that can be plugged > > into all the places. > > > > Or I'm kinda missing something, which could be since I only glanced at > > yours for a bit. But it's also called page pool for buffer allocations, > > and I don't think there's that many ways to implement that really :-) > > Yea, when I was looking around the ttm one didn't seem quite as > generic as the networking one, which more easily fit in here. Oops, I didn't look that closely and didn't realize you're reusing the one from net/core/. > The main benefit for the system heap is not so much the pool itself > (the normal page allocator is pretty good), as it being able to defer > the free and zero the pages in a background thread, so the pool is > effectively filled with pre-zeroed pages. > > But I'll take another look at the ttm implementation and see if it can > be re-used or the shared code refactored and pulled out somehow. I think moving the page_pool from net into lib and using it in ttm might also be an option. Lack of shrinker in the networking one might be a bit a problem. Also I guess the real fun will start if you pre-flush pages (after zeroing) or use write-combined mode (which tends to be a real pain to allocate). So for those I think we likely need more than just reusing the one net/core has already. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch