Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp465773ybk; Wed, 20 May 2020 04:17:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbWoXEKq9BBnxfaxWHAmXq8snnQQ+uzl6Wrnca3ztpOOjYklklqr47UcaTKrBVnTh+9f+j X-Received: by 2002:a17:906:1d4c:: with SMTP id o12mr3146660ejh.357.1589973424265; Wed, 20 May 2020 04:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589973424; cv=none; d=google.com; s=arc-20160816; b=DRQgkYjVyVRlM6bsk8R7j6j4YI65ICu93uTFnUIOGOfilpElqxIGmTJJabdoH/IrcH XluZA5lnzYGHElo5iI+QIEl/deh4uWKLsI8fOaXBJ1V7KjyD0P2cn9G8F23AZDJ2UjBP GUVqbN23hcpI6HAdELSEuwuT3XCRAv6V/cCJlP8uNzA3KwNLuw+Qi2bNb083OBIFPTdQ ZDuhe4QYy8+l5r+GEVH75D2zwChWl/CylV6uiDWECtNh8PiSQ3W1pgwpDD+KM69oBlfE 7BiAF/dzFZ0a+iRc471JhUpXlesxZwv5NX1+lHAg57ICwHC4K61AFStRzsD57tycxEbi IaDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5g/o8PUZPrNAJIWyoOWEybfjQaVuCtrfU+HgSjaoumw=; b=jnXOi1fk8UtjXP/F48Ap3kXiPCY/+PueaI/kUGGd17SzR99XdWZPQwU8PZz4kwduBC ydi5kQ0HKXJtFyuRF74gxdAd1IZMQLbO5ETWmvIRZmXASk08j64O4GoilOR9OXmlKcCN NCUFAy9Q2rb+9k/J3qoE40O4iNR5CL5BFCpjifPxAtrkEcWbo1MXLb2gOV2xKdRVjATF V380wb2QqGlskr8HHAzc/VGhdru7kmGA6vuFNQIoRkE4uEjX5Qm6SYN2ga/QKbSEwoe9 IFF9fSlm9xkacvSn6vODXlHKfppzf63/0Wel7gvAELiccqX1SR59dU0WLohoc5QoXyN+ tkAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flowbird.group header.s=google header.b=kea5AkX0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flowbird.group Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o5si1505889edz.312.2020.05.20.04.16.41; Wed, 20 May 2020 04:17:04 -0700 (PDT) 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=@flowbird.group header.s=google header.b=kea5AkX0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flowbird.group Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbgETLPV (ORCPT + 99 others); Wed, 20 May 2020 07:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbgETLPV (ORCPT ); Wed, 20 May 2020 07:15:21 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 924DDC05BD43 for ; Wed, 20 May 2020 04:15:20 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id h26so2058669lfg.6 for ; Wed, 20 May 2020 04:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flowbird.group; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5g/o8PUZPrNAJIWyoOWEybfjQaVuCtrfU+HgSjaoumw=; b=kea5AkX0ou1aP/8ibJ65TsXqG7JKMLU5s5e4R3yHJGH+a+ozn11pQBzKtTGq34DtKo RpweiZTOmY7YZ4KFVqDxsCSVe2OZjBDZBVBIn/jeg4Qwn1W5PwPPJokOlzpOoj3vqshv cmORZuq7e91IWNiG9pAOQMeA6/vJ6mMkgATPDXMJg/5XElENes0TWwKd7wN3jFB9mLuO BQys++AIoeAGlaFcfW9EcbCvm3aHIe78PLHpGSPlZyBWp3wlWqbLeZ3RiP1G7rqRx0jJ lg4doC3DKqJzQHczPWTl76Im8fzgIXX6vJTOHa+LhhD+oYvNwbksAc+SLjunjyGdow94 JBeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5g/o8PUZPrNAJIWyoOWEybfjQaVuCtrfU+HgSjaoumw=; b=f5cvWNy++3jKzSVzQpP1Y9t5Aotgnp2L5aeTeC88BRjRHkTanO9yrOmg6pivwr95j9 d8QeCKAM+xNNj7GpX3rhwS7ic+HMJMMVXFLINoIUIEi0ohAqnETtX55P6CHI79n1cr+d EZ3Th0TQ0yAwh1u9YtSOQ/UQrDmzCv7SBstjGhHm+GJIeA1LGWGjEc6RHNyWlqq2EPYq ZC9b2H8IchmOR6VoMy6jZVs7HZOSOYxgDRzeKtbTKiWSpvCwrpmLnVztfZvV6MK6IcdH ynw5Gn/IUvtHvIXWQ+6flth9Hk1H+dRv+xHWtDmkcrhrmnirO4AVkqBvF1/+CCyh8obg W/yA== X-Gm-Message-State: AOAM5319Uvqeuvjv60GqvSIvrWXudmOa7xHgD5jmEw6kxO7W7A/KWTYp vnPCjS4l3ULm3XauRsijqEgNEypmItVpbmkNgzQi3Q== X-Received: by 2002:ac2:4d1c:: with SMTP id r28mr2303943lfi.45.1589973318888; Wed, 20 May 2020 04:15:18 -0700 (PDT) MIME-Version: 1.0 References: <1589969500-6554-1-git-send-email-martin.fuzzey@flowbird.group> In-Reply-To: From: "Fuzzey, Martin" Date: Wed, 20 May 2020 13:15:07 +0200 Message-ID: Subject: Re: [PATCH] drm/etnaviv: fix memory leak when mapping prime imported buffers To: Lucas Stach Cc: stable@vger.kernel.org, Christian Gmeiner , The etnaviv authors , "Linux-Kernel@Vger. Kernel. Org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lucas, > Am Mittwoch, den 20.05.2020, 12:10 +0200 schrieb Martin Fuzzey: > What's the use-case where you did hit this issue? mmap'ing of imported > buffers through the etnaviv DRM device is currently not well defined > and I was pondering the idea of forbidding it completely by not > returning a mmap offset for those objects. > I hit this on Android 8 (on i.MX6 using mesa 20.0.6 with gbm gralloc and drm hwcomposer) and had a memory leak every time an activity was started. I'm not sure exactly why but Android does a gralloc.lock() and gralloc.unlock() on every activity startup. Those map and unmap the buffer. Under Android (at least in 8+) the actual graphics buffer allocations are done by a dedicated process (android.hardware.graphics.allocator@2.0-service) because it uses a "binderized HAL" for the allocation [https://source.android.com/devices/architecture/hal-types] This means that buffers are *always* imported (though they are usually only mmaped for SW rendering or screen shots). Regards, Martin