Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp755953pxb; Thu, 17 Feb 2022 14:08:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwz4PmjYTaqyS09w8KtVhnYxy/pyOlXItw+mMl4cHOqCxRQ7nefsea8wN/ZbDNtunnPXNlY X-Received: by 2002:a17:902:a701:b0:14d:5a15:ebaf with SMTP id w1-20020a170902a70100b0014d5a15ebafmr4659945plq.33.1645135717036; Thu, 17 Feb 2022 14:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645135717; cv=none; d=google.com; s=arc-20160816; b=rINfnq2bvyXZGLcOH0qMNoNqmpJkrWj3EK4kvCrx5ym7EQwhLj97oHVCyVy9fHkWOq v276Doo8idqzXqHRmWpFsEX028jcbpdTNWGJh+hLHhBIOKkiQDM2I08bKs0CsTlc/0pT Q7xp8DKFNbZgKq3v2wSgZNoKkNM1Gf99bNCAAuD9KxOBqPohcer5o9wfIXs87VDhSyzA UoHXbBlKIUeGsYdulUOynJcB6QxZdEo1xPhzSehbIWvGjJz9SmQUxgiCg5D4FTVhQjsS xQbvJwT2NmufW1xC3XcDp6A1oU/92IgNCIIyg+npYlFYeXZ4L9sjMgIij4BPTaPxXdpW BOuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=bhd5MQSyYH/w18vuhM3aaFYET6orvkX165vupxHEPS4=; b=ltDQMEkbcWGBhzOBijgORlDRmdDvq3mo0cqfmOACmRC5smVQWoh5iNL7EETAGMQFt9 U7VF08OR2gxWbk9IwZRMg2l+Kzd6NnVHAMbdRY2Ta01TYVV5Dee8/XSpzUQNKMkvZSHe 0wOWEHD+IxmErURCUlDFrEvTe2KzF06604b3E8bUHQervMxfqp+5qYa5pzWahcr2gYtv b8kVEinI0Ajduq72xF9x+yOyLtO29X77LLd3XYj0u8q6FR9TAWkdIDJmY7O1jaA6h9te whcT6wImYm/kq2bjNqPK8Tz62i+ZRrbBHfOe91DzBX0MwknQaG8k8Nq5NNZUk7EgUq5x rtkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=nK5c9d3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 82si9430963pgd.156.2022.02.17.14.08.21; Thu, 17 Feb 2022 14:08:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=nK5c9d3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240626AbiBQNDW (ORCPT + 99 others); Thu, 17 Feb 2022 08:03:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240621AbiBQNDV (ORCPT ); Thu, 17 Feb 2022 08:03:21 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB48F291F9D; Thu, 17 Feb 2022 05:03:06 -0800 (PST) Received: from [192.168.1.111] (91-156-85-209.elisa-laajakaista.fi [91.156.85.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A6E7647F; Thu, 17 Feb 2022 14:03:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1645102985; bh=fmGNkvDxKEzYBZ9w2iowuzgmO/punzJ1e+W/3pqe3jg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nK5c9d3dofyn8/Qg3gDKxx5OzAQ4ieOLTGemE3Nb6XEFyY9sytttgDyCj9WYgo+2m jmojucO1qbz+0wMWmlkilyqmVhzKhikVyFw5tSX8nGD9eitiRQAULW31c12WxcEbPP MzFtZjpQnT3TdVsqN2b+MesAHgZuDWySXzDmnrRk= Message-ID: Date: Thu, 17 Feb 2022 15:03:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 0/3] drm: omapdrm: Fix excessive GEM buffers DMM/CMA usage Content-Language: en-US To: Ivaylo Dimitrov , tomba@kernel.org, airlied@linux.ie, daniel@ffwll.ch Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, merlijn@wizzup.org, tony@atomide.com References: <1642587791-13222-1-git-send-email-ivo.g.dimitrov.75@gmail.com> From: Tomi Valkeinen In-Reply-To: <1642587791-13222-1-git-send-email-ivo.g.dimitrov.75@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ivaylo, On 19/01/2022 12:23, Ivaylo Dimitrov wrote: > This patch series fixes excessive DMM or CMA usage of GEM buffers leading to > various runtime allocation failures. The series enables daily usage of devices > without exausting limited resources like CMA or DMM space if GPU rendering is > needed. > > The first patch doesn't bring any functional changes, it just moves some > TILER/DMM related code to a separate function, to simplify the review of the > next two patches. > > The second patch allows off-CPU rendering to non-scanout buffers. Without that > patch, it is basically impossible to use the driver allocated GEM buffers on > OMAP3 for anything else but a basic CPU rendered examples as if we want GPU > rendering, we must allocate buffers as scanout buffers, which are CMA allocated. > CMA soon gets fragmented and we start seeing allocation failures. Such failres > in Xorg cannot be handeled gracefully, so the system is basically unusable. > > Third patch fixes similar issue on OMAP4/5, where DMM/TILER spaces get > fragmented with time, leading to allocation failures. I think this is just hacking around the problem. The problem is that omapdrm is being used by some as a generic buffer allocator. Those users should be changed to use a their own allocator or a generic allocator. And we could then drop the OMAP_BO_SCANOUT flag, as all buffers would be scanout buffers. Or do we have a regression in the driver? My understanding is that this has never really worked. Tomi